You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
net: axienet: limit minimum TX ring size
commit70f5817dedupstream. The driver will not work properly if the TX ring size is set to below MAX_SKB_FRAGS + 1 since it needs to hold at least one full maximally fragmented packet in the TX ring. Limit setting the ring size to below this value. Fixes:8b09ca823f("net: axienet: Make RX/TX ring sizes configurable") Signed-off-by: Robert Hancock <robert.hancock@calian.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2f548489d6
commit
7a3d3d7f6d
@@ -43,6 +43,7 @@
|
||||
/* Descriptors defines for Tx and Rx DMA */
|
||||
#define TX_BD_NUM_DEFAULT 64
|
||||
#define RX_BD_NUM_DEFAULT 1024
|
||||
#define TX_BD_NUM_MIN (MAX_SKB_FRAGS + 1)
|
||||
#define TX_BD_NUM_MAX 4096
|
||||
#define RX_BD_NUM_MAX 4096
|
||||
|
||||
@@ -1373,7 +1374,8 @@ static int axienet_ethtools_set_ringparam(struct net_device *ndev,
|
||||
if (ering->rx_pending > RX_BD_NUM_MAX ||
|
||||
ering->rx_mini_pending ||
|
||||
ering->rx_jumbo_pending ||
|
||||
ering->rx_pending > TX_BD_NUM_MAX)
|
||||
ering->tx_pending < TX_BD_NUM_MIN ||
|
||||
ering->tx_pending > TX_BD_NUM_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
if (netif_running(ndev))
|
||||
|
||||
Reference in New Issue
Block a user