From patchwork Tue May 19 11:18:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicai Lu X-Patchwork-Id: 70425 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D9B7A0093; Tue, 19 May 2020 13:18:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D93401D5E7; Tue, 19 May 2020 13:18:36 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id 6AE241D5E7 for ; Tue, 19 May 2020 13:18:33 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 763CD522B7081B64CA0F; Tue, 19 May 2020 19:18:31 +0800 (CST) Received: from localhost (10.173.251.12) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 19 May 2020 19:18:21 +0800 From: luyicai To: CC: , , , , , , luyicai Date: Tue, 19 May 2020 19:18:12 +0800 Message-ID: <1589887092-26360-1-git-send-email-luyicai@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.173.251.12] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] drivers/net/bonding: fix bug for lacp negotiation failed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When two host is connected directly without any devices like switch, and also enable dedicated tx/rx queues on bonding devices slaves, rx_machine_update would recieving partner lacp negotiation packets, which partner's port mac filled with zeros. So in this situation, it would never go rx_machine branch with correct mac! Thus bond mode 4 will negotiation failed. Signed-off-by: luyicai --- drivers/net/bonding/rte_eth_bond_8023ad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index b77a37d..2002ec0 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -798,7 +798,8 @@ RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); partner = &lacp->lacpdu.partner; - if (rte_is_same_ether_addr(&partner->port_params.system, + if (rte_is_zero_ether_addr(&partner->port_params.system) || + rte_is_same_ether_addr(&partner->port_params.system, &internals->mode4.mac_addr)) { /* This LACP frame is sending to the bonding port * so pass it to rx_machine.