Skip to content

Commit

Permalink
net/bonding: fix reference count on mbufs
Browse files Browse the repository at this point in the history
[ upstream commit 814e79f ]

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: 2efb58c ("bond: new link bonding library")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
hushenggitcount authored and bluca committed Feb 17, 2022
1 parent 78ee199 commit c4a4ba7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bonding/rte_eth_bond_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,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++) {
Expand Down

0 comments on commit c4a4ba7

Please sign in to comment.