]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: stmmac: Enable 16KB buffer size
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 18 Dec 2019 10:17:42 +0000 (11:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Dec 2019 20:04:18 +0000 (12:04 -0800)
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>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index f507a9bee15b8cfbe00e0dab71268b74c827a804..1cb466dd5b3fcee2e7ef8347cf110c339f94c833 100644 (file)
@@ -1109,7 +1109,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;