From: Stephen Hemminger Date: Wed, 30 Sep 2020 21:27:18 +0000 (-0700) Subject: ethdev: use mbuf bulk free API X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bfa63c4d7b65a3a94d659a0be9526153987afd86;p=dpdk.git ethdev: use mbuf bulk free API The mbuf library now has routine to free multiple buffers. Loop is no longer needed. Signed-off-by: Stephen Hemminger Reviewed-by: Andrew Rybchenko --- diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 48d1333b17..b51ab9b5bf 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2166,10 +2166,7 @@ void rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent, void *userdata __rte_unused) { - unsigned i; - - for (i = 0; i < unsent; i++) - rte_pktmbuf_free(pkts[i]); + rte_pktmbuf_free_bulk(pkts, unsent); } void @@ -2177,11 +2174,8 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, void *userdata) { uint64_t *count = userdata; - unsigned i; - - for (i = 0; i < unsent; i++) - rte_pktmbuf_free(pkts[i]); + rte_pktmbuf_free_bulk(pkts, unsent); *count += unsent; }