patch 'net/ixgbe/base: fix link status for E610' has been queued to stable release 24.11.3

Kevin Traynor ktraynor at redhat.com
Fri Jul 18 21:30:33 CEST 2025


Hi,

FYI, your patch has been queued to stable release 24.11.3

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

Thanks.

Kevin

---
>From 63c0f5745a03a784c0f49cf402a7d9a9b6a9cbf7 Mon Sep 17 00:00:00 2001
From: Jedrzej Jagielski <jedrzej.jagielski at intel.com>
Date: Mon, 9 Jun 2025 11:25:35 +0100
Subject: [PATCH] net/ixgbe/base: fix link status for E610

[ upstream commit adbd71030575771813a9a89a72845d259db764c4 ]

E610 adapter no longer uses the VFLINKS register to read PF's link speed
and linkup state. Currently this leads to mismatch between actual link
status and that what VF driver shows to the OS.

Add new mailbox operation to let the VF driver request the PF driver
to provide the actual link data. Update the mailbox api to v1.6.

Incorporate both ways of getting link status within the legacy
ixgbe_check_mac_link_vf() function.

Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")

Signed-off-by: Andrzej Wilczynski <andrzejx.wilczynski at intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/ixgbe/base/ixgbe_mbx.h |   4 +
 drivers/net/ixgbe/base/ixgbe_vf.c  | 126 ++++++++++++++++++++++-------
 drivers/net/ixgbe/base/ixgbe_vf.h  |   2 +
 3 files changed, 105 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.h b/drivers/net/ixgbe/base/ixgbe_mbx.h
index 434f7c6a69..e3b4338fb1 100644
--- a/drivers/net/ixgbe/base/ixgbe_mbx.h
+++ b/drivers/net/ixgbe/base/ixgbe_mbx.h
@@ -102,4 +102,5 @@ enum ixgbe_pfvf_api_rev {
 	ixgbe_mbox_api_14,	/* API version 1.4, linux/freebsd VF driver */
 	ixgbe_mbox_api_15,	/* API version 1.5, linux/freebsd VF driver */
+	ixgbe_mbox_api_16,	/* API version 1.6, linux/freebsd VF driver */
 	/* This value should always be last */
 	ixgbe_mbox_api_unknown,	/* indicates that API version is not known */
@@ -126,4 +127,7 @@ enum ixgbe_pfvf_api_rev {
 #define IXGBE_VF_GET_LINK_STATE 0x10 /* get vf link state */
 
+/* mailbox API, version 1.6 VF requests */
+#define IXGBE_VF_GET_PF_LINK_STATE 0x11 /* get status of the link on PF */
+
 /* mode choices for IXGBE_VF_UPDATE_XCAST_MODE */
 enum ixgbevf_xcast_modes {
diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c
index 37556a9300..46a62bb851 100644
--- a/drivers/net/ixgbe/base/ixgbe_vf.c
+++ b/drivers/net/ixgbe/base/ixgbe_vf.c
@@ -410,4 +410,5 @@ s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
 	case ixgbe_mbox_api_13:
 	case ixgbe_mbox_api_15:
+	case ixgbe_mbox_api_16:
 		break;
 	default:
@@ -456,4 +457,45 @@ s32 ixgbe_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state)
 }
 
+/**
+ * ixgbevf_get_pf_link_state - Get PF's link status
+ * @hw: pointer to the HW structure
+ * @speed - link speed
+ * @link_up - indicate if link is up/down
+ *
+ * Ask PF to provide link_up state and speed of the link.
+ *
+ * Return: IXGBE_ERR_MBX in the  case of mailbox error,
+ * IXGBE_ERR_FEATURE_NOT_SUPPORTED if the op is not supported or 0 on success.
+ */
+int ixgbevf_get_pf_link_state(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+			      bool *link_up)
+{
+	u32 msgbuf[3] = {};
+	int err;
+
+	switch (hw->api_version) {
+	case ixgbe_mbox_api_16:
+		break;
+	default:
+		return IXGBE_ERR_FEATURE_NOT_SUPPORTED;
+	}
+
+	msgbuf[0] = IXGBE_VF_GET_PF_LINK_STATE;
+
+	err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 6);
+	if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) {
+		err = IXGBE_ERR_MBX;
+		*speed = IXGBE_LINK_SPEED_UNKNOWN;
+		/* No need to set @link_up to false as it will be done in
+		 * ixgbe_check_mac_link_vf().
+		 */
+	} else {
+		*speed = msgbuf[1];
+		*link_up = msgbuf[2];
+	}
+
+	return err;
+}
+
 /**
  * ixgbe_set_vfta_vf - Set/Unset vlan filter table address
@@ -570,34 +612,23 @@ s32 ixgbe_setup_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 
 /**
- * ixgbe_check_mac_link_vf - Get link/speed status
- * @hw: pointer to hardware structure
- * @speed: pointer to link speed
- * @link_up: true is link is up, false otherwise
- * @autoneg_wait_to_complete: true when waiting for completion is needed
+ * ixgbe_read_vflinks - Read VFLINKS register
+ * @hw: pointer to the HW structure
+ * @speed - link speed
+ * @link_up - indicate if link is up/down
  *
- * Reads the links register to determine if link is up and the current speed
- **/
-s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
-			    bool *link_up, bool autoneg_wait_to_complete)
+ * Get linkup status and link speed from the VFLINKS register.
+ */
+static void ixgbe_read_vflinks(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+			       bool *link_up)
 {
-	struct ixgbe_mbx_info *mbx = &hw->mbx;
 	struct ixgbe_mac_info *mac = &hw->mac;
-	s32 ret_val = IXGBE_SUCCESS;
-	u32 in_msg = 0;
 	u32 links_reg;
 
-	UNREFERENCED_1PARAMETER(autoneg_wait_to_complete);
-
-	/* If we were hit with a reset drop the link */
-	if (!mbx->ops[0].check_for_rst(hw, 0) || !mbx->timeout)
-		mac->get_link_status = true;
-
-	if (!mac->get_link_status)
-		goto out;
-
 	/* if link status is down no point in checking to see if pf is up */
 	links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
-	if (!(links_reg & IXGBE_LINKS_UP))
-		goto out;
+	if (!(links_reg & IXGBE_LINKS_UP)) {
+		*link_up = false;
+		return;
+	}
 
 	/* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
@@ -611,8 +642,12 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 			links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
 
-			if (!(links_reg & IXGBE_LINKS_UP))
-				goto out;
+			if (!(links_reg & IXGBE_LINKS_UP)) {
+				*link_up = false;
+				return;
+			}
 		}
 	}
+	/* We have link at this point */
+	*link_up = true;
 
 	switch (links_reg & IXGBE_LINKS_SPEED_82599) {
@@ -629,6 +664,5 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
-		if (hw->mac.type == ixgbe_mac_X550_vf ||
-		    hw->mac.type == ixgbe_mac_E610_vf) {
+		if (hw->mac.type == ixgbe_mac_X550_vf) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_5GB_FULL;
@@ -644,4 +678,41 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		*speed = IXGBE_LINK_SPEED_UNKNOWN;
 	}
+}
+
+/**
+ * ixgbe_check_mac_link_vf - Get link/speed status
+ * @hw: pointer to hardware structure
+ * @speed: pointer to link speed
+ * @link_up: true is link is up, false otherwise
+ * @autoneg_wait_to_complete: true when waiting for completion is needed
+ *
+ * Reads the links register to determine if link is up and the current speed
+ */
+s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+			    bool *link_up, bool autoneg_wait_to_complete)
+{
+	struct ixgbe_mbx_info *mbx = &hw->mbx;
+	struct ixgbe_mac_info *mac = &hw->mac;
+	s32 ret_val = IXGBE_SUCCESS;
+	u32 in_msg = 0;
+
+	UNREFERENCED_1PARAMETER(autoneg_wait_to_complete);
+
+	/* If we were hit with a reset drop the link */
+	if (!mbx->ops[0].check_for_rst(hw, 0) || !mbx->timeout)
+		mac->get_link_status = true;
+
+	if (!mac->get_link_status)
+		goto out;
+
+	if (hw->mac.type != ixgbe_mac_E610_vf) {
+		ixgbe_read_vflinks(hw, speed, link_up);
+		if (*link_up == false)
+			goto out;
+	} else {
+		ret_val = ixgbevf_get_pf_link_state(hw, speed, link_up);
+		if (ret_val)
+			goto out;
+	}
 
 	/* if the read failed it could just be a mailbox collision, best wait
@@ -743,4 +814,5 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
 	case ixgbe_mbox_api_13:
 	case ixgbe_mbox_api_15:
+	case ixgbe_mbox_api_16:
 		break;
 	default:
diff --git a/drivers/net/ixgbe/base/ixgbe_vf.h b/drivers/net/ixgbe/base/ixgbe_vf.h
index bd10865d57..ca532fae07 100644
--- a/drivers/net/ixgbe/base/ixgbe_vf.h
+++ b/drivers/net/ixgbe/base/ixgbe_vf.h
@@ -114,4 +114,6 @@ int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api);
 int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
 		       unsigned int *default_tc);
+int ixgbevf_get_pf_link_state(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
+			      bool *link_up);
 
 #endif /* __IXGBE_VF_H__ */
-- 
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-18 20:29:14.439962672 +0100
+++ 0099-net-ixgbe-base-fix-link-status-for-E610.patch	2025-07-18 20:29:11.013907585 +0100
@@ -1 +1 @@
-From adbd71030575771813a9a89a72845d259db764c4 Mon Sep 17 00:00:00 2001
+From 63c0f5745a03a784c0f49cf402a7d9a9b6a9cbf7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit adbd71030575771813a9a89a72845d259db764c4 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -24,3 +25,3 @@
- drivers/net/intel/ixgbe/base/ixgbe_mbx.h |   4 +
- drivers/net/intel/ixgbe/base/ixgbe_vf.c  | 126 ++++++++++++++++++-----
- drivers/net/intel/ixgbe/base/ixgbe_vf.h  |   2 +
+ drivers/net/ixgbe/base/ixgbe_mbx.h |   4 +
+ drivers/net/ixgbe/base/ixgbe_vf.c  | 126 ++++++++++++++++++++++-------
+ drivers/net/ixgbe/base/ixgbe_vf.h  |   2 +
@@ -29 +30 @@
-diff --git a/drivers/net/intel/ixgbe/base/ixgbe_mbx.h b/drivers/net/intel/ixgbe/base/ixgbe_mbx.h
+diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.h b/drivers/net/ixgbe/base/ixgbe_mbx.h
@@ -31,2 +32,2 @@
---- a/drivers/net/intel/ixgbe/base/ixgbe_mbx.h
-+++ b/drivers/net/intel/ixgbe/base/ixgbe_mbx.h
+--- a/drivers/net/ixgbe/base/ixgbe_mbx.h
++++ b/drivers/net/ixgbe/base/ixgbe_mbx.h
@@ -47 +48 @@
-diff --git a/drivers/net/intel/ixgbe/base/ixgbe_vf.c b/drivers/net/intel/ixgbe/base/ixgbe_vf.c
+diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c
@@ -49,2 +50,2 @@
---- a/drivers/net/intel/ixgbe/base/ixgbe_vf.c
-+++ b/drivers/net/intel/ixgbe/base/ixgbe_vf.c
+--- a/drivers/net/ixgbe/base/ixgbe_vf.c
++++ b/drivers/net/ixgbe/base/ixgbe_vf.c
@@ -221 +222 @@
-diff --git a/drivers/net/intel/ixgbe/base/ixgbe_vf.h b/drivers/net/intel/ixgbe/base/ixgbe_vf.h
+diff --git a/drivers/net/ixgbe/base/ixgbe_vf.h b/drivers/net/ixgbe/base/ixgbe_vf.h
@@ -223,2 +224,2 @@
---- a/drivers/net/intel/ixgbe/base/ixgbe_vf.h
-+++ b/drivers/net/intel/ixgbe/base/ixgbe_vf.h
+--- a/drivers/net/ixgbe/base/ixgbe_vf.h
++++ b/drivers/net/ixgbe/base/ixgbe_vf.h



More information about the stable mailing list