[PATCH] examples/ipsec-secgw: use bulk free

Anoob Joseph anoobj at marvell.com
Thu Dec 21 05:40:33 CET 2023


Use rte_pktmbuf_free_bulk() API instead of looping through the packets
and freeing individually.

Signed-off-by: Anoob Joseph <anoobj at marvell.com>
Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
---
 examples/ipsec-secgw/ipsec-secgw.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.h b/examples/ipsec-secgw/ipsec-secgw.h
index 53665adf03..8baab44ee7 100644
--- a/examples/ipsec-secgw/ipsec-secgw.h
+++ b/examples/ipsec-secgw/ipsec-secgw.h
@@ -232,10 +232,7 @@ free_reassembly_fail_pkt(struct rte_mbuf *mb)
 static inline void
 free_pkts(struct rte_mbuf *mb[], uint32_t n)
 {
-	uint32_t i;
-
-	for (i = 0; i != n; i++)
-		rte_pktmbuf_free(mb[i]);
+	rte_pktmbuf_free_bulk(mb, n);
 
 	core_stats_update_drop(n);
 }
-- 
2.25.1



More information about the dev mailing list