From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3p4XeDqnYHvmPf4HkRSv64ABSZvxSFU1Jagjkxo9enc=; b=lvCvFONULg20XIC7qyGHbyXmTahFH6mJw2AHf6uAIX5kgObzkXyJYtFwJ79vPnt/T+ /rTklMmoSIA8sIyuDXk1C9cd0ewFDYqrS7vBPA2W1PMSgbD9Uh/2qlAk7Rxtu4eMzcm7 Yac54shg9NWrP9bKfRG9QKu3ORl44SZcXd6QcpuZ4JiVViz6FtEtRryIXIrOBkrUO+Jc gj9IhzI65xXM5EMBXrub7CRzcZNoEtX/k2UHcx33U9SO3AWV6BCllopy/7ItA/aqhkjl 69XSWsUzvPtfOfLjXvrFEA5gSCCgfbL7MFK0p5/TieduuEdPBcp87hEz4Zs0ilvXuP8I TsTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3p4XeDqnYHvmPf4HkRSv64ABSZvxSFU1Jagjkxo9enc=; b=eyMScFGfaHzD3HgAiwC9bQPqVJTARRx6gjGHDlOxsG2sEQ7JpxXIE71mr+aBFDZiRS +xgooyNFypdc8+L1yiQdqFnbGWoY7KHBOwO8yleb7osVed+iLnB5/X6CD1H90y9WGPFM nCr2FlrBhQ1uy3aAMGSDE2gr3LzVj/aBI658geaBjnJlyn7h+aHBHZMdB6aeOtQ0R9Q0 ZWojUcFvyqzTNxZV92/hTT3OqCzbvC2AMuVMYxYYW1Xbrex/psRU5z3UMe4ze/Z/NPjC dyFthzwuqzHdQrXv5H/stNGTXuS+zzfGJQFOmbXxtkbjAWEQb9GUmn9yHH1PHBahE1aZ pdkA== X-Gm-Message-State: AG10YORUiiPNnB0n7vgBi0OqoaMHnxONG4//TWgGbVjGXdNFL2+44LuDKRIlsYM3ZD0K7A== X-Received: by 10.98.64.26 with SMTP id n26mr20490691pfa.149.1455909505916; Fri, 19 Feb 2016 11:18:25 -0800 (PST) Received: from buildhost2.vyatta.com. ([144.49.132.22]) by smtp.gmail.com with ESMTPSA id tp6sm19670555pab.25.2016.02.19.11.18.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 11:18:24 -0800 (PST) From: Eric Kinzie To: dev@dpdk.org Date: Fri, 19 Feb 2016 11:17:53 -0800 Message-Id: <1455909473-13539-7-git-send-email-ehkinzie@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1455909473-13539-1-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 Subject: [dpdk-dev] [PATCH v2 6/6] bond: do not activate slave twice X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2016 08:07:35 -0000 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