From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 726445B12 for ; Mon, 30 Jul 2018 18:14:41 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkAoj-00009D-Be; Mon, 30 Jul 2018 16:14:41 +0000 From: Christian Ehrhardt To: Chas Williams Cc: dpdk stable Date: Mon, 30 Jul 2018 18:11:02 +0200 Message-Id: <20180730161342.16566-17-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'net/bonding: always update bonding link status' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:14:41 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From 6509fb50d41bc9c0ac563f0c9edd4fd8a2226087 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Thu, 17 May 2018 19:22:52 -0400 Subject: [PATCH] net/bonding: always update bonding link status [ upstream commit 0e677a35349f316d50ba25485354363f3e65c12e ] When the first ETH_LINK_UP slave is added to a bonding device, it is immediately activated. If these are polling slaves, there will be a later link state event, when last_link_status doesn't match link_status. But because this slave is already activated, the bonding device's link status isn't updated. To fix this, we always attempt to update the bonding device's link status in the link state change callback. Fixes: 46fb43683679 ("bond: add mode 4") Signed-off-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_pmd.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 02d94b1b1..f155ff779 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2664,10 +2664,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, rte_eth_link_get_nowait(port_id, &link); if (link.link_status) { - if (active_pos < internals->active_slave_count) { - rte_spinlock_unlock(&internals->lsc_lock); - return rc; - } + if (active_pos < internals->active_slave_count) + goto link_update; /* if no active slave ports then set this port to be primary port */ if (internals->active_slave_count < 1) { @@ -2686,10 +2684,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, internals->primary_port == port_id) bond_ethdev_primary_set(internals, port_id); } else { - if (active_pos == internals->active_slave_count) { - rte_spinlock_unlock(&internals->lsc_lock); - return rc; - } + if (active_pos == internals->active_slave_count) + goto link_update; /* Remove from active slave list */ deactivate_slave(bonded_eth_dev, port_id); @@ -2708,6 +2704,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, } } +link_update: /** * Update bonded device link properties after any change to active * slaves @@ -2745,7 +2742,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, rte_spinlock_unlock(&internals->lsc_lock); - return 0; + return rc; } static int -- 2.17.1