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 8B578A00E6 for ; Tue, 16 Apr 2019 16:38:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7AD721B4EA; Tue, 16 Apr 2019 16:38:11 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7CF681B4D0 for ; Tue, 16 Apr 2019 16:38:08 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E171ACA1FE; Tue, 16 Apr 2019 14:38:07 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AC441001E92; Tue, 16 Apr 2019 14:38:06 +0000 (UTC) From: Kevin Traynor To: Igor Russkikh Cc: dpdk stable Date: Tue, 16 Apr 2019 15:36:42 +0100 Message-Id: <20190416143719.21601-24-ktraynor@redhat.com> In-Reply-To: <20190416143719.21601-1-ktraynor@redhat.com> References: <20190416143719.21601-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 16 Apr 2019 14:38:07 +0000 (UTC) Subject: [dpdk-stable] patch 'net/atlantic: fix link configuration' 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/24/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 85a79ecfbc385e09dc0c688c023ecb77b49bd7df Mon Sep 17 00:00:00 2001 From: Igor Russkikh Date: Tue, 12 Mar 2019 15:25:03 +0000 Subject: [PATCH] net/atlantic: fix link configuration [ upstream commit 51a071cd8e97d2e7e6ddb7b160aa460292ba608b ] In case link speed is re configured after port start, it does not takes the requested speed value, but instead just sets full autoneg mask. Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt management") Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 44 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 5bc04f55c..0ce9308d3 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -466,6 +466,4 @@ atl_dev_start(struct rte_eth_dev *dev) struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; uint32_t intr_vector = 0; - uint32_t *link_speeds; - uint32_t speed = 0; int status; int err; @@ -544,4 +542,6 @@ atl_dev_start(struct rte_eth_dev *dev) } + err = atl_dev_set_link_up(dev); + err = hw->aq_fw_ops->update_link_status(hw); @@ -551,24 +551,4 @@ atl_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status = hw->aq_link_status.mbps != 0; - link_speeds = &dev->data->dev_conf.link_speeds; - - speed = 0x0; - - if (*link_speeds == ETH_LINK_SPEED_AUTONEG) { - speed = hw->aq_nic_cfg->link_speed_msk; - } else { - if (*link_speeds & ETH_LINK_SPEED_10G) - speed |= AQ_NIC_RATE_10G; - if (*link_speeds & ETH_LINK_SPEED_5G) - speed |= AQ_NIC_RATE_5G; - if (*link_speeds & ETH_LINK_SPEED_1G) - speed |= AQ_NIC_RATE_1G; - if (*link_speeds & ETH_LINK_SPEED_2_5G) - speed |= AQ_NIC_RATE_2G5; - if (*link_speeds & ETH_LINK_SPEED_100M) - speed |= AQ_NIC_RATE_100M; - } - - err = hw->aq_fw_ops->set_link_speed(hw, speed); if (err) goto error; @@ -658,7 +638,23 @@ atl_dev_set_link_up(struct rte_eth_dev *dev) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t link_speeds = dev->data->dev_conf.link_speeds; + uint32_t speed_mask = 0; - return hw->aq_fw_ops->set_link_speed(hw, - hw->aq_nic_cfg->link_speed_msk); + if (link_speeds == ETH_LINK_SPEED_AUTONEG) { + speed_mask = hw->aq_nic_cfg->link_speed_msk; + } else { + if (link_speeds & ETH_LINK_SPEED_10G) + speed_mask |= AQ_NIC_RATE_10G; + if (link_speeds & ETH_LINK_SPEED_5G) + speed_mask |= AQ_NIC_RATE_5G; + if (link_speeds & ETH_LINK_SPEED_1G) + speed_mask |= AQ_NIC_RATE_1G; + if (link_speeds & ETH_LINK_SPEED_2_5G) + speed_mask |= AQ_NIC_RATE_2G5; + if (link_speeds & ETH_LINK_SPEED_100M) + speed_mask |= AQ_NIC_RATE_100M; + } + + return hw->aq_fw_ops->set_link_speed(hw, speed_mask); } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-16 15:34:26.277929089 +0100 +++ 0024-net-atlantic-fix-link-configuration.patch 2019-04-16 15:34:25.168180216 +0100 @@ -1,14 +1,15 @@ -From 51a071cd8e97d2e7e6ddb7b160aa460292ba608b Mon Sep 17 00:00:00 2001 +From 85a79ecfbc385e09dc0c688c023ecb77b49bd7df Mon Sep 17 00:00:00 2001 From: Igor Russkikh Date: Tue, 12 Mar 2019 15:25:03 +0000 Subject: [PATCH] net/atlantic: fix link configuration +[ upstream commit 51a071cd8e97d2e7e6ddb7b160aa460292ba608b ] + In case link speed is re configured after port start, it does not takes the requested speed value, but instead just sets full autoneg mask. Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt management") -Cc: stable@dpdk.org Signed-off-by: Igor Russkikh --- @@ -16,7 +17,7 @@ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c -index a510646a5..e43e1e724 100644 +index 5bc04f55c..0ce9308d3 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -466,6 +466,4 @@ atl_dev_start(struct rte_eth_dev *dev)