ethdev: use mbuf bulk free API
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 30 Sep 2020 21:27:18 +0000 (14:27 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 8 Oct 2020 17:58:11 +0000 (19:58 +0200)
The mbuf library now has routine to free multiple buffers.
Loop is no longer needed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
lib/librte_ethdev/rte_ethdev.c

index 48d1333..b51ab9b 100644 (file)
@@ -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;
 }