From patchwork Fri Dec 4 17:14:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 9359 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4081891F1; Fri, 4 Dec 2015 18:14:23 +0100 (CET) Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id D63CF91CB for ; Fri, 4 Dec 2015 18:14:19 +0100 (CET) Received: by pfnn128 with SMTP id n128so28938026pfn.0 for ; Fri, 04 Dec 2015 09:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MNdaVdd3s80EIE6SnN1lLuTsT5NKeP13cQxo3v6JPMA=; b=k/HZCsAGpAugbqUV1dtiO5J4G4roA2XidP+/tSe0QmSbYYAM103d52Tir2vEY6fMCc tn2Oh0f8nbqjemJDJfrpmYqS3l9VOn1I1lcjBo7iKnbNKpMnUbshdfcAj2OXfbBBD4on WzVGfV2uTvYWcz3rPFP0dNB4VpaNNq1nSvd7o3S+G+Z18LmGVtk141BFpe90Cz5JAkWu QpZY5NVmOZ0g4v8vF+Cllq0eQ0RlvvuYvp+vq0aJbiitdMuEEmHMIK90ptHvkEMt7wK0 2rN7cYVKQo3hnT96pM9WKo/BIwS0KIghYNZdySni/Atv5xIbeO8HlpIEd8aiyAoztQ9e lDTQ== 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=MNdaVdd3s80EIE6SnN1lLuTsT5NKeP13cQxo3v6JPMA=; b=Dk6cqZZ+4UvinLJEw5q8x6pwPLlQ45odrw2b9JQ2WWkGYv3hCJBNuIL2m9eH1WOudr JYEPk6SEt+rNg8NsW2pqdDpQb3E1hGsXAIXJ1DbXRhvl7Nz7Ifipr3dIECdF1xeqVc2l qXN7ggxlvz7yB8AwI2KpnyrWlJZ4xgxz6nTibTYkqrmJiKuOfVjCvESOHmrXjDbFcCD2 4yl1cL+XwUzbDGXg2G4YQNzTquh84aeFoYUY09EabDZAiL/016UG4PHCN1X8orRh1vmA /i6PIiOo/pC7/PoyNbgjwTCUKurVrqXqm2SM5XK+LgzvfGOXHeTuzLcdrpdQqbHBZfGG jNgA== X-Gm-Message-State: ALoCoQmU/402WM0PQ58JwfxqN+JMK/BUbTeJtuDCPA6Dd+9MbqbS8T8Xn2kyAdqw1vc9fMtEXU/p X-Received: by 10.98.12.205 with SMTP id 74mr22794888pfm.53.1449249259310; Fri, 04 Dec 2015 09:14:19 -0800 (PST) Received: from xeon-e3.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id 134sm18291003pfa.30.2015.12.04.09.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Dec 2015 09:14:18 -0800 (PST) From: Stephen Hemminger To: declan.doherty@intel.com Date: Fri, 4 Dec 2015 09:14:20 -0800 Message-Id: <1449249260-15165-9-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449249260-15165-1-git-send-email-stephen@networkplumber.org> References: <1449249260-15165-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org, Eric Kinzie Subject: [dpdk-dev] [PATCH 8/8] 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: , 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 91b3819..956a87d 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -447,7 +447,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;