]> git.droids-corp.org - dpdk.git/commitdiff
net/bonding: fix reference count on mbufs
authorMin Hu (Connor) <humin29@huawei.com>
Fri, 28 Jan 2022 02:25:33 +0000 (10:25 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 31 Jan 2022 14:16:22 +0000 (15:16 +0100)
In bonding Tx broadcast mode, Packets should be sent by every slave,
but only one mbuf exits. The solution is to increment reference count
on mbufs, but it ignores multi segments.

This patch fixed it by adding reference for every segment in multi
segments Tx scenario.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/bonding/rte_eth_bond_pmd.c

index d2fcfad6761996aa24f57517d7fa14664dadf599..bfa931098e4856b5ae8ff99c5dc3b810b7cf910c 100644 (file)
@@ -1318,7 +1318,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
 
        /* Increment reference count on mbufs */
        for (i = 0; i < nb_pkts; i++)
-               rte_mbuf_refcnt_update(bufs[i], num_of_slaves - 1);
+               rte_pktmbuf_refcnt_update(bufs[i], num_of_slaves - 1);
 
        /* Transmit burst on each active slave */
        for (i = 0; i < num_of_slaves; i++) {