]>
Commit | Line | Data |
---|---|---|
a7b0967d MT |
1 | From 540360773bad2b81f14c38ca92b62797fa32cbc6 Mon Sep 17 00:00:00 2001 |
2 | From: KY Srinivasan <kys@microsoft.com> | |
3 | Date: Wed, 30 Apr 2014 11:58:25 -0700 | |
4 | Subject: [PATCH 15/25] hyperv: Properly handle checksum offload | |
5 | ||
6 | Do checksum offload only if the client of the driver wants checksum to be | |
7 | offloaded. | |
8 | ||
9 | In V1 version of this patch, I addressed comments from | |
10 | Stephen Hemminger <stephen@networkplumber.org> and | |
11 | Eric Dumazet <eric.dumazet@gmail.com>. | |
12 | ||
13 | In this version of the patch I have addressed comments from | |
14 | David Miller. | |
15 | ||
16 | This patch fixes a bug that is exposed in gateway scenarios. | |
17 | ||
18 | Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> | |
19 | Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> | |
20 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
21 | --- | |
22 | drivers/net/hyperv/netvsc_drv.c | 4 ++++ | |
23 | 1 file changed, 4 insertions(+) | |
24 | ||
25 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c | |
26 | index 0d898876689e..ce6d870dd7ae 100644 | |
27 | --- a/drivers/net/hyperv/netvsc_drv.c | |
28 | +++ b/drivers/net/hyperv/netvsc_drv.c | |
29 | @@ -383,6 +383,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) | |
30 | if (skb_is_gso(skb)) | |
31 | goto do_lso; | |
32 | ||
33 | + if ((skb->ip_summed == CHECKSUM_NONE) || | |
34 | + (skb->ip_summed == CHECKSUM_UNNECESSARY)) | |
35 | + goto do_send; | |
36 | + | |
37 | rndis_msg_size += NDIS_CSUM_PPI_SIZE; | |
38 | ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE, | |
39 | TCPIP_CHKSUM_PKTINFO); | |
40 | -- | |
41 | 2.4.3 | |
42 |