Skip to content

Assorted mvneta fixes and improvements

Willy Tarreau netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13net: mvneta: increase the 64-bit rx/tx stats out of the hot pathdrivers/net/ethernet/marvell/mvneta.c+11 -40 replies
2/13net: mvneta: use per_cpu stats to fix an SMP lock updrivers/net/ethernet/marvell/mvneta.c+55 -290 replies
3/13net: mvneta: do not schedule in mvneta_tx_timeoutdrivers/net/ethernet/marvell/mvneta.c+0 -110 replies
4/13net: mvneta: add missing bit descriptions for interrupt masks and causesdrivers/net/ethernet/marvell/mvneta.c+42 -20 replies
5/13net: mvneta: replace Tx timer with a real interruptdrivers/net/ethernet/marvell/mvneta.c+12 -590 replies
6/13net: mvneta: remove tests for impossible cases in the tx_done pathdrivers/net/ethernet/marvell/mvneta.c+9 -60 replies
7/13net: mvneta: factor rx refilling codedrivers/net/ethernet/marvell/mvneta.c+3 -200 replies
8/13net: mvneta: simplify access to the rx descriptor statusdrivers/net/ethernet/marvell/mvneta.c+12 -130 replies
9/13net: mvneta: prefetch next rx descriptor instead of current onedrivers/net/ethernet/marvell/mvneta.c+1 -10 replies
10/13net: mvneta: convert to build_skb()drivers/net/ethernet/marvell/mvneta.c+35 -140 replies
11/13net: mvneta: implement rx_copybreakdrivers/net/ethernet/marvell/mvneta.c+38 -68 replies
12/13net: mvneta: mvneta_tx_done_gbe() cleanupsdrivers/net/ethernet/marvell/mvneta.c+4 -130 replies
13/13net: mvneta: make mvneta_txq_done() return voiddrivers/net/ethernet/marvell/mvneta.c+4 -50 replies

Reviews trailers per patch

4 of 13 patches have a Reviewed-by or Acked-by.

PatchEric DumazetArnaud EbalardWilly Tarreau
1/13R-b T-b
2/13R-b T-b
3/13T-b
4/13T-b
5/13T-b
6/13T-b
7/13T-b
8/13T-b
9/13T-b
10/13T-b
11/13T-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/13] Assorted mvneta fixes and improvements

Hi,

this series provides some fixes for a number of issues met with the mvneta driver, then adds some improvements. Patches 1-5 are fixes and would be needed in 3.13 and likely -stable. The next ones are performance improvements and cleanups :

- driver lockup when reading stats while sending traffic from multiple CPUs : this obviously only happens on SMP and is the result of missing locking on the driver. The problem was present since the introduction of the driver in 3.8. The first patch performs some changes that are needed for the second one which actually fixes the issue by using per-cpu counters. It could make sense to backport this to the relevant stable versions.

- mvneta_tx_timeout calls various functions to reset the NIC, and these functions sleep, which is not allowed here, resulting in a panic. Better completely disable this Tx timeout handler for now since it is never called. The problem was encountered while developing some new features, it's uncertain whether it's possible to reproduce it with regular usage, so maybe a backport to stable is not needed.

- replace the Tx timer with a real Tx IRQ. As first reported by Arnaud Ebalard and explained by Eric Dumazet, there is no way this driver can work correctly if it uses a driver to recycle the Tx descriptors. If too many packets are sent at once, the driver quickly ends up with no descriptors (which happens twice as easily in GSO) and has to wait 10ms for recycling its descriptors and being able to send again. Eric has worked around this in the core GSO code. But still when routing traffic or sending UDP packets, the limitation is very visible. Using Tx IRQs allows Tx descriptors to be recycled when sent. The coalesce value is still configurable using ethtool. This fix turns the UDP send bitrate from 134 Mbps to 987 Mbps (ie: line rate). It's made of two patches, one to add the relevant bits from the original Marvell's driver, and another one to implement the change. I don't know if it should be backported to stable, as the bug only causes poor performance.

- Patches 6..8 are essentially cleanups, code deduplication and minor optimizations for not re-fetching a value we already have (status).

- patch 9 changes the prefetch of Rx descriptor from current one to next one. In benchmarks, it results in about 1% general performance increase on HTTP traffic, probably because prefetching the current descriptor does not leave enough time between the start of prefetch and its usage.

- patch 10 implements support for build_skb() on Rx path. The driver now preallocates frags instead of skbs and builds an skb just before delivering it. This results in a 2% performance increase on HTTP traffic, and up to 5% on small packet Rx rate.

- patch 11 implements rx_copybreak for small packets (256 bytes). It avoids a dma_map_single()/dma_unmap_single() and increases the Rx rate by 16.4%, from 486kpps to 573kpps. Further improvements up to 711kpps are possible depending how the DMA is used.

- patches 12 and 13 are extra cleanups made possible by some of the simplifications above.

Thanks,
Willy

---
Arnaud Ebalard (2):
net: mvneta: mvneta_tx_done_gbe() cleanups
net: mvneta: make mvneta_txq_done() return void

Willy Tarreau (11):
net: mvneta: increase the 64-bit rx/tx stats out of the hot path
net: mvneta: use per_cpu stats to fix an SMP lock up
net: mvneta: do not schedule in mvneta_tx_timeout
net: mvneta: add missing bit descriptions for interrupt masks and
causes
net: mvneta: replace Tx timer with a real interrupt
net: mvneta: remove tests for impossible cases in the tx_done path
net: mvneta: factor rx refilling code
net: mvneta: simplify access to the rx descriptor status
net: mvneta: prefetch next rx descriptor instead of current one
net: mvneta: convert to build_skb()
net: mvneta: implement rx_copybreak

 drivers/net/ethernet/marvell/mvneta.c | 387 +++++++++++++++++++---------------
 1 file changed, 215 insertions(+), 172 deletions(-)

--
1.7.12.2.21.g234cd45.dirty