]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: mvneta: Verify hardware checksum only when offload checksum feature is set
authorYelena Krivosheev <yelena@marvell.com>
Wed, 18 Jul 2018 16:10:56 +0000 (18:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 05:12:55 +0000 (22:12 -0700)
If the checksum offload feature is not set, then there is no point to
check the status of the hardware.

[gregory: extract from a larger patch]
Signed-off-by: Yelena Krivosheev <yelena@marvell.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c

index 6af583ef2af2351cdfe00f4c045c6ae2256b4440..079b515c54c186194ae248a0c20f3a03c44e3b47 100644 (file)
@@ -1720,7 +1720,8 @@ static void mvneta_rx_error(struct mvneta_port *pp,
 static void mvneta_rx_csum(struct mvneta_port *pp, u32 status,
                           struct sk_buff *skb)
 {
-       if ((status & MVNETA_RXD_L3_IP4) &&
+       if ((pp->dev->features & NETIF_F_RXCSUM) &&
+           (status & MVNETA_RXD_L3_IP4) &&
            (status & MVNETA_RXD_L4_CSUM_OK)) {
                skb->csum = 0;
                skb->ip_summed = CHECKSUM_UNNECESSARY;