patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Zaiyu Wang <zaiyuwang@trustnetic.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Zaiyu Wang <zaiyuwang@trustnetic.com>,
	Jiawen Wu <jiawenwu@trustnetic.com>
Subject: [PATCH 1/2] net/ngbe: fix WOL and NCSI capability error
Date: Mon, 24 Feb 2025 17:59:07 +0800	[thread overview]
Message-ID: <20250224095910.27384-2-zaiyuwang@trustnetic.com> (raw)
In-Reply-To: <20250224095910.27384-1-zaiyuwang@trustnetic.com>

When determining NIC's WOL and NCSI capability via sub-system ID,
flag matching must be exact, not inclusive. Misidentifying WOL/NCSI
capability will skip PHY configuration, causing link-up failure.

Fixes: 5f1ab0d529fc ("net/ngbe: add WOL and NCSI capability")
Cc: stable@dpdk.org

Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
 drivers/net/ngbe/base/ngbe_hw.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ngbe/base/ngbe_hw.c b/drivers/net/ngbe/base/ngbe_hw.c
index e29a1946e5..6688ae6a31 100644
--- a/drivers/net/ngbe/base/ngbe_hw.c
+++ b/drivers/net/ngbe/base/ngbe_hw.c
@@ -1922,6 +1922,8 @@ void ngbe_read_efuse(struct ngbe_hw *hw)
 void ngbe_map_device_id(struct ngbe_hw *hw)
 {
 	u16 oem = hw->sub_system_id & NGBE_OEM_MASK;
+	u16 ncsi = hw->sub_system_id & NGBE_NCSI_SUP_MASK;
+	u16 wol = hw->sub_system_id & NGBE_WOL_SUP_MASK;
 
 	hw->is_pf = true;
 
@@ -1982,9 +1984,9 @@ void ngbe_map_device_id(struct ngbe_hw *hw)
 			oem == NGBE_LY_YT8521S_SFP)
 		hw->gpio_ctl = true;
 
-	hw->wol_enabled = (hw->sub_system_id & NGBE_WOL_SUP_MASK) ? true : false;
-	hw->ncsi_enabled = (hw->sub_system_id & NGBE_NCSI_SUP_MASK ||
-			    hw->sub_system_id & NGBE_OCP_CARD) ? true : false;
+	hw->wol_enabled = (wol == NGBE_WOL_SUP_MASK) ? true : false;
+	hw->ncsi_enabled = (ncsi == NGBE_NCSI_SUP_MASK ||
+			   oem == NGBE_OCP_CARD) ? true : false;
 }
 
 /**
-- 
2.21.0.windows.1


  reply	other threads:[~2025-02-24 10:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  9:59 [PATCH 0/2] Wangxun bug fixes Zaiyu Wang
2025-02-24  9:59 ` Zaiyu Wang [this message]
2025-02-24  9:59 ` [PATCH 2/2] net/txgbe: remove meaningless choice for SW-FW sync Zaiyu Wang

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=20250224095910.27384-2-zaiyuwang@trustnetic.com \
    --to=zaiyuwang@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=jiawenwu@trustnetic.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).