Patchwork [dpdk-dev] net/bonding: fix slave tx burst for mode 4

login
register
mail settings
Submitter Yunjian Wang
Date Feb. 11, 2019, 8:01 a.m.
Message ID <1549872096-16116-1-git-send-email-wangyunjian@huawei.com>
Download mbox | patch
Permalink /patch/722593/
State New
Headers show

Comments

Yunjian Wang - Feb. 11, 2019, 8:01 a.m.
From: Yunjian Wang <wangyunjian@huawei.com>

Now sending 0 packet it doesn't consider for LACPDUs,
but the LACPDUs should be checked and sended.

Fixes: 09150784a776 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org

Reported-by: Hui Zhao <zhaohui8@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 44deaf1..a77af19 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1298,9 +1298,6 @@  struct bwg_slave {
 
 	uint16_t i;
 
-	if (unlikely(nb_bufs == 0))
-		return 0;
-
 	/* Copy slave list to protect against slave up/down changes during tx
 	 * bursting */
 	slave_count = internals->active_slave_count;
@@ -1310,6 +1307,9 @@  struct bwg_slave {
 	memcpy(slave_port_ids, internals->active_slaves,
 			sizeof(slave_port_ids[0]) * slave_count);
 
+	if (unlikely(nb_bufs == 0))
+		goto lacp_send;
+
 	dist_slave_count = 0;
 	for (i = 0; i < slave_count; i++) {
 		struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]];
@@ -1365,6 +1365,7 @@  struct bwg_slave {
 		}
 	}
 
+lacp_send:
 	/* Check for LACP control packets and send if available */
 	for (i = 0; i < slave_count; i++) {
 		struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]];