]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: stmmac: Only the last buffer has the FCS field
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 18 Dec 2019 10:17:38 +0000 (11:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Dec 2019 20:04:17 +0000 (12:04 -0800)
Only the last received buffer contains the FCS field. Check for end of
packet before trying to strip the FCS field.

Fixes: 88ebe2cf7f3f ("net: stmmac: Rework stmmac_rx()")
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 8b7861909ef9c6c8a0f13bf8c05467602cfca0b7..acb14a96243e4b3522e3277aebc2486323733151 100644 (file)
@@ -3644,8 +3644,9 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
                 * feature is always disabled and packets need to be
                 * stripped manually.
                 */
-               if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
-                   unlikely(status != llc_snap)) {
+               if (likely(!(status & rx_not_ls)) &&
+                   (likely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
+                    unlikely(status != llc_snap))) {
                        if (buf2_len)
                                buf2_len -= ETH_FCS_LEN;
                        else