net: axienet: limit minimum TX ring size
authorRobert Hancock <robert.hancock@calian.com>
Tue, 18 Jan 2022 21:41:28 +0000 (15:41 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:32 +0000 (10:54 +0100)
commit7a3d3d7f6d7b3db6cabeb9d43ef207c3eda1b8a5
tree973bca9bf9414b9d8968bd2c5eae3e4af29339c9
parent2f548489d64debf093f2299e38a8d0fc655f87b9
net: axienet: limit minimum TX ring size

commit 70f5817deddbc6ef3faa35841cab83c280cc653a upstream.

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: 8b09ca823ffb4 ("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>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c