Skip to contentSkip to conversation

net: sparx5/lan969x: fix RX ring stall on frames from inactive ports

PATCH Superseded [email protected] 2 participants 2 messages Nov 13 – Nov 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v5 cover net: sparx5/lan969x: fix RX ring stall on frames from inactive ports

From: Zhang Hewei <[email protected]>

The FDMA RX path on both sparx5 and its lan969x sibling stalls the RX ring forever when the hardware delivers a frame whose source port does not map to an active netdev: the inactive-port error branch in both drivers leaves the FDMA software cursor untouched, while the DCB keeps its hardware DONE bit - so every following NAPI poll picks the same DCB again and RX traffic stalls on all ports until the module is reloaded.

Patch 1 treats a bogus frame on sparx5 as consumed (free the skb, clear the array slot, return true). Patch 2 unifies the NULL semantics on
lan969x: NULL always means "frame dropped, page recycled" (inactive port or failed build_skb()), and the poll loop advances past such a DB like it does for any other frame.

v5: add the testing status to the commit messages as requested for fix series (patch 1 not tested - no hardware available; patch 2's drop-and-advance form was verified on lan969x hardware by Daniel Machon during review). No functional change since v4.

v4 lore link:
https://lore.kernel.org/netdev/[email protected]/

Found by code inspection; the stall needs the hardware to emit a frame with an invalid source port, which cannot be triggered without hardware. Review from someone with access to sparx5/lan969x systems would be appreciated.

Zhang Hewei (2):
net: sparx5: fix RX ring stall on frames from inactive ports
net: lan969x: fix RX ring stall on frames from inactive ports

 .../microchip/sparx5/lan969x/lan969x_fdma.c        | 14 ++++++++------
 .../net/ethernet/microchip/sparx5/sparx5_fdma.c    |  8 +++++---
 2 files changed, 13 insertions(+), 9 deletions(-)
Signature · 1 line
2.39.5 (Apple Git-154)
#1 lore raw

Hi Zhang,

Quoted 10 lines

From: Zhang Hewei <[email protected]>

The FDMA RX path on both sparx5 and its lan969x sibling stalls the RX ring forever when the hardware delivers a frame whose source port does not map to an active netdev: the inactive-port error branch in both drivers leaves the FDMA software cursor untouched, while the DCB keeps its hardware DONE bit - so every following NAPI poll picks the same DCB again and RX traffic stalls on all ports until the module is reloaded.

Quoted 5 lines

Patch 1 treats a bogus frame on sparx5 as consumed (free the skb, clear the array slot, return true). Patch 2 unifies the NULL semantics on
lan969x: NULL always means "frame dropped, page recycled" (inactive port or failed build_skb()), and the poll loop advances past such a DB like it does for any other frame.

Thanks for the series. These fixes conflict with my MTU series for sparx5/lan969x [1], which is now blocked on them [2], and the remaining comments on 1/2 and 2/2 would need yet another respin. To move things along, I am going to post my own version of the fixes, crediting you with Reported-by. I will Cc you.

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/

/Daniel

pw-bot: reject

Quoted 26 lines

v5: add the testing status to the commit messages as requested for fix series (patch 1 not tested - no hardware available; patch 2's drop-and-advance form was verified on lan969x hardware by Daniel Machon during review). No functional change since v4.

v4 lore link:
https://lore.kernel.org/netdev/[email protected]/

Found by code inspection; the stall needs the hardware to emit a frame with an invalid source port, which cannot be triggered without hardware. Review from someone with access to sparx5/lan969x systems would be appreciated.

Zhang Hewei (2):
net: sparx5: fix RX ring stall on frames from inactive ports
net: lan969x: fix RX ring stall on frames from inactive ports

 .../microchip/sparx5/lan969x/lan969x_fdma.c        | 14 ++++++++------
 .../net/ethernet/microchip/sparx5/sparx5_fdma.c    |  8 +++++---
 2 files changed, 13 insertions(+), 9 deletions(-)
Signature · 1 line
2.39.5 (Apple Git-154)