From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by dpdk.org (Postfix) with ESMTP id 95A0AAD8C for ; Tue, 1 Mar 2016 18:32:30 +0100 (CET) Received: by mail-pf0-f196.google.com with SMTP id l6so1810882pfl.0 for ; Tue, 01 Mar 2016 09:32:30 -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=hzarjITW6iNwjs7rlMPHgE5Fk2GNkU3rmSVyDvh9prQ=; b=cGJSzs3JfH5ZkHjuJqr5swZ8IEiaswMGN54rdmV4nuU9cthqGA67eZiH+hTJQdHKSa 6TQKlmPq0FXx8oULNsoZkqHOUhzHDZcLZ6weO/piZY9IsH7sZZOcWh+S2EEER0UMd0+r NE60kWyk/HILjniE3MmxGicxkGY8aD69AIug/lJAYqbabaxXhsRNOrxa2uO+9ANKF5IC nG2KGSXyUT9NXv8ZCedp+EQ99xI/IpkLjwWOsxCkCeqNY5skVmsWj43iNak3FHOoFgAf 5RCw5ggVcrVhHpzhYgGDJoRb03JVt+SmsNnintG8d/o3G4nQM6AX25x6vLjWSuvn1O9f f/kg== 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=hzarjITW6iNwjs7rlMPHgE5Fk2GNkU3rmSVyDvh9prQ=; b=bWW5EL0/RhlOAi0wOPQSm/Woqr6BY/ZNk1+nSDlewDm0klQRr9XIWqJv/ZxNjAsbMX HK3f6N1r0T+GvuJ2z1gROhdwUN/iYIzbzepsUbsvYVVO7VCXdSadgo0QzcYRnMeUwpri KFLGA0BxAK46ha3fHcpACNBPSnsV8OOf/kif0gr6OM1LuTPAXN5GUwAPtOVzldeEYO4+ kNWm5A3WkhvpeCauA9fq8NmksSxOiUB1mUNzxFSw+ltnOgDSyk1xd4nTdfSEHeB0nmT+ bO1qE4yEw0qNmfDqPu8a3dXhmgrjEJTaqbXQoevv0ZhaCYRQM/KkBPoMnSCR+mQluy0X LRhQ== X-Gm-Message-State: AD7BkJIzY1TKthxWvJ9k+mIvzzX5qZmpWUj/3PyGPbSs8z0JGaloPo47DcBu0oqf4lo/vA== X-Received: by 10.98.79.203 with SMTP id f72mr7184661pfj.102.1456853550056; Tue, 01 Mar 2016 09:32:30 -0800 (PST) Received: from buildhost2.vyatta.com. ([144.49.132.22]) by smtp.gmail.com with ESMTPSA id y27sm46938069pfi.82.2016.03.01.09.32.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Mar 2016 09:32:28 -0800 (PST) From: Eric Kinzie To: dev@dpdk.org Date: Tue, 1 Mar 2016 09:32:02 -0800 Message-Id: <1456853522-4864-5-git-send-email-ehkinzie@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1456853522-4864-1-git-send-email-ehkinzie@gmail.com> References: <8CEF83825BEC744B83065625E567D7C219FB4852@IRSMSX108.ger.corp.intel.com> <1456853522-4864-1-git-send-email-ehkinzie@gmail.com> Cc: Eric Kinzie Subject: [dpdk-dev] [PATCH V3 4/4] 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: Tue, 01 Mar 2016 17:32:31 -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. Fixes: 46fb43683679 ("bond: add mode 4") 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; -- 2.1.4