From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 051455B30 for ; Mon, 30 Jul 2018 18:14:43 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkAok-00009D-O5; Mon, 30 Jul 2018 16:14:42 +0000 From: Christian Ehrhardt To: Kiran Kumar Cc: dpdk stable Date: Mon, 30 Jul 2018 18:11:03 +0200 Message-Id: <20180730161342.16566-18-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'net/bonding: fix MAC address reset' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:14:43 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From be0a4cc0c6f791c8f6fcda1a3d360bbefc678a06 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Wed, 23 May 2018 14:41:21 +0530 Subject: [PATCH] net/bonding: fix MAC address reset [ upstream commit fb6eb1e69c499feb5f36193b906c910553835cc6 ] Currently when resetting bond mac address, we are getting the persisted mac address from slave info considering primary port as index. But we need to compare the port id from slave info with the primary port to get the primary slave index and get the persisted mac address. Without this fix, persisted mac addr will be zero and rte_eth_dev_default_mac_addr_set will fail. Fixes: a45b288ef21a ("bond: support link status polling") Signed-off-by: Kiran Kumar --- drivers/net/bonding/rte_eth_bond_api.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index d558df8b9..d1a110ec9 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -716,9 +716,21 @@ rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) internals->user_defined_mac = 0; if (internals->slave_count > 0) { + int slave_port; + /* Get the primary slave location based on the primary port + * number as, while slave_add(), we will keep the primary + * slave based on slave_count,but not based on the primary port. + */ + for (slave_port = 0; slave_port < internals->slave_count; + slave_port++) { + if (internals->slaves[slave_port].port_id == + internals->primary_port) + break; + } + /* Set MAC Address of Bonded Device */ if (mac_address_set(bonded_eth_dev, - &internals->slaves[internals->primary_port].persisted_mac_addr) + &internals->slaves[slave_port].persisted_mac_addr) != 0) { RTE_BOND_LOG(ERR, "Failed to set MAC address on bonded device"); return -1; -- 2.17.1