]> www.infradead.org Git - users/hch/xfs.git/commit
net: ethernet: mtk_eth_soc: handle dma buffer size soc specific
authorFrank Wunderlich <frank-w@public-files.de>
Mon, 3 Jun 2024 19:25:05 +0000 (21:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Jun 2024 13:04:44 +0000 (14:04 +0100)
commitc57e558194430d10d5e5f4acd8a8655b68dade13
tree48e8c8c968fe93ca1da48e21cb5d648b0c694957
parent5b4b62a169e10401cca34a6e7ac39161986f5605
net: ethernet: mtk_eth_soc: handle dma buffer size soc specific

The mainline MTK ethernet driver suffers long time from rarly but
annoying tx queue timeouts. We think that this is caused by fixed
dma sizes hardcoded for all SoCs.

We suspect this problem arises from a low level of free TX DMADs,
the TX Ring alomost full.

The transmit timeout is caused by the Tx queue not waking up. The
Tx queue stops when the free counter is less than ring->thres, and
it will wake up once the free counter is greater than ring->thres.
If the CPU is too late to wake up the Tx queues, it may cause a
transmit timeout.
Therefore, we increased the TX and RX DMADs to improve this error
situation.

Use the dma-size implementation from SDK in a per SoC manner. In
difference to SDK we have no RSS feature yet, so all RX/TX sizes
should be raised from 512 to 2048 byte except fqdma on mt7988 to
avoid the tx timeout issue.

Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 ethernet")
Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c
drivers/net/ethernet/mediatek/mtk_eth_soc.h