Skip to content

net: bcm4908_enet: RX buffer fixes

Kordian Chmielewski lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: bcm4908_enet: keep the RX buffer when the refill failsdrivers/net/ethernet/broadcom/bcm4908_enet.c+41 -192 replies
2/2net: bcm4908_enet: keep the RX buffers when the RX channel does not stopdrivers/net/ethernet/broadcom/bcm4908_enet.c+40 -141 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFlorian Fainelli
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/2] net: bcm4908_enet: RX buffer fixes

Two follow-ups to the TX ring series that is now in net [1]. Both are about RX buffers, and Sashiko's reviews of that series pointed out both.

Patch 1 keeps the old buffer in its slot when the RX refill fails, so that a failed allocation drops one frame instead of leaving the slot without a buffer.

Patch 2 makes stop() leave the RX buffers to the DMA when the RX channel does not stop in time, as that series did for the TX buffers. It also waits for the channel with read_poll_timeout(), because the 2 ms deadline in jiffies can pass after a single read at HZ=100 or 250.

Tested on an Archer AX6000 with OpenWrt and Linux 6.18.55, with the LAN going through this driver, whose code differs from net with this series only in one tree-wide change, two test-only module parameters and two comments. TX and RX ran at line rate (941 Mbit/s TCP). With every 50th RX buffer allocation made to fail, RX averaged 787 Mbit/s over 30 s and dropped 41579 of 2079029 frames (2.0%), with no errors in the counters or in the kernel log. With the RX stop made to report a timeout after the channel had stopped, each of 45 down/up cycles of the conduit logged the "Timeout waiting for DMA RX stop" warning once. Five of them were made while the router was receiving at line rate, and RX came back after each. 45 cycles without that parameter did not log it. I have not seen the RX channel time out for real, and the parameter does not make the DMA keep writing.

Fixes for some other points from those reviews will follow separately:
open() ignores a failure to fill the RX ring and calls napi_alloc_frag() outside NAPI, the driver does not work without its optional TX interrupt, and a TX completion can still be missed.

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

Kordian Chmielewski (2):
net: bcm4908_enet: keep the RX buffer when the refill fails
net: bcm4908_enet: keep the RX buffers when the RX channel does not
stop

 drivers/net/ethernet/broadcom/bcm4908_enet.c | 114 +++++++++++++------
 1 file changed, 81 insertions(+), 33 deletions(-)

base-commit: 4d67cf2fd2352f130c42494a933ba9158b925c65

Signature · 1 line
2.56.1