From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by dpdk.org (Postfix) with ESMTP id 80DB1C5B2 for ; Sat, 20 Feb 2016 07:58:18 +0100 (CET) Received: by mail-pa0-f45.google.com with SMTP id yy13so62271692pab.3 for ; Fri, 19 Feb 2016 22:58:18 -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=Nk2HH4AXuBIej/2UtOtaeOh7Oth0H0mRhVIZBYpaIVM=; b=vnJaxmOj6bfuY+/R2y36uAaQwJBfcWqv4fIpRjoQihVtmwVkYjvJQ5u7XhEJGUI7n3 qWhbor2RGErKCsKt31WwX4MIvnwPvSrvVZCLGldVRI+6eT2vVwqWx+HuWFEerQmjDr6G E4SEYbqCP3We4Tn/93s18j042fUv4sz6Z2VGWZiNMl3zEifQOqua04+liEBk1ikjbKaZ RCqCL621H3Hd5YF+W2jLo520dZ47phldR1rVHt47y1XOmvZEwMFpl1GIT9XsKiM43AGZ B4aXEPhNKefe291UtxuNvucBhlxwTKcj+rejLWI661tEUYNqoPulOUeR9TGu2qlVhIBW 0mFw== 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=Nk2HH4AXuBIej/2UtOtaeOh7Oth0H0mRhVIZBYpaIVM=; b=ky1TIZ5XT7rNicEC7ahttWpHi3aJpF9S7tW1YIkhRVensJ9pet27w2eTz2hz4MhcMS i2wnnVGP0Ds7kz3jpTKBx2MfJMoJb4IzjCthJuGTBRD+CI+bq5Y90/Zb0qpHoF5nEf9u CfxZx0076amXkW8WIJOdSDEvc3Y3J/+Cz3AoICoNtgLS7e3ntUozW4kEISHyn/Of9FFO xqnVj6JP/emhGQQ/vWJ+Uj3zjkxajHcJeb7zOzBnlLFJUtqEjvRnt5kQWKzQQ7FDmFVB ar63YLaJW9dLQl4FZ+gyV2UfBkgT9bNp+cEyvD6qSOl+Luv1isTIx4MEO5IT7AJaKpPP pqFQ== X-Gm-Message-State: AG10YOTyXeWFhH1MRUVm90xp2uCdCNqBylufTtFvlajjPm7UyA0XUdB1be8UdZHI+tgxCg== X-Received: by 10.66.55.6 with SMTP id n6mr20676404pap.35.1455909502968; Fri, 19 Feb 2016 11:18:22 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 11:18:22 -0800 (PST) From: Eric Kinzie To: dev@dpdk.org Date: Fri, 19 Feb 2016 11:17:52 -0800 Message-Id: <1455909473-13539-6-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 5/6] bond: active slaves with no primary 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 06:58:18 -0000 From: Eric Kinzie If the link state of a slave is "up" when added, it is added to the list of active slaves but, even if it is the only slave, is not selected as the primary interface. Generally, handling of link state interrupts selects an interface to be primary, but only if the active count is zero. This change avoids the situation where there are active slaves but no primary. Signed-off-by: Eric Kinzie Signed-off-by: Stephen Hemminger Acked-by: Declan Doherty --- drivers/net/bonding/rte_eth_bond_api.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 8a000c8..630a461 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -427,8 +427,13 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) if (bonded_eth_dev->data->dev_started) { rte_eth_link_get_nowait(slave_port_id, &link_props); - if (link_props.link_status == 1) + if (link_props.link_status == 1) { + if (internals->active_slave_count == 0 && + !internals->user_defined_primary_port) + bond_ethdev_primary_set(internals, + slave_port_id); activate_slave(bonded_eth_dev, slave_port_id); + } } return 0; -- 1.7.10.4