patch 'net/i40e: fix MAC loopback on X722' has been queued to stable release 20.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Mar 22 01:41:49 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.8

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/23/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3c83b921e6ad7818ccb2caf894274ed474a30d16

Thanks.

Luca Boccassi

---
>From 3c83b921e6ad7818ccb2caf894274ed474a30d16 Mon Sep 17 00:00:00 2001
From: Wenjing Qiao <wenjing.qiao at 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 at intel.com>
Tested-by: Dukai Yuan <dukaix.yuan at 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 8eb90909b8..a0569dab25 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2520,10 +2520,21 @@ 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");
 			goto tx_err;
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 81763b957c..68baa3c7b0 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -47,6 +47,9 @@
 #define I40E_MAX_VF               128
 /*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.
  * The VFTA array is actually a 4096 bit array, 128 of 32bit elements.
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-03-21 21:56:37.568500538 +0000
+++ 0013-net-i40e-fix-MAC-loopback-on-X722.patch	2023-03-21 21:56:37.080807217 +0000
@@ -1 +1 @@
-From 6355ff768b0b5871cc82a69194b376db39ee6e9c Mon Sep 17 00:00:00 2001
+From 3c83b921e6ad7818ccb2caf894274ed474a30d16 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6355ff768b0b5871cc82a69194b376db39ee6e9c ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 371f42233e..cb0070f94b 100644
+index 8eb90909b8..a0569dab25 100644
@@ -25 +26 @@
-@@ -2411,10 +2411,21 @@ i40e_dev_start(struct rte_eth_dev *dev)
+@@ -2520,10 +2520,21 @@ i40e_dev_start(struct rte_eth_dev *dev)
@@ -51 +52 @@
-index 7c4cc44a27..9b806d130e 100644
+index 81763b957c..68baa3c7b0 100644
@@ -54 +55 @@
-@@ -48,6 +48,9 @@
+@@ -47,6 +47,9 @@


More information about the stable mailing list