From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7324CA00E6 for ; Thu, 18 Apr 2019 04:13:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B5D44CC3; Thu, 18 Apr 2019 04:13:07 +0200 (CEST) Received: by dpdk.org (Postfix, from userid 33) id 545584CC3; Thu, 18 Apr 2019 04:13:05 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Thu, 18 Apr 2019 02:13:05 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: ethdev X-Bugzilla-Version: 18.11 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: fengchunsong@huawei.com X-Bugzilla-Status: CONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 256] Transmit or receive packets use the bond MAC is failed when switch backup port to active 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" Message-ID: <20190418021305.Mt6coTapePZemNuNJfpZQput_j8kyJXXcDwbgmqrDko@z> https://bugs.dpdk.org/show_bug.cgi?id=3D256 Bug ID: 256 Summary: Transmit or receive packets use the bond MAC is failed when switch backup port to active Product: DPDK Version: 18.11 Hardware: All OS: All Status: CONFIRMED Severity: major Priority: Normal Component: ethdev Assignee: dev@dpdk.org Reporter: fengchunsong@huawei.com Target Milestone: --- 1.Problem Description Create a active-backup bond device, when primary port link down=EF=BC=8Csla= ve port changes to primary=EF=BC=8Cbut new primary mac is not change to the bonding= MAC. Transmit or receive packets use the bond MAC is failed. 2.analyze The bonding pmd call mac_address_slaves_update to modify the MAC of all slaves:the primary use bond mac addrs, and other slaves to use the slave's = MAC. The code is incorrect using primary_port instead of current_primary_port. diff --git a/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c b/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c index 44deaf1..1c5bc2d 100644 --- a/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1627,7 +1627,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev) if (internals->slaves[i].port_id =3D=3D internals->current_primary_port) { if (rte_eth_dev_default_mac_addr_set( - internals->primary_port, +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 internals->current_primary_port, =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 bonded_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address", =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 internals->current_primary_port); Bonding pmd sets slave's mac according to current_primary_port. The current_primary_port changes in the following scenario: 1. add slave to bond, the first slave will set the current_primary_port, ch= ange the order of adding the slave, current_primary_port will be different. 2. The user specifies primary_port via rte_eth_bond_primary_set 3. delete the primary slave 4 --=20 You are receiving this mail because: You are the assignee for the bug.=