net: stmmac: Enable 16KB buffer size
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 18 Dec 2019 10:17:42 +0000 (11:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:19:40 +0000 (08:19 +0100)
commit b2f3a481c4cd62f78391b836b64c0a6e72b503d2 upstream.

XGMAC supports maximum MTU that can go to 16KB. Lets add this check in
the calculation of RX buffer size.

Fixes: 7ac6653a085b ("stmmac: Move the STMicroelectronics driver")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index a2b7c685cbf1cd63e019d38be1925c83bda992c3..8c1a5361f661df9dfd87dc8eccd4eb498012a5b1 100644 (file)
@@ -929,7 +929,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize)
 {
        int ret = bufsize;
 
-       if (mtu >= BUF_SIZE_4KiB)
+       if (mtu >= BUF_SIZE_8KiB)
+               ret = BUF_SIZE_16KiB;
+       else if (mtu >= BUF_SIZE_4KiB)
                ret = BUF_SIZE_8KiB;
        else if (mtu >= BUF_SIZE_2KiB)
                ret = BUF_SIZE_4KiB;