diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-06-23 14:18:07 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-06-30 16:53:06 +0300 |
commit | 2185eb797299373bfeda064541358200227e77f2 (patch) | |
tree | 3d94647412c1a0bb2300bfe6915ae749e06b407a | |
parent | c625f8472403018065dace9f61b7024f953d2c87 (diff) |
Port 947128a95 "linux-gen: pktio: move received packets to the pool indicated by CoS"
Port original commit from linux-generic.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_io_internal.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index db18d6849..1a98397dd 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -333,6 +333,27 @@ int _odp_lso_create_packets(odp_packet_t packet, const odp_packet_lso_opt_t *lso void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry, const odp_packet_t packets[], int num); +static inline int _odp_pktio_packet_to_pool(odp_packet_t *pkt, + odp_packet_hdr_t **pkt_hdr, + odp_pool_t new_pool) +{ + odp_packet_t new_pkt; + + if (odp_likely(new_pool == odp_packet_pool(*pkt))) + return 0; + + new_pkt = odp_packet_copy(*pkt, new_pool); + + if (odp_unlikely(new_pkt == ODP_PACKET_INVALID)) + return 1; + + odp_packet_free(*pkt); + *pkt = new_pkt; + *pkt_hdr = packet_hdr(new_pkt); + + return 0; +} + #ifdef __cplusplus } #endif |