Age | Commit message (Collapse) | Author |
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
Add new AF_XDP socket based packet IO implementation. Information about
AF_XDP and XDP can be found in [1].
ODP packet pool(s) created for packet IO entries are used as the UMEM
areas. Currently, only zero-copy mode is supported, copy-mode support
will be added later.
Depending on the XDP program loaded into the environment's NIC(s), TX
and RX queue selection for packets may differ. By default, only a single
combined queue is supported and this may require changing the
configuration of the NIC accordingly so that packets end up on the
AF_XDP socket created by ODP.
[1] https://www.kernel.org/doc/Documentation/networking/af_xdp.rst
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Adapt DPDK packet IO to use the new `_odp_pool_mem_src_ops_t` interface.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Add _ODP_ prefixes to implementation internal helper macros and collect
common macros into a single header file (odp_macros_internal.h). Unused
macros (DIV_ROUND_UP, odp_container_of) have been removed.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
|
|
Remove the odp_ipsec_result() call that is made just in case it performs
some post-processing for odp_ipsec_out_inline(). Since no post-processing
is actually done and since the call currently generates a warning (due to
unchecked return value), simply remove the call.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Update odp_pktin_recv_mq_tmo() and other parts of packet IO
to use uint32_t instead of 'unsigned int'.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
If received packet data segments are smaller than the parser
contiguous data requirement, copy to memory.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Don't count packets with errors in in_octets and in_packets. Add
in_errors and in_discards counters.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
When encountering a packet error in packet parser and pktin has been
configured to drop on that kind of packet error, return an error,
which causes pktio to drop the packet.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Instead of calling *_packet_parse_layer() when classifier is not
enabled, always call *_packet_parse_common().
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Unlike _odp_packet_parse_layer(), _odp_packet_parse_common() (which is
called when classifier is enabled) does not validate L4 checksum. Call
_odp_packet_l4_chksum() directly in each pktio, when classifier is
enabled.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Copy packet data to memory for parsing if segment size is smaller than
parser requirement (PARSE_BYTES) and the packet is longer than a
segment. The latter check was for whether the packet is longer than
PARSE_BYTES, but that leaves the possibility of a multi-segment packet
equal to or shorter than PARSE_BYTES.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
Remove conditional code that is not relevant anymore from DPDK 19.11
onwards.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
In `dpdk_open()`, when `rte_eth_dev_info_get()` is called for the first
time, handle its return value.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Main impacts:
- A few macro name deprecations, new names taken into use, old names
mapped to the new names with older versions.
- rte_eth_dev_set_mtu() is now forbidden to be used before device is
configured (rte_eth_dev_configure()), so "MTU-settability" checking
becomes less complete: support can still be inferred based on return
codes but proper error checking cannot be done due to the pre-config
condition.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
With zero-copy, DPDK seems to expect external memory buffers that would
be crossing a hugepage boundary to be aligned to the boundary. This isn't
the case with ODP pools as boundary-crossing buffers are skipped and unused
but still part of the pool. Thus, change DPDK external memory pool
population to be done with several virtually and physically contiguous
chunks as dictated by the skipped buffers.
This additionally fixes zero-copy operation with Mellanox NICs, which
didn't work properly with the previous single memory chunk population.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Change the value of PACKET_PARSE_SEG_LEN from 96 to PARSE_ETH_BYTES +
PARSE_L3_L4_BYTES, which is 110 bytes. Also change the name of the
macro to PARSE_BYTES, which is in line with other similar macros.
The parse function itself does not change, only the value (and name)
of the macro changes.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Increment in_errors only on parse errors, and in_packets and in_octets
only on successfully parsed and classified errorless packets.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Use the in_discards counter for errors that are not errors in the
received packet.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Move packet parsing functions to new odp_parse.c and
odp_parse_internal.h files.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Instead of calling _odp_packet_parse_common() in
_odp_cls_classify_packet(), make the call in pktio before the classify
call. This is cleaner and makes for better error handling.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
When classification result is to drop the packet, make all pktios do
so cleanly without logging errors.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
When incrementing in_packets, don't subtract failed from num_rx, since
it was never added there.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Implement new packet output queue size API for dpdk pktio.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Free possible remaining packets in the implementation's internal plain
queue during odp_pktio_close() or odp_pktout_queue_config().
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Implement new packet output queue size API for loop pktio.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
When freeing copied packets after zero-copy send, copy need was checked
by accessing the packet header. At this point, the data may or may not
be valid anymore. Fix this by saving the indices of copied packets
already beforehand and use those for later access.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Don't include odp_api.h header inside the implementation files as it
unnecessarily includes all API headers. The remaining includes have been
cleaned up and grouped.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
Rename implementation internal copy_packet_cls_metadata() function
to _odp_packet_copy_cls_md() to better align with internal function naming
convention. The argument order has also been swapped for the same reason.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
When compiling with LTO, the compiler may complain about uninitialized
variable access in case odp_shm_info would fail. Return a pointer to a
static string instead of an uninitialized pointer in that case.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Add missing whitespace to `sock_init_global()` log.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
Use common _odp_event_hdr_t in odp_buffer_hdr_t. Cache line alignment
constraint has been moved to odp_buffer_hdr_t.
The implementation internal scheduler and queue interfaces have been
modified to use event headers instead of buffer headers.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Use common _odp_event_hdr_t in odp_packet_hdr_t. Cache line alignment
constraint has been moved to odp_packet_hdr_t.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
Merge fixes done to the generic packet parsing code (ad9638fd9, 50fe59300,
adae181a7) into the DPDK specific packet parsing implementation.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
|
|
Use common implementation internal debug macro ODP_DBG_LVL() to avoid
"ISO C99 requires at least one argument for the "..." in a variadic macro"
errors when building with 'pedantic' option.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Fix "format '%p' expects argument of type 'void *'" errors when building
with 'pedantic' option.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Fix "ISO C does not allow extra ';' outside of a function" errors when
building with 'pedantic' option.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Fix "ISO C forbids an empty translation unit" errors when building with
'pedantic' option.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Fix "overflow in conversion from 'int' to 'char' changes value" errors when
building with 'pedantic' option.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Merge fixes done to the generic packet parsing code (ad9638fd9, 50fe59300,
adae181a7) into the DPDK specific packet parsing implementation.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
The receive processing in loop pktio processes packets that have the same
underlying packet buffers as they had when sent. This means that, unlike
other pktios that allocate packet buffers, loop may have packets with
inconvenient segment boundaries in the receive path. Such packets may
get parsed incorrectly since loop uses a parsing function that assumes
contiguous packet data for the parsed headers.
Fix the problem by doing parsing using odp_packet_parse() which can
handle segmented packets too.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|
|
Fix the check in mbuf_update() which detects if mbuf data offset needs to
be updated. The previous check didn't detect a scenario where data offset
was not at default value (caused by e.g. odp_packet_push_head()).
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reported-and-tested-by: Christian Hong <guochun.hgc@alibaba-inc.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
|