patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Wenjing Qiao <wenjing.qiao@intel.com>
Cc: Dukai Yuan <dukaix.yuan@intel.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/i40e: fix MAC loopback on X722' has been queued to stable release 21.11.4
Date: Wed, 22 Mar 2023 10:32:03 +0000	[thread overview]
Message-ID: <20230322103209.456098-16-ktraynor@redhat.com> (raw)
In-Reply-To: <20230322103209.456098-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/24/23. 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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/e71d71bc0cb12c85616ccb24ff24a507b5344371

Thanks.

Kevin

---
From e71d71bc0cb12c85616ccb24ff24a507b5344371 Mon Sep 17 00:00:00 2001
From: Wenjing Qiao <wenjing.qiao@intel.com>
Date: Mon, 13 Mar 2023 23:16:19 -0400
Subject: [PATCH] net/i40e: fix MAC loopback on X722

[ upstream commit 6355ff768b0b5871cc82a69194b376db39ee6e9c ]

If enabling MAC loopback mode on X722 NIC, transmitted packets are not
seen in the receive queue. The root cause is using wrong loopback mode
bits. Correct it according to the X722 datasheet.

Fixes: 3a838ab649df ("net/i40e: support MAC loopback")
Fixes: 5712e6407089 ("net/i40e: revert enhancing loopback AQ command")

Signed-off-by: Wenjing Qiao <wenjing.qiao@intel.com>
Tested-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 17 ++++++++++++++---
 drivers/net/i40e/i40e_ethdev.h |  3 +++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 1d417dbf8a..07deb272c3 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2448,8 +2448,19 @@ i40e_dev_start(struct rte_eth_dev *dev)
 	}
 
+	/* Disable mac loopback mode */
+	if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_NONE) {
+		ret = i40e_aq_set_lb_modes(hw, I40E_AQ_LB_MODE_NONE, NULL);
+		if (ret != I40E_SUCCESS) {
+			PMD_DRV_LOG(ERR, "fail to set loopback link");
+			goto tx_err;
+		}
+	}
+
 	/* Enable mac loopback mode */
-	if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_NONE ||
-	    dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_PHY_LOCAL) {
-		ret = i40e_aq_set_lb_modes(hw, dev->data->dev_conf.lpbk_mode, NULL);
+	if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_EN) {
+		if (hw->mac.type == I40E_MAC_X722)
+			ret = i40e_aq_set_lb_modes(hw, I40E_AQ_LB_MAC_LOCAL_X722, NULL);
+		else
+			ret = i40e_aq_set_lb_modes(hw, I40E_AQ_LB_MAC, NULL);
 		if (ret != I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "fail to set loopback link");
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index e918771256..c4abbae6c3 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -49,4 +49,7 @@
 /*flag of no loopback*/
 #define I40E_AQ_LB_MODE_NONE	  0x0
+#define I40E_AQ_LB_MODE_EN	  0x01
+#define I40E_AQ_LB_MAC		  0x01
+#define I40E_AQ_LB_MAC_LOCAL_X722 0x04
 /*
  * vlan_id is a 12 bit number.
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-22 10:30:08.319221247 +0000
+++ 0016-net-i40e-fix-MAC-loopback-on-X722.patch	2023-03-22 10:30:07.929866581 +0000
@@ -1 +1 @@
-From 6355ff768b0b5871cc82a69194b376db39ee6e9c Mon Sep 17 00:00:00 2001
+From e71d71bc0cb12c85616ccb24ff24a507b5344371 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6355ff768b0b5871cc82a69194b376db39ee6e9c ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index 371f42233e..cb0070f94b 100644
+index 1d417dbf8a..07deb272c3 100644
@@ -25 +26 @@
-@@ -2412,8 +2412,19 @@ i40e_dev_start(struct rte_eth_dev *dev)
+@@ -2448,8 +2448,19 @@ i40e_dev_start(struct rte_eth_dev *dev)
@@ -49 +50 @@
-index 7c4cc44a27..9b806d130e 100644
+index e918771256..c4abbae6c3 100644


  parent reply	other threads:[~2023-03-22 10:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 10:31 patch 'raw/skeleton: fix selftest' " Kevin Traynor
2023-03-22 10:31 ` patch 'reorder: fix sequence number mbuf field register' " Kevin Traynor
2023-03-22 10:31 ` patch 'test: fix segment length in packet generator' " Kevin Traynor
2023-03-22 10:31 ` patch 'test/mbuf: fix test with mbuf debug enabled' " Kevin Traynor
2023-03-22 10:31 ` patch 'test/crypto: fix ZUC digest length in comparison' " Kevin Traynor
2023-03-22 10:31 ` patch 'test/crypto: fix capability check for ZUC cipher-auth' " Kevin Traynor
2023-03-22 10:31 ` patch 'app/compress-perf: fix remaining data for ops' " Kevin Traynor
2023-03-22 10:31 ` patch 'app/bbdev: check statistics failure' " Kevin Traynor
2023-03-22 10:31 ` patch 'net/vhost: add missing newline in logs' " Kevin Traynor
2023-03-22 10:31 ` patch 'net/vhost: fix leak in interrupt handle setup' " Kevin Traynor
2023-03-22 10:31 ` patch 'net/vhost: fix Rx interrupt' " Kevin Traynor
2023-03-22 10:31 ` patch 'net/virtio: remove address width limit for modern devices' " Kevin Traynor
2023-03-22 10:32 ` patch 'net/sfc: invalidate switch port entry on representor unplug' " Kevin Traynor
2023-03-22 10:32 ` patch 'net/i40e: fix AVX512 fast-free path' " Kevin Traynor
2023-03-22 10:32 ` patch 'net/e1000: fix saving of stripped VLAN TCI' " Kevin Traynor
2023-03-22 10:32 ` Kevin Traynor [this message]
2023-03-22 10:32 ` patch 'net/iavf: fix device stop during reset' " Kevin Traynor
2023-03-22 10:32 ` patch 'net/mlx5: fix hairpin Tx queue reference count' " Kevin Traynor
2023-03-22 10:32 ` patch 'doc: fix LPM support in l3forward guide' " Kevin Traynor
2023-03-22 10:32 ` patch 'bus/ifpga: fix devargs handling' " Kevin Traynor
2023-03-22 10:32 ` patch 'net/ipn3ke: fix thread exit' " Kevin Traynor
2023-03-22 10:32 ` patch 'net/ipn3ke: fix representor name' " 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=20230322103209.456098-16-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=dukaix.yuan@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenjing.qiao@intel.com \
    /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).