]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: stmmac: Enable dwmac4 jumbo frame more than 8KiB
authorWeifeng Voon <weifeng.voon@intel.com>
Wed, 3 Jul 2019 16:59:10 +0000 (00:59 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jul 2019 19:33:12 +0000 (12:33 -0700)
Enable GMAC v4.xx and beyond to support 16KiB buffer.

Signed-off-by: Weifeng Voon <weifeng.voon@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c

index cf6436d3d6c7f8b2ed06edca63c862189eca3df4..dbde23e7e16991a25e7ee32d24b352207d0956c2 100644 (file)
@@ -443,6 +443,15 @@ static void dwmac4_clear(struct dma_desc *p)
        p->des3 = 0;
 }
 
+static int set_16kib_bfsize(int mtu)
+{
+       int ret = 0;
+
+       if (unlikely(mtu >= BUF_SIZE_8KiB))
+               ret = BUF_SIZE_16KiB;
+       return ret;
+}
+
 const struct stmmac_desc_ops dwmac4_desc_ops = {
        .tx_status = dwmac4_wrback_get_tx_status,
        .rx_status = dwmac4_wrback_get_rx_status,
@@ -469,4 +478,6 @@ const struct stmmac_desc_ops dwmac4_desc_ops = {
        .clear = dwmac4_clear,
 };
 
-const struct stmmac_mode_ops dwmac4_ring_mode_ops = { };
+const struct stmmac_mode_ops dwmac4_ring_mode_ops = {
+       .set_16kib_bfsize = set_16kib_bfsize,
+};