diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-10-04 12:57:11 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-10-11 10:51:34 +0300 |
commit | 85d0a475b8af80cda0e529eabade0bc967a089f1 (patch) | |
tree | 9113b78e47c9a0102854ea8d352314ffd4329573 /platform/linux-dpdk/include/odp/api | |
parent | 20f72ad7aaa957e5890597d2dcea5d1ef7950a2f (diff) |
linux-dpdk: packet: optimize odp_packet_free_multi() implementation
Implement odp_packet_free_multi() function using new
rte_pktmbuf_free_bulk() API. The API is still marked as experimental in
DPDK 19.11 and 20.11 releases, but there are no changes in the official
version available in 21.11.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include/odp/api')
-rw-r--r-- | platform/linux-dpdk/include/odp/api/plat/packet_inlines.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h index 097ea2b1d..5b853abb2 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h @@ -457,10 +457,7 @@ _ODP_INLINE void odp_packet_free(odp_packet_t pkt) _ODP_INLINE void odp_packet_free_multi(const odp_packet_t pkt[], int num) { - int i; - - for (i = 0; i < num; i++) - rte_pktmbuf_free((struct rte_mbuf *)pkt[i]); + rte_pktmbuf_free_bulk((struct rte_mbuf **)(uintptr_t)pkt, (unsigned int)num); } _ODP_INLINE void odp_packet_free_sp(const odp_packet_t pkt[], int num) |