summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYelena Krivosheev <yelena@marvell.com>2018-07-18 18:10:56 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-28 22:12:55 -0700
commitf945cec88cbd2f66251a9f5b2532ca10c4e87426 (patch)
tree02ab243766d653ec91420630aa85313649759258 /drivers
parent7e47fd84b56bb37ff1c3d9ab49c2fff5ee4b3077 (diff)
downloadlinux-f945cec88cbd2f66251a9f5b2532ca10c4e87426.tar.bz2
net: mvneta: Verify hardware checksum only when offload checksum feature is set
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 6af583ef2af2..079b515c54c1 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -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;