Age | Commit message (Collapse) | Author |
|
The table and the accessor would be used by ODP-DPDK, when it scans
through all the pktio interfaces to flush out TX completed buffers.
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
It's possible that two threads want to use the same packet IO in the same
time, but one wants RX while the other wants TX. In this case they would
block each other unnecessary on the same lock. This could be seen e.g.
with odp_l2fwd.
Replace that lock with two new ones for each direction. Most callers need
both, but send and receive can work with only one.
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Adds support for configuring packet pool to a class-of-service.
linux-generic packet parser is enhanced to parse a packet directly from
a memory location rather than from odp_packet_t.
packet receive code is modified to run packet classifier directly from
the stream so that the packet can be allocated from the pool specified
by the CoS.
Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Add API function for printing implementation specific pktio
debug information.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
platform/linux-generic/odp_packet_io.c
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
stopped
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
sending
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
According to API odp_pktio_close() can be called only for stopped
pktio. So in odp_pktio_term_global try to stop it first then
call close. Also check all returns codes.
https://bugs.linaro.org/show_bug.cgi?id=1854
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
|
|
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Right now, pktio_term calls term on all pktio type but
some pktio might still be be opened. Although the user should
probably close its pktio before termintating the application,
it is safer to iterate on all pktio and close them in the
pktio_term function.
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Use ticket locks in pktio entries to prevent threads from
being starved.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-and-tested by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
This patch fills the buffer list requested by the user before
filling the internal pktio queue.
Previous behaviour was:
* Fetch from queue
* If not enough
* Read from pktio and put all buffers to the queue.
Now:
* Fetch from queue
* If not enough
* Read from pktio
* Fill use request as much as possible
* If there are buffer left, push them to the queue.
On pktio_perf with loop interface, I see ~10% speedup with this patch
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-and-tested-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Packet input does not call packet_classifier function when
there are no cos (pmr, default cos or l2/l3 table) set for
the pktio interface.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Actual check/changes of the pktio state is now done by the pktio
global interface.
Each pktio can still implement a start/stop function to do additional
actions.
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
If pktio in state stop return 0, which means no packets was
received but that pktio is good to be sheduled next time.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
|
|
Each pktio type can now provide an optional init and term function to set
and clean itself up.
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
include/odp/api/packet_io.h
platform/linux-generic/include/odp_packet_io_internal.h
platform/linux-generic/odp_packet_io.c
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Each packet_io type now implements a pktio_if_ops_t structure which serves
as the only interface use by odp_packet_io.c.
The type of a device is retrieved by calling the pktio_XX open function in
order from the global pktio_if_ops struct and by stopping on the
first successful order.
As a result odp_pktio_type_t has been removed, and implementation can
be extended by just adding a new pktio_if_opts_t structure to pktio_if_opts
Signed-off-by: Clément Leger <cleger@kalray.eu>
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Add temporarly function definitions to odp_packet_io_internal.h instead
of odp_packet_socket.h to obtain pktio_entry_t definition
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Add temporarly function definitions to odp_packet_io_internal.h instead
of odp_packet_socket.h to obtain pktio_entry_t definition
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Add temporarly function definitions to odp_packet_io_internal.h instead
of odp_packet_socket.h to obtain pktio_entry_t definition
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Add temporarly function definitions to odp_packet_io_internal.h instead
of odp_packet_socket.h to obtain pktio_entry_t definition
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
functions
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Both linux/if.h and net/if.h were used but they are not
necesseraly compatible and it is not possible to include
both in the same file.
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Lazy parsing defers parsing until the results are actually needed.
This allows applications that do their own parsing and never reference
ODP parse results to avoid the overhead of SW parsing.
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Packet IO interface level parameters are needed e.g. to
select input mode. User must select and use one input mode
(sched, poll or recv) per pktio interface.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Calling odp_pktio_inq_remdef() causes the pktio's inq_default to be set
to ODP_QUEUE_INVALID, but when the scheduler later polls the pktio it
fails to check the validity of inq_default and ends up passing a bogus
pointer to queue_enq_multi().
Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Scheduler runs by polling scheduler priority queues for schedule
commands. There are two types of scheduler commands: queue dequeue
and packet input poll. Packet input is polled directly when a poll
command is received. From schduler point of view, the default
packet input queue is like any other queue.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
CID: 85427
https://bugs.linaro.org/show_bug.cgi?id=1175
get_pktio_entry() can return NULL entry then it can be derefenced
inside is_free(entry).
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
|
|
ssize_t is a POSIX type. API definition must be pure C (C99).
Int is at least 16 bits and can hold any mac address size.
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Yan Songming <yan.songming@linaro.org>
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Robbie King <robking@cisco.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Pktio code uses snprintf instead of strncpy for name copying.
https://bugs.linaro.org/show_bug.cgi?id=1055
CID 85426: Buffer not null terminated (BUFFER_SIZE_WARNING)
Calling strncpy with a maximum size argument of 16 bytes on
destination array "pktio_entry->s.name" of size 16 bytes might
leave the destination string unterminated.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
|