diff mbox

[V2,net,1/1] hyperv: Properly handle checksum offload

Message ID 1398884305-21618-1-git-send-email-kys@microsoft.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

KY Srinivasan April 30, 2014, 6:58 p.m. UTC
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 <stephen@networkplumber.org> and
Eric Dumazet <eric.dumazet@gmail.com>.

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 <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

David Miller April 30, 2014, 8:17 p.m. UTC | #1
From: "K. Y. Srinivasan" <kys@microsoft.com>
Date: Wed, 30 Apr 2014 11:58:25 -0700

> 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 <stephen@networkplumber.org> and
> Eric Dumazet <eric.dumazet@gmail.com>.
> 
> 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 <kys@microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>

Applied and queued up for -stable, t hanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 939e3af..64c7816 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -467,6 +467,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);