]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: stmmac: xgmac: Enable RX Jumbo frame support
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 4 Sep 2019 13:17:04 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Sep 2019 10:19:55 +0000 (12:19 +0200)
We are already doing it by default in the TX path so we can also enable
Jumbo Frame support in the RX path independently of MTU value.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

index f942ac975c29967908c3b1f8a713950328a45ed7..5923ca62d7938504c3a200df92459a6f6da0402e 100644 (file)
@@ -44,7 +44,8 @@
 #define XGMAC_CONFIG_CST               BIT(2)
 #define XGMAC_CONFIG_ACS               BIT(1)
 #define XGMAC_CONFIG_RE                        BIT(0)
-#define XGMAC_CORE_INIT_RX             0
+#define XGMAC_CORE_INIT_RX             (XGMAC_CONFIG_GPSLCE | XGMAC_CONFIG_WD | \
+                                        (XGMAC_JUMBO_LEN << XGMAC_CONFIG_GPSL_SHIFT))
 #define XGMAC_PACKET_FILTER            0x00000008
 #define XGMAC_FILTER_RA                        BIT(31)
 #define XGMAC_FILTER_IPFE              BIT(20)
index 36262ef8b70a8abc03ae6d3c193d71103c2a193b..78ac659da2792d1855c70b69b500dc77418841b4 100644 (file)
@@ -15,7 +15,6 @@ static void dwxgmac2_core_init(struct mac_device_info *hw,
                               struct net_device *dev)
 {
        void __iomem *ioaddr = hw->pcsr;
-       int mtu = dev->mtu;
        u32 tx, rx;
 
        tx = readl(ioaddr + XGMAC_TX_CONFIG);
@@ -24,16 +23,6 @@ static void dwxgmac2_core_init(struct mac_device_info *hw,
        tx |= XGMAC_CORE_INIT_TX;
        rx |= XGMAC_CORE_INIT_RX;
 
-       if (mtu >= 9000) {
-               rx |= XGMAC_CONFIG_GPSLCE;
-               rx |= XGMAC_JUMBO_LEN << XGMAC_CONFIG_GPSL_SHIFT;
-               rx |= XGMAC_CONFIG_WD;
-       } else if (mtu > 2000) {
-               rx |= XGMAC_CONFIG_JE;
-       } else if (mtu > 1500) {
-               rx |= XGMAC_CONFIG_S2KP;
-       }
-
        if (hw->ps) {
                tx |= XGMAC_CONFIG_TE;
                tx &= ~hw->link.speed_mask;