From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A1CF9A0096 for ; Wed, 10 Apr 2019 18:44:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8DF931B130; Wed, 10 Apr 2019 18:44:40 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C99591B105 for ; Wed, 10 Apr 2019 18:44:38 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3EBAC9B335; Wed, 10 Apr 2019 16:44:38 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-94.ams2.redhat.com [10.36.117.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64CAF5D961; Wed, 10 Apr 2019 16:44:37 +0000 (UTC) From: Kevin Traynor To: Chas Williams Cc: dpdk stable Date: Wed, 10 Apr 2019 17:43:22 +0100 Message-Id: <20190410164411.10546-14-ktraynor@redhat.com> In-Reply-To: <20190410164411.10546-1-ktraynor@redhat.com> References: <20190410164411.10546-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 10 Apr 2019 16:44:38 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bonding: fix link status' has been queued to LTS release 18.11.2 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/16/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >From f0f3d85815b908feac989c1f824e5287fd2259df Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Thu, 14 Feb 2019 14:11:12 -0500 Subject: [PATCH] net/bonding: fix link status [ upstream commit d7bce0058a241a4d9b03e295bd74e6957b040d1e ] Copying the link properties of the first slave added may copy an invalid link status. The speed and duplex of the slave may not be known at this time. Delay setting the properties until the first slave reports as link up. Note that we are still ignoring an error from link_properties_valid. For some bonding modes, 802.3ad, we should not activate the slave if it does not have matching link properties. Fixes: a45b288ef21a ("bond: support link status polling") Signed-off-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_api.c | 4 --- drivers/net/bonding/rte_eth_bond_pmd.c | 31 +++++++++++++--------- drivers/net/bonding/rte_eth_bond_private.h | 7 ----- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index ac084c4fd..b55752ed3 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -491,8 +491,4 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) } - /* Inherit eth dev link properties from first slave */ - link_properties_set(bonded_eth_dev, - &(slave_eth_dev->data->dev_link)); - /* Make primary slave */ internals->primary_port = slave_port_id; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index a39f72898..46ad4fe47 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1450,5 +1450,5 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, } -void +static void link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link) { @@ -1475,5 +1475,5 @@ link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link) } -int +static int link_properties_valid(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link) @@ -2694,14 +2694,4 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, goto link_update; - /* if no active slave ports then set this port to be primary port */ - if (internals->active_slave_count < 1) { - /* If first active slave, then change link status */ - bonded_eth_dev->data->dev_link.link_status = ETH_LINK_UP; - internals->current_primary_port = port_id; - lsc_flag = 1; - - mac_address_slaves_update(bonded_eth_dev); - } - /* check link state properties if bonded link is up*/ if (bonded_eth_dev->data->dev_link.link_status == ETH_LINK_UP) { @@ -2715,7 +2705,22 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, } + /* If no active slave ports then set this port to be + * the primary port. + */ + if (internals->active_slave_count < 1) { + /* If first active slave, then change link status */ + bonded_eth_dev->data->dev_link.link_status = + ETH_LINK_UP; + internals->current_primary_port = port_id; + lsc_flag = 1; + + mac_address_slaves_update(bonded_eth_dev); + } + activate_slave(bonded_eth_dev, port_id); - /* If user has defined the primary port then default to using it */ + /* If the user has defined the primary port then default to + * using it. + */ if (internals->user_defined_primary_port && internals->primary_port == port_id) diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 3ea5d686b..032ffed02 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -223,11 +223,4 @@ void activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); -void -link_properties_set(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_link *slave_dev_link); -int -link_properties_valid(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_link *slave_dev_link); - int mac_address_set(struct rte_eth_dev *eth_dev, struct ether_addr *new_mac_addr); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-10 14:06:09.122057500 +0100 +++ 0014-net-bonding-fix-link-status.patch 2019-04-10 14:06:07.811295457 +0100 @@ -1,8 +1,10 @@ -From d7bce0058a241a4d9b03e295bd74e6957b040d1e Mon Sep 17 00:00:00 2001 +From f0f3d85815b908feac989c1f824e5287fd2259df Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Thu, 14 Feb 2019 14:11:12 -0500 Subject: [PATCH] net/bonding: fix link status +[ upstream commit d7bce0058a241a4d9b03e295bd74e6957b040d1e ] + Copying the link properties of the first slave added may copy an invalid link status. The speed and duplex of the slave may not be known at this time. Delay setting the properties until the @@ -12,7 +14,6 @@ matching link properties. Fixes: a45b288ef21a ("bond: support link status polling") -Cc: stable@dpdk.org Signed-off-by: Chas Williams --- @@ -22,10 +23,10 @@ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c -index e5e146540..57ef2f001 100644 +index ac084c4fd..b55752ed3 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c -@@ -485,8 +485,4 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) +@@ -491,8 +491,4 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) } - /* Inherit eth dev link properties from first slave */ @@ -35,7 +36,7 @@ /* Make primary slave */ internals->primary_port = slave_port_id; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c -index 61e731a8f..c4a2b955c 100644 +index a39f72898..46ad4fe47 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1450,5 +1450,5 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,