* [PATCH net v2 0/3] net: wangxun: keep MAC enabled for specific
@ 2026-09-24 2:01 Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-09-24 2:01 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Jacob Keller, Kees Cook,
Chenguang Zhao, Russell King (Oracle), Maciej Fijalkowski,
Simon Horman, Jiawen Wu
For ngbe OCP devices and txgbe NCSI devices, MAC should be kept enabled.
Fix it by referring to the subsystem device ID to detect NCSI capable
devices, and skip disabling the MAC on link down for them.
---
Changes Log:
v2:
- Remove WoL related changes.
v1: https://lore.kernel.org/all/7DBD5726DAA21342+20260920085114.1062503-1-jiawenwu@trustnetic.com
---
Jiawen Wu (3):
net: libwx: keep NGBE OCP cards MAC enabled
net: txgbe: keep MAC enabled for SP devices that support NCSI
net: txgbe: keep MAC enabled for AML devices that support NCSI
drivers/net/ethernet/wangxun/libwx/wx_hw.c | 3 ++-
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c | 6 ++++--
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 3 ++-
3 files changed, 8 insertions(+), 4 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled
2026-09-24 2:01 [PATCH net v2 0/3] net: wangxun: keep MAC enabled for specific Jiawen Wu
@ 2026-09-24 2:01 ` Jiawen Wu
2026-09-30 1:48 ` Jakub Kicinski
2026-09-24 2:01 ` [PATCH net v2 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 3/3] net: txgbe: keep MAC enabled for AML " Jiawen Wu
2 siblings, 1 reply; 7+ messages in thread
From: Jiawen Wu @ 2026-09-24 2:01 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Jacob Keller, Kees Cook,
Chenguang Zhao, Russell King (Oracle), Maciej Fijalkowski,
Simon Horman, Jiawen Wu
OCP mezzanine cards are NCSI capable by design, so the NCSI semantics do
apply to them, and they need the MAC receiver to keep running for
out-of-band management. The inline test does not cover the OCP card
type, so on such a card that does not have the NCSI bit set the receiver
was turned off on every path reaching wx_disable_rx(), and management
traffic was dropped.
'wx->ncsi_enabled' is the correct value for NGBE to determine whether
MAC RX/TX should be kept enabled. But it is not assigned in TXGBE, so we
use an explicit subsystem device ID mask in libwx now. We will merge
TXGBE and NGBE into unified 'wx->ncsi_enabled' as soon as possible.
Fixes: 02338c484ab6 ("net: ngbe: Initialize sw info and register netdev")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/libwx/wx_hw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
index 122c4952d203f..3a48380ace439 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
@@ -1314,7 +1314,8 @@ void wx_disable_rx(struct wx *wx)
wr32(wx, WX_RDB_PB_CTL, rxctrl);
if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
- ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
+ ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP) ||
+ (wx->mac.type == wx_mac_em && (wx->subsystem_device_id & 0xFF) == 0x40))) {
/* disable mac receiver */
wr32m(wx, WX_MAC_RX_CFG,
WX_MAC_RX_CFG_RE, 0);
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net v2 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI
2026-09-24 2:01 [PATCH net v2 0/3] net: wangxun: keep MAC enabled for specific Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
@ 2026-09-24 2:01 ` Jiawen Wu
2026-09-28 2:28 ` netdev-bot+sashiko
2026-09-24 2:01 ` [PATCH net v2 3/3] net: txgbe: keep MAC enabled for AML " Jiawen Wu
2 siblings, 1 reply; 7+ messages in thread
From: Jiawen Wu @ 2026-09-24 2:01 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Jacob Keller, Kees Cook,
Chenguang Zhao, Russell King (Oracle), Maciej Fijalkowski,
Simon Horman, Jiawen Wu
The .mac_link_down() in phylink callback disable MAC TX unconditionally.
This is not suitable for devices using NCSI, where the MAC needs to
remain enabled after the link goes down to support the corresponding
functionality.
Skip disabling MAC TX when the subsystem device ID indicates an NCSI.
Keep the existing link-down handling for other devices.
Fixes: 08f08f9390e4 ("net: txgbe: Support phylink MAC layer")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index dc9f243146580..d11f26dc13e92 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -182,7 +182,8 @@ static void txgbe_mac_link_down(struct phylink_config *config,
{
struct wx *wx = phylink_to_wx(config);
- wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
+ if (!((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP))
+ wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
wx->speed = SPEED_UNKNOWN;
if (test_bit(WX_STATE_PTP_RUNNING, wx->state))
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net v2 3/3] net: txgbe: keep MAC enabled for AML devices that support NCSI
2026-09-24 2:01 [PATCH net v2 0/3] net: wangxun: keep MAC enabled for specific Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI Jiawen Wu
@ 2026-09-24 2:01 ` Jiawen Wu
2 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-09-24 2:01 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Jacob Keller, Kees Cook,
Chenguang Zhao, Russell King (Oracle), Maciej Fijalkowski,
Simon Horman, Jiawen Wu
The .mac_link_down() in phylink callback disable MAC TX and RX
unconditionally. This is not suitable for devices using NCSI, where the
MAC needs to remain enabled after the link goes down to support the
corresponding functionality.
Skip disabling MAC TX and RX when the subsystem device ID indicates an
NCSI device. Keep the existing link-down handling for other devices.
Fixes: 6f8b4c01a8cd ("net: txgbe: Implement PHYLINK for AML 25G/10G devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
index 26d0cfc58ee2c..16b166b010ef6 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
@@ -458,8 +458,10 @@ static void txgbe_mac_link_down_aml(struct phylink_config *config,
{
struct wx *wx = phylink_to_wx(config);
- wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
- wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
+ if (!((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP)) {
+ wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
+ wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
+ }
wx->speed = SPEED_UNKNOWN;
if (test_bit(WX_STATE_PTP_RUNNING, wx->state))
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net v2 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI
2026-09-24 2:01 ` [PATCH net v2 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI Jiawen Wu
@ 2026-09-28 2:28 ` netdev-bot+sashiko
0 siblings, 0 replies; 7+ messages in thread
From: netdev-bot+sashiko @ 2026-09-28 2:28 UTC (permalink / raw)
To: jiawenwu
Cc: netdev, mengyuanlou, andrew+netdev, davem, edumazet, kuba, pabeni,
jacob.e.keller, kees, zhaochenguang, rmk+kernel,
maciej.fijalkowski, horms
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0 (2)
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The fix covers only one of the phylink callbacks that turn off
the MAC transmitter.
Pre-existing issues:
- [Low] At this patch, txgbe_mac_link_down_aml() in
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c (lines 455-468) still…
- [Low] The new condition in txgbe_mac_link_down() (txgbe_phy.c:185)
exempts only NCSI devices.
--
net: txgbe: keep MAC enabled for SP devices that support NCSI
This patch makes txgbe_mac_link_down() stop clearing WX_MAC_TX_CFG_TE when
the subsystem device ID shows NCSI support. The aim is to keep the MAC
transmitter on after link-down on SP devices, so NCSI keeps working.
Other devices keep the existing link-down handling.
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> index dc9f243146580..d11f26dc13e92 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> @@ -182,7 +182,8 @@ static void txgbe_mac_link_down(struct phylink_config *config,
> {
> struct wx *wx = phylink_to_wx(config);
>
> - wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
> + if (!((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP))
> + wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
[Severity: Medium]
Does this keep the transmitter on for NCSI boards in all cases? Another
callback in the same txgbe_mac_ops still clears TE with no NCSI check:
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c:txgbe_mac_prepare() {
...
wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
...
}
txgbe_mac_finish() turns the SEC TX path and MAC RX back on, but not TE:
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c:txgbe_mac_finish() {
...
txgbe_enable_sec_tx_path(wx);
wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, WX_MAC_RX_CFG_RE);
...
}
So TE is only set again in txgbe_mac_link_up().
mac_prepare runs on every major config, before any link is resolved:
phylink_start()
phylink_mac_initial_config()
phylink_major_config()
txgbe_mac_prepare()
Resume and SFP interface changes also reach this path.
Here is a sequence on an NCSI SP board:
1. ifup with no cable. txgbe_mac_prepare() clears TE. The link never
comes up, so txgbe_mac_link_up() never runs.
2. ifdown. phylink_stop() only calls mac_link_down if the link was up,
so it isn't called. txgbe_disable_device() skips clearing TE for NCSI,
but it doesn't set TE either:
if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
/* disable mac transmiter */
wr32m(wx, WX_MAC_TX_CFG, WX_MAC_TX_CFG_TE, 0);
}
3. The host interface stays down with TE=0. If a cable is plugged in
later, BMC pass-through transmit would still be blocked.
Even on a normal ifup, BMC transmit appears to be blocked from
mac_prepare until link-up.
I couldn't tell from the code whether firmware or a hardware reset turns
TE back on in this state. On copper, txgbe_reset_hw() doesn't issue a
LAN reset.
The follow-up patch "net: txgbe: keep MAC enabled for AML devices that
support NCSI" only touches txgbe_aml.c. That means txgbe_mac_prepare()
and txgbe_mac_finish() are still unchanged at the end of the series.
When (subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP, should
txgbe_mac_prepare() leave TE set, or should txgbe_mac_finish() set it
again?
[Severity: Low]
This isn't a bug introduced by this patch. At this point in the series,
the AML link-down callback still clears both TX and RX on NCSI devices:
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c:txgbe_mac_link_down_aml() {
...
wr32m(wx, TXGBE_AML_MAC_TX_CFG, TXGBE_AML_MAC_TX_CFG_TE, 0);
wr32m(wx, WX_MAC_RX_CFG, WX_MAC_RX_CFG_RE, 0);
...
}
The next patch in the series, "net: txgbe: keep MAC enabled for AML
devices that support NCSI", wraps both writes in the same NCSI check.
This looks resolved once the whole series is applied.
[Severity: Low]
This is a pre-existing inconsistency, not something this patch
introduced. The new check only tests WX_NCSI_SUP. txgbe_disable_device()
exempts both NCSI and WOL boards from clearing the same TE bit (see the
snippet above).
This patch doesn't change anything for WOL-only boards. WOL relies on
MAC RX, which wx_disable_rx() keeps on, and txgbe doesn't implement WOL.
So I don't see a functional effect.
Is the difference between the two conditions intentional?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260924020149.30800-1-jiawenwu%40trustnetic.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled
2026-09-24 2:01 ` [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
@ 2026-09-30 1:48 ` Jakub Kicinski
2026-10-08 2:19 ` Jiawen Wu
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2026-09-30 1:48 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Jacob Keller, Kees Cook, Chenguang Zhao,
Russell King (Oracle), Maciej Fijalkowski, Simon Horman
On Thu, 24 Sep 2026 10:01:47 +0800 Jiawen Wu wrote:
> if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
> - ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
> + ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP) ||
> + (wx->mac.type == wx_mac_em && (wx->subsystem_device_id & 0xFF) == 0x40))) {
This condition looks way too magical for upstream
Add some wx_has_ncsi() helper and add it there?
At least then the meaning is clear, here it's next to WOL, no idea what
it's supposed to mean.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled
2026-09-30 1:48 ` Jakub Kicinski
@ 2026-10-08 2:19 ` Jiawen Wu
0 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2026-10-08 2:19 UTC (permalink / raw)
To: 'Jakub Kicinski'
Cc: netdev, 'Mengyuan Lou', 'Andrew Lunn',
'David S. Miller', 'Eric Dumazet',
'Paolo Abeni', 'Jacob Keller',
'Kees Cook', 'Chenguang Zhao',
'Russell King (Oracle)', 'Maciej Fijalkowski',
'Simon Horman'
On Wed, Sep 30, 2026 9:49 AM, Jakub Kicinski wrote:
> On Thu, 24 Sep 2026 10:01:47 +0800 Jiawen Wu wrote:
> > if (!(((wx->subsystem_device_id & WX_NCSI_MASK) == WX_NCSI_SUP) ||
> > - ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP))) {
> > + ((wx->subsystem_device_id & WX_WOL_MASK) == WX_WOL_SUP) ||
> > + (wx->mac.type == wx_mac_em && (wx->subsystem_device_id & 0xFF) == 0x40))) {
>
> This condition looks way too magical for upstream
>
> Add some wx_has_ncsi() helper and add it there?
> At least then the meaning is clear, here it's next to WOL, no idea what
> it's supposed to mean.
I had planned to fix this issue temporarily, and unify to use 'wx->ncsi_enabled'
in a later net-next patch. Looks like I'm messing things up. I'll fix it all in V3.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-10-08 2:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 2:01 [PATCH net v2 0/3] net: wangxun: keep MAC enabled for specific Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 1/3] net: libwx: keep NGBE OCP cards MAC enabled Jiawen Wu
2026-09-30 1:48 ` Jakub Kicinski
2026-10-08 2:19 ` Jiawen Wu
2026-09-24 2:01 ` [PATCH net v2 2/3] net: txgbe: keep MAC enabled for SP devices that support NCSI Jiawen Wu
2026-09-28 2:28 ` netdev-bot+sashiko
2026-09-24 2:01 ` [PATCH net v2 3/3] net: txgbe: keep MAC enabled for AML " Jiawen Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox