patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/bnxt: fix link during port toggle' has been queued to LTS release 18.11.7
Date: Fri,  7 Feb 2020 15:12:35 +0000	[thread overview]
Message-ID: <20200207151248.29804-23-ktraynor@redhat.com> (raw)
In-Reply-To: <20200207151248.29804-1-ktraynor@redhat.com>

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 rebasing
(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/06c4b5b5bc13434c0d62d6da53181383be8d6711

Thanks.

Kevin.

---
From 06c4b5b5bc13434c0d62d6da53181383be8d6711 Mon Sep 17 00:00:00 2001
From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
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 <santosh.rastapur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 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 {
 };
 
-/* 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;
@@ -413,5 +414,6 @@ 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);
 
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,
 	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:
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_dev)
 		goto error;
 
-	bnxt_link_update_op(eth_dev, 1);
+	bnxt_link_update(eth_dev, 1, ETH_LINK_UP);
 
 	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
@@ -669,6 +669,9 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	}
 	bnxt_dev_set_link_down_op(eth_dev);
-	/* Wait for link to be reset and the async notification to process. */
-	rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
+
+	/* Wait for link to be reset and the async notification to process.
+	 * During reset recovery, there is no need to wait
+	 */
+	bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN);
 
 	/* Clean queue intr-vector mapping */
@@ -789,10 +792,12 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
 }
 
-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;
 
 	memset(&new, 0, sizeof(new));
@@ -808,5 +813,5 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)
 		}
 
-		if (!wait_to_complete || new.link_status)
+		if (!wait_to_complete || new.link_status == exp_link_status)
 			break;
 
@@ -830,4 +835,10 @@ out:
 }
 
+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 void bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)
 {
-- 
2.21.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-07 15:08:18.723521858 +0000
+++ 0023-net-bnxt-fix-link-during-port-toggle.patch	2020-02-07 15:08:17.538062631 +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);
+ 
@@ -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_dev)
- 	eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev);
+@@ -605,5 +605,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+ 		goto error;
@@ -67,5 +68,10 @@
-@@ -941,5 +941,5 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
- 	 */
- 	if (!is_bnxt_in_error(bp))
--		rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
-+		bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN);
+@@ -669,6 +669,9 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+ 	}
+ 	bnxt_dev_set_link_down_op(eth_dev);
+-	/* Wait for link to be reset and the async notification to process. */
+-	rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
++
++	/* Wait for link to be reset and the async notification to process.
++	 * During reset recovery, there is no need to wait
++	 */
++	bnxt_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 @@
- 	rc = is_bnxt_in_error(bp);
-@@ -1110,5 +1112,5 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)
+ 	memset(&new, 0, sizeof(new));
+@@ -808,5 +813,5 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int 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)


  parent reply	other threads:[~2020-02-07 15:14 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 15:12 [dpdk-stable] patch 'eal/linux: fix uninitialized data valgrind warning' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'eal/linux: fix build error on RHEL 7.6' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: fix build with python 3.8' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'build: explicitly enable sse4 for meson' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'kni: fix meson warning about console keyword' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: fix warning with meson' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: reduce whitespace in meson build file' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'doc: reduce indentation " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'event/dsw: flush buffers immediately on zero-sized enqueue' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'event/dsw: avoid credit leak on oversized enqueue bursts' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'bus/fslmc: remove conflicting memory barrier macro' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'examples/ipsec-secgw: fix crash on unsupported algo' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'app/testpmd: fix device mcast list error handling' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/fm10k: fix descriptor VLAN field filling in Tx' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf: fix Rx total stats' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf: add TSO offload use basic path' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/ixgbe: fix link status' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/ixgbe: fix link up in FreeBSD' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf/base: fix command buffer memory leak' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf/base: fix adminq return' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/iavf: fix virtual channel " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e: fix Tx when TSO is enabled' " Kevin Traynor
2020-02-07 15:12 ` Kevin Traynor [this message]
2020-02-07 15:12 ` [dpdk-stable] patch 'app/testpmd: call cleanup on exit' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/vhost: check creation failure' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/virtio-user: check file descriptor before closing' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'vhost: fix socket initial value' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix buffer address' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix error message' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix Tx descriptors number' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/i40e/base: fix retrying logic' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'ethdev: fix callback unregister with wildcard argument list' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/netvsc: fix crash in secondary process' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'net/cxgbe: announce Tx multi-segments offload' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'service: avoid false sharing on core state' " Kevin Traynor
2020-02-07 15:12 ` [dpdk-stable] patch 'service: don't walk out of bounds when checking services' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200207151248.29804-23-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=santosh.rastapur@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).