From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BBA30A0542 for ; Fri, 7 Feb 2020 16:14:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B43311BF8E; Fri, 7 Feb 2020 16:14:10 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 0927D1BF8E for ; Fri, 7 Feb 2020 16:14:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581088448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vXmKEnidUCfAAz6LogS+r+YrF9P2jtaVAXY0rU6Hrss=; b=FgFQUGGp/4jPSGOAhrspn5TmkGSQgVKhjxQrjLRzEPJh1oEWXoY1m2P7DsFwqLdupzqQJP 7FOXewDG1gpsdJt0ba6CjfwBFdWJrolsPcS27LD9pxIeQ5g2y2YEu4oZemvSVzuKXTa5dO 2nRT9lbLaUC69LGUXBQl/VqU1Y26loQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-9KNWfFJFMUeZcRFjsfBuKg-1; Fri, 07 Feb 2020 10:13:49 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2E94800D54; Fri, 7 Feb 2020 15:13:47 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id E99A410016DA; Fri, 7 Feb 2020 15:13:46 +0000 (UTC) From: Kevin Traynor To: Santoshkumar Karanappa Rastapur Cc: Somnath Kotur , dpdk stable Date: Fri, 7 Feb 2020 15:12:35 +0000 Message-Id: <20200207151248.29804-23-ktraynor@redhat.com> In-Reply-To: <20200207151248.29804-1-ktraynor@redhat.com> References: <20200207151248.29804-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 9KNWfFJFMUeZcRFjsfBuKg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bnxt: fix link during port toggle' has been queued to LTS release 18.11.7 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.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/13/20. 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 rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/06c4b5b5bc13434c0d= 62d6da53181383be8d6711 Thanks. Kevin. --- >From 06c4b5b5bc13434c0d62d6da53181383be8d6711 Mon Sep 17 00:00:00 2001 From: Santoshkumar Karanappa Rastapur Date: Fri, 20 Dec 2019 18:29:35 -0800 Subject: [PATCH] net/bnxt: fix link during port toggle [ upstream commit 074cacb9907aaae240a69eafc80018c873881d82 ] We need to wait for up to 500ms to receive async event notification after forcing link down. Similarly we need to wait for up to 10s for link to come up after configuring the hardware for link up. Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations") Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 10 ++++++---- drivers/net/bnxt/bnxt_cpr.c | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 23 +++++++++++++++++------ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 425d425a68..33fef1b365 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -196,7 +196,8 @@ struct bnxt_pf_info { }; =20 -/* Max wait time is 10 * 100ms =3D 1s */ -#define BNXT_LINK_WAIT_CNT=0910 -#define BNXT_LINK_WAIT_INTERVAL=09100 +/* Max wait time for link up is 10s and link down is 500ms */ +#define BNXT_LINK_UP_WAIT_CNT=09200 +#define BNXT_LINK_DOWN_WAIT_CNT=0910 +#define BNXT_LINK_WAIT_INTERVAL=0950 struct bnxt_link_info { =09uint32_t=09=09phy_flags; @@ -413,5 +414,6 @@ struct bnxt { =20 int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu); -int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)= ; +int bnxt_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete, +=09=09 bool exp_link_status); int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg); =20 diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 4529080d11..08eeec096a 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -27,5 +27,5 @@ void bnxt_handle_async_event(struct bnxt *bp, =09case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: =09=09/* FALLTHROUGH */ -=09=09bnxt_link_update_op(bp->eth_dev, 0); +=09=09bnxt_link_update(bp->eth_dev, 0, ETH_LINK_UP); =09=09break; =09case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.= c index 3c773eb1e1..ed7f1f44b9 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -605,5 +605,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_de= v) =09=09goto error; =20 -=09bnxt_link_update_op(eth_dev, 1); +=09bnxt_link_update(eth_dev, 1, ETH_LINK_UP); =20 =09if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) @@ -669,6 +669,9 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_de= v) =09} =09bnxt_dev_set_link_down_op(eth_dev); -=09/* Wait for link to be reset and the async notification to process. */ -=09rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2); + +=09/* Wait for link to be reset and the async notification to process. +=09 * During reset recovery, there is no need to wait +=09 */ +=09bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN); =20 =09/* Clean queue intr-vector mapping */ @@ -789,10 +792,12 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *e= th_dev, } =20 -int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) +int bnxt_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete, +=09=09 bool exp_link_status) { =09int rc =3D 0; =09struct bnxt *bp =3D eth_dev->data->dev_private; =09struct rte_eth_link new; -=09unsigned int cnt =3D BNXT_LINK_WAIT_CNT; +=09int cnt =3D exp_link_status ? BNXT_LINK_UP_WAIT_CNT : +=09=09 BNXT_LINK_DOWN_WAIT_CNT; =20 =09memset(&new, 0, sizeof(new)); @@ -808,5 +813,5 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, in= t wait_to_complete) =09=09} =20 -=09=09if (!wait_to_complete || new.link_status) +=09=09if (!wait_to_complete || new.link_status =3D=3D exp_link_status) =09=09=09break; =20 @@ -830,4 +835,10 @@ out: } =20 +static int bnxt_link_update_op(struct rte_eth_dev *eth_dev, +=09=09=09 int wait_to_complete) +{ +=09return bnxt_link_update(eth_dev, wait_to_complete, ETH_LINK_UP); +} + static void bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev) { --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-07 15:08:18.723521858 +0000 +++ 0023-net-bnxt-fix-link-during-port-toggle.patch=092020-02-07 15:08:17.5= 38062631 +0000 @@ -1 +1 @@ -From 074cacb9907aaae240a69eafc80018c873881d82 Mon Sep 17 00:00:00 2001 +From 06c4b5b5bc13434c0d62d6da53181383be8d6711 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 074cacb9907aaae240a69eafc80018c873881d82 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -18,2 +19,2 @@ - drivers/net/bnxt/bnxt_ethdev.c | 18 +++++++++++++----- - 3 files changed, 20 insertions(+), 10 deletions(-) + drivers/net/bnxt/bnxt_ethdev.c | 23 +++++++++++++++++------ + 3 files changed, 24 insertions(+), 11 deletions(-) @@ -22 +23 @@ -index ab18e8acd8..ab0b8dde1b 100644 +index 425d425a68..33fef1b365 100644 @@ -25 +26 @@ -@@ -232,7 +232,8 @@ struct bnxt_pf_info { +@@ -196,7 +196,8 @@ struct bnxt_pf_info { @@ -37 +38 @@ -@@ -657,5 +658,6 @@ struct bnxt { +@@ -413,5 +414,6 @@ struct bnxt { @@ -44 +45 @@ - int is_bnxt_in_error(struct bnxt *bp); +=20 @@ -46 +47 @@ -index 2c3129fe28..bb316b9e05 100644 +index 4529080d11..08eeec096a 100644 @@ -49 +50 @@ -@@ -64,5 +64,5 @@ void bnxt_handle_async_event(struct bnxt *bp, +@@ -27,5 +27,5 @@ void bnxt_handle_async_event(struct bnxt *bp, @@ -57 +58 @@ -index 1b4ed293d0..88df82b865 100644 +index 3c773eb1e1..ed7f1f44b9 100644 @@ -60,2 +61,2 @@ -@@ -857,5 +857,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_d= ev) - =09eth_dev->data->scattered_rx =3D bnxt_scattered_rx(eth_dev); +@@ -605,5 +605,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_d= ev) + =09=09goto error; @@ -67,5 +68,10 @@ -@@ -941,5 +941,5 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_d= ev) - =09 */ - =09if (!is_bnxt_in_error(bp)) --=09=09rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2); -+=09=09bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN); +@@ -669,6 +669,9 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_d= ev) + =09} + =09bnxt_dev_set_link_down_op(eth_dev); +-=09/* Wait for link to be reset and the async notification to process. */ +-=09rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2); ++ ++=09/* Wait for link to be reset and the async notification to process. ++=09 * During reset recovery, there is no need to wait ++=09 */ ++=09bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN); @@ -74 +80 @@ -@@ -1087,10 +1087,12 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev= *eth_dev, +@@ -789,10 +792,12 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *= eth_dev, @@ -88,2 +94,2 @@ - =09rc =3D is_bnxt_in_error(bp); -@@ -1110,5 +1112,5 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev,= int wait_to_complete) + =09memset(&new, 0, sizeof(new)); +@@ -808,5 +813,5 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, i= nt wait_to_complete) @@ -96 +102 @@ -@@ -1132,4 +1134,10 @@ out: +@@ -830,4 +835,10 @@ out: @@ -105 +111 @@ - static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev) + static void bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)