aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKY Srinivasan <[email protected]>2014-04-30 11:58:25 -0700
committerDavid S. Miller <[email protected]>2014-04-30 16:12:23 -0400
commit22041fb05b66387b2854f789d1e1f55c7d07b4f4 (patch)
treed3ef29c7b3ff28c316691e4fcc2885eca9b50b49
parent6ce29b0e2a04ea85617cd21099af67449a76f589 (diff)
hyperv: Properly handle checksum offload
Do checksum offload only if the client of the driver wants checksum to be offloaded. In V1 version of this patch, I addressed comments from Stephen Hemminger <[email protected]> and Eric Dumazet <[email protected]>. In this version of the patch I have addressed comments from David Miller. This patch fixes a bug that is exposed in gateway scenarios. Signed-off-by: K. Y. Srinivasan <[email protected]> Reviewed-by: Haiyang Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/hyperv/netvsc_drv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 31e55fba7cad..7918d5132c1f 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -382,6 +382,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
if (skb_is_gso(skb))
goto do_lso;
+ if ((skb->ip_summed == CHECKSUM_NONE) ||
+ (skb->ip_summed == CHECKSUM_UNNECESSARY))
+ goto do_send;
+
rndis_msg_size += NDIS_CSUM_PPI_SIZE;
ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE,
TCPIP_CHKSUM_PKTINFO);