From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A9FA246BAE for ; Fri, 18 Jul 2025 21:36:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F82B40611; Fri, 18 Jul 2025 21:36:29 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 0CB0440E35 for ; Fri, 18 Jul 2025 21:36:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wh4wQSn1yCX7jWpHjqppB3yA9WXpw8thEePF2P2GmYg=; b=Vyw9gf2aZvHuCUroJ7abuMCD2CWwn7Gk1lUj0u2qYotb/HqDeBBxWLHGHu/N0d5q49hWef MoNMvdxPcgm+/k/OLjDxpu/Ksmh+7+DE49IYNJScGM4uoJQefEwLEN6VKQcdceCpW/pbvr VjikyEfkxm4rn/LErkm4VilkFW/EaJ0= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-0Awx1PY9PeWmkVcwFy8W1g-1; Fri, 18 Jul 2025 15:36:23 -0400 X-MC-Unique: 0Awx1PY9PeWmkVcwFy8W1g-1 X-Mimecast-MFC-AGG-ID: 0Awx1PY9PeWmkVcwFy8W1g_1752867382 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 327DB1800C34; Fri, 18 Jul 2025 19:36:22 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 58A9218003FC; Fri, 18 Jul 2025 19:36:20 +0000 (UTC) From: Kevin Traynor To: Jedrzej Jagielski Cc: Andrzej Wilczynski , Anatoly Burakov , Bruce Richardson , dpdk stable Subject: patch 'net/ixgbe/base: fix link status for E610' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:30:33 +0100 Message-ID: <20250718193247.1008129-99-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _5rgarPTVr0rhHoNwr5JcvoUvNeELTFFrAPZoYkh_Vw_1752867382 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 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 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 Signed-off-by: Jedrzej Jagielski Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson --- 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@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