Commit f945cec8 authored by Yelena Krivosheev's avatar Yelena Krivosheev Committed by David S. Miller

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: default avatarYelena Krivosheev <yelena@marvell.com>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7e47fd84
...@@ -1720,7 +1720,8 @@ static void mvneta_rx_error(struct mvneta_port *pp, ...@@ -1720,7 +1720,8 @@ static void mvneta_rx_error(struct mvneta_port *pp,
static void mvneta_rx_csum(struct mvneta_port *pp, u32 status, static void mvneta_rx_csum(struct mvneta_port *pp, u32 status,
struct sk_buff *skb) 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)) { (status & MVNETA_RXD_L4_CSUM_OK)) {
skb->csum = 0; skb->csum = 0;
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment