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 45228A051C for ; Tue, 11 Feb 2020 12:27:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 193BE1BDFD; Tue, 11 Feb 2020 12:27:26 +0100 (CET) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by dpdk.org (Postfix) with ESMTP id 7C7451BC25 for ; Tue, 11 Feb 2020 12:27:25 +0100 (CET) Received: by mail-wr1-f52.google.com with SMTP id t2so11911607wrr.1 for ; Tue, 11 Feb 2020 03:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NEQtw5TscooIelLyPwRp6ks7iaRf5YLFyQ0agWUNuoY=; b=U4UkaKZMtxRINUIrtW/Kif/jZLaiKxE6wLXQcL1MoEpOGeQtNfbXT4FwitozT2aAgL Oh9vrAV5fksTIUN3zVeCIDJmzu6G1G29AUWfPbkGl7vLCIX7rZYbnXitU82187nN8Dbf IpG1GJiXBjMSNyyIfmnvtTfZDewgX0BX64DquEe1ZBz0KQQcUBQ/hM37WG00PigUmrbk X1Rdcp5YAtRwnAP5QnWAkSD9fPQtp/fpObpIz7em9mw9efInCSGB3ZJo0HQmXLl898pI JQMR1cr/HBRf6HOrxpZCR1XYiPIFz64gaWKXWEc5ib1WxeLE9eLkA2r0knZbpHbaZkek teCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NEQtw5TscooIelLyPwRp6ks7iaRf5YLFyQ0agWUNuoY=; b=XtpH5cublIncbF/Ci3HWwHk5XB35WvEfbekZVH9Ab9OQYjr75m0Q1ExGJWCOCIVYNf n/YB3ASh8gCUMKGuy0IxnBnbH8K0RiE4YBQRxXHOk8jXmfAwDwbMyY4uyilEDGe5ipPR 3+h7ujGWDqWxt8vXQxmfHEL3GNwF72KOqDksd3pQJG+3V9/ECmkRBebwyd2xQ9XZ0s1/ /ciV3IwTqwIYzkl9dz6xTPDiQqLMux5UAXG2AtyuYolBWCk/ZOc5faBBkTfwk4Ya1Gzh 8yTv9fz3Vn6PllS+spH9EhhHRcCOd2E9GTlAzog1NgsP8PKxMsFkhNzFvrLJhMKKp85v SF7w== X-Gm-Message-State: APjAAAXgDl4Y8umfxmkXhEb5arUKFI3f9MBmUbTx1stoSC1zyNgynIsG QFo6gDPbch/q7pq/gV2obcE= X-Google-Smtp-Source: APXvYqxgWzFjpel2V8Cow+YbiORqtJiylN9HCw0RhZx13cz18eM++keWDFNGCP/98SwU+nIeXXr57Q== X-Received: by 2002:adf:fdc7:: with SMTP id i7mr7785315wrs.270.1581420445218; Tue, 11 Feb 2020 03:27:25 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x10sm4636727wrv.60.2020.02.11.03.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:27:24 -0800 (PST) From: luca.boccassi@gmail.com To: Santoshkumar Karanappa Rastapur Cc: Somnath Kotur , dpdk stable Date: Tue, 11 Feb 2020 11:19:58 +0000 Message-Id: <20200211112216.3929-52-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix link during port toggle' has been queued to stable release 19.11.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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.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 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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 3dc221f4bc7c9135c7fc7f5430469c0beb78d273 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 | 18 +++++++++++++----- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index f9e4d76e47..d00186f79e 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -231,9 +231,10 @@ struct bnxt_pf_info { uint8_t evb_mode; }; -/* Max wait time is 10 * 100ms = 1s */ -#define BNXT_LINK_WAIT_CNT 10 -#define BNXT_LINK_WAIT_INTERVAL 100 +/* Max wait time for link up is 10s and link down is 500ms */ +#define BNXT_LINK_UP_WAIT_CNT 200 +#define BNXT_LINK_DOWN_WAIT_CNT 10 +#define BNXT_LINK_WAIT_INTERVAL 50 struct bnxt_link_info { uint32_t phy_flags; uint8_t mac_type; @@ -654,7 +655,8 @@ struct bnxt { }; 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, + bool exp_link_status); int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg); int is_bnxt_in_error(struct bnxt *bp); uint16_t bnxt_rss_ctxts(const struct bnxt *bp); diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index e6f30fecbf..14ef5a38a5 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -63,7 +63,7 @@ void bnxt_handle_async_event(struct bnxt *bp, case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE: case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: /* FALLTHROUGH */ - bnxt_link_update_op(bp->eth_dev, 0); + bnxt_link_update(bp->eth_dev, 0, ETH_LINK_UP); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 41848f36f8..3e7bc61325 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -856,7 +856,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev); - bnxt_link_update_op(eth_dev, 1); + bnxt_link_update(eth_dev, 1, ETH_LINK_UP); if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) vlan_mask |= ETH_VLAN_FILTER_MASK; @@ -940,7 +940,7 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) * During reset recovery, there is no need to wait */ if (!is_bnxt_in_error(bp)) - rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2); + bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN); /* Clean queue intr-vector mapping */ rte_intr_efd_disable(intr_handle); @@ -1089,12 +1089,14 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev, return rc; } -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, + bool exp_link_status) { int rc = 0; struct bnxt *bp = eth_dev->data->dev_private; struct rte_eth_link new; - unsigned int cnt = BNXT_LINK_WAIT_CNT; + int cnt = exp_link_status ? BNXT_LINK_UP_WAIT_CNT : + BNXT_LINK_DOWN_WAIT_CNT; rc = is_bnxt_in_error(bp); if (rc) @@ -1112,7 +1114,7 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) goto out; } - if (!wait_to_complete || new.link_status) + if (!wait_to_complete || new.link_status == exp_link_status) break; rte_delay_ms(BNXT_LINK_WAIT_INTERVAL); @@ -1134,6 +1136,12 @@ out: return rc; } +static int bnxt_link_update_op(struct rte_eth_dev *eth_dev, + int wait_to_complete) +{ + return bnxt_link_update(eth_dev, wait_to_complete, ETH_LINK_UP); +} + static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:40.890018626 +0000 +++ 0052-net-bnxt-fix-link-during-port-toggle.patch 2020-02-11 11:17:38.420001721 +0000 @@ -1,14 +1,15 @@ -From 074cacb9907aaae240a69eafc80018c873881d82 Mon Sep 17 00:00:00 2001 +From 3dc221f4bc7c9135c7fc7f5430469c0beb78d273 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") -Cc: stable@dpdk.org Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Somnath Kotur @@ -19,7 +20,7 @@ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h -index ab18e8acd8..ab0b8dde1b 100644 +index f9e4d76e47..d00186f79e 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -231,9 +231,10 @@ struct bnxt_pf_info { @@ -36,7 +37,7 @@ struct bnxt_link_info { uint32_t phy_flags; uint8_t mac_type; -@@ -656,7 +657,8 @@ struct bnxt { +@@ -654,7 +655,8 @@ struct bnxt { }; int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu); @@ -47,7 +48,7 @@ int is_bnxt_in_error(struct bnxt *bp); uint16_t bnxt_rss_ctxts(const struct bnxt *bp); diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c -index 2c3129fe28..bb316b9e05 100644 +index e6f30fecbf..14ef5a38a5 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -63,7 +63,7 @@ void bnxt_handle_async_event(struct bnxt *bp, @@ -60,7 +61,7 @@ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c -index 1b4ed293d0..88df82b865 100644 +index 41848f36f8..3e7bc61325 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -856,7 +856,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) @@ -81,7 +82,7 @@ /* Clean queue intr-vector mapping */ rte_intr_efd_disable(intr_handle); -@@ -1086,12 +1086,14 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev, +@@ -1089,12 +1089,14 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev, return rc; } @@ -98,7 +99,7 @@ rc = is_bnxt_in_error(bp); if (rc) -@@ -1109,7 +1111,7 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) +@@ -1112,7 +1114,7 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) goto out; } @@ -107,7 +108,7 @@ break; rte_delay_ms(BNXT_LINK_WAIT_INTERVAL); -@@ -1131,6 +1133,12 @@ out: +@@ -1134,6 +1136,12 @@ out: return rc; }