From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Kinzie Subject: [PATCH v2 6/6] bond: do not activate slave twice Date: Fri, 19 Feb 2016 11:17:53 -0800 Message-ID: <1455909473-13539-7-git-send-email-ehkinzie@gmail.com> References: <8CEF83825BEC744B83065625E567D7C219FB2C51@IRSMSX108.ger.corp.intel.com> <1455909473-13539-1-git-send-email-ehkinzie@gmail.com> Cc: Eric Kinzie To: dev@dpdk.org Return-path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id C5B93C5BC for ; Sat, 20 Feb 2016 09:07:34 +0100 (CET) Received: by mail-pf0-f176.google.com with SMTP id c10so65972656pfc.2 for ; Sat, 20 Feb 2016 00:07:34 -0800 (PST) In-Reply-To: <1455909473-13539-1-git-send-email-ehkinzie@gmail.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Eric Kinzie The current code for detecting link during slave addition can cause a slave interface to be activated twice -- once during slave_configure() and again at the end of __eth_bond_slave_add_lock_free(). This will either cause the active slave count to be incorrect or will cause the 802.3ad activation function to panic. Ensure that the interface is not activated more than once. Signed-off-by: Eric Kinzie Signed-off-by: Stephen Hemminger Acked-by: Declan Doherty --- drivers/net/bonding/rte_eth_bond_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 630a461..def22d0 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -432,7 +432,11 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) !internals->user_defined_primary_port) bond_ethdev_primary_set(internals, slave_port_id); - activate_slave(bonded_eth_dev, slave_port_id); + + if (find_slave_by_id(internals->active_slaves, + internals->active_slave_count, + slave_port_id) == internals->active_slave_count) + activate_slave(bonded_eth_dev, slave_port_id); } } return 0; -- 1.7.10.4