Skip to contentSkip to conversation

examples/ipsec-secgw: use bulk free

PATCH Applied Anoob Joseph 3 participants 3 messages Dec 21, 2023 – Jan 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/ipsec-secgw: use bulk free

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

---
 examples/ipsec-secgw/ipsec-secgw.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
examples/ipsec-secgw/ipsec-secgw.h +1 -4
index 53665adf03..8baab44ee7 100644
@@ -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);
 }
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines

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

---
 examples/ipsec-secgw/ipsec-secgw.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
examples/ipsec-secgw/ipsec-secgw.h +0 -0
index 53665adf03..8baab44ee7 100644
@@ -232,10 +232,7 @@ free_reassembly_fail_pkt(struct rte_mbuf *mb)
 static inline void
 free_pkts(struct rte_mbuf *mb[], uint32_t n)

examples/ipsec-secgw/ipsec-secgw.h free_reassembly_fail_pkt(struct rte_mbuf *mb)

Quoted 10 lines
examples/ipsec-secgw/ipsec-secgw.h +1 -5
 {
-	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);
 }
--
Quoted 1 line

2.25.1