1
0
Fork 0
alistair23-linux/drivers/net/ethernet/microchip
Sven Van Asbroeck efc570073c lan743x: fix rx_napi_poll/interrupt ping-pong
[ Upstream commit 57030a0b62 ]

Even if there is more rx data waiting on the chip, the rx napi poll fn
will never run more than once - it will always read a few buffers, then
bail out and re-arm interrupts. Which results in ping-pong between napi
and interrupt.

This defeats the purpose of napi, and is bad for performance.

Fix by making the rx napi poll behave identically to other ethernet
drivers:
1. initialize rx napi polling with an arbitrary budget (64).
2. in the polling fn, return full weight if rx queue is not depleted,
   this tells the napi core to "keep polling".
3. update the rx tail ("ring the doorbell") once for every 8 processed
   rx ring buffers.

Thanks to Jakub Kicinski, Eric Dumazet and Andrew Lunn for their expert
opinions and suggestions.

Tested with 20 seconds of full bandwidth receive (iperf3):
        rx irqs      softirqs(NET_RX)
        -----------------------------
before  23827        33620
after   129          4081

Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
Fixes: 23f0703c12 ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
Link: https://lore.kernel.org/r/20201215161954.5950-1-TheSven73@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:51:27 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
enc28j60.c enc28j60: Convert to use SPDX identifier 2019-03-19 14:59:32 -07:00
enc28j60_hw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
encx24j600-regmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
encx24j600.c net: microchip: encx24j600: add missed kthread_stop 2020-06-03 08:21:09 +02:00
encx24j600_hw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lan743x_ethtool.c lan743x: fix for potential NULL pointer dereference with bare card 2020-12-21 13:27:04 +01:00
lan743x_ethtool.h lan743x: Add support for ethtool get_drvinfo 2018-07-23 14:09:18 -07:00
lan743x_main.c lan743x: fix rx_napi_poll/interrupt ping-pong 2020-12-30 11:51:27 +01:00
lan743x_main.h lan743x: fix "BUG: invalid wait context" when setting rx mode 2020-11-18 19:20:27 +01:00
lan743x_ptp.c net: reject PTP periodic output requests with unsupported flags 2019-11-15 12:48:32 -08:00
lan743x_ptp.h net: lan743x: fix building without CONFIG_PTP_1588_CLOCK 2018-08-13 20:43:47 -07:00