[PATCH 03/20] gso: use rte_pktmbuf_free_bulk

Stephen Hemminger stephen at networkplumber.org
Fri May 8 22:33:24 CEST 2026


Replace open-coded loop with rte_pktmbuf_free_bulk().

Generated by devtools/cocci/free_bulk.cocci.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/gso/gso_common.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/gso/gso_common.c b/lib/gso/gso_common.c
index 378bf2c6aa..6ccaa7103a 100644
--- a/lib/gso/gso_common.c
+++ b/lib/gso/gso_common.c
@@ -31,10 +31,7 @@ hdr_segment_init(struct rte_mbuf *hdr_segment, struct rte_mbuf *pkt,
 static inline void
 free_gso_segment(struct rte_mbuf **pkts, uint16_t nb_pkts)
 {
-	uint16_t i;
-
-	for (i = 0; i < nb_pkts; i++)
-		rte_pktmbuf_free(pkts[i]);
+	rte_pktmbuf_free_bulk(pkts, nb_pkts);
 }
 
 int
-- 
2.53.0



More information about the dev mailing list