diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-06-28 16:36:58 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-08-08 09:54:41 +0300 |
commit | 1200684b94bf18ae98ba63fb49e9cda546b4832a (patch) | |
tree | 1f34d2767951f54d11f0b9c8d48b0db04490d2c1 /platform/linux-dpdk | |
parent | 434495464693467ad995e8e8a339677e2a869326 (diff) |
linux-dpdk: pktio: optimize packet receive code
Remove if branch from packet_init() as all data touched by the function is
now located on the same cache line. Packet data prefetch has been removed
from input_pkts_minimal() to avoid excessive prefetching. Packet header
prefetch utilizes now odp_prefetch_store() as the header fields are being
initialized.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform/linux-dpdk')
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_internal.h | 4 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_packet_dpdk.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index 1b602c17a..37729b8f5 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -230,9 +230,7 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, odp_pktio_t input) pkt_hdr->p.l3_offset = ODP_PACKET_OFFSET_INVALID; pkt_hdr->p.l4_offset = ODP_PACKET_OFFSET_INVALID; - if (odp_unlikely(pkt_hdr->event_hdr.subtype != ODP_EVENT_PACKET_BASIC)) - pkt_hdr->event_hdr.subtype = ODP_EVENT_PACKET_BASIC; - + pkt_hdr->event_hdr.subtype = ODP_EVENT_PACKET_BASIC; pkt_hdr->input = input; } diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c index 7c7e8b090..c4fa3f0b7 100644 --- a/platform/linux-dpdk/odp_packet_dpdk.c +++ b/platform/linux-dpdk/odp_packet_dpdk.c @@ -943,7 +943,7 @@ static inline void prefetch_pkt(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - odp_prefetch(&pkt_hdr->p); + odp_prefetch_store(&pkt_hdr->p); } /** @@ -978,8 +978,6 @@ static inline int input_pkts_minimal(pktio_entry_t *pktio_entry, odp_packet_t pk packet_init(pkt_hdr, input); packet_set_ts(pkt_hdr, ts); - - odp_prefetch(rte_pktmbuf_mtod(pkt_to_mbuf(pkt), char *)); } return num; |