aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc_drv.c
diff options
context:
space:
mode:
authorKY Srinivasan <kys@microsoft.com>2014-04-30 10:14:31 -0700
committerDavid S. Miller <davem@davemloft.net>2014-04-30 13:48:46 -0400
commitc25aaf814a63f9d9c4e45416f13d70ef0aa0be2e (patch)
treebe6bb2c8784382684365e47b202f02bd5a95babe /drivers/net/hyperv/netvsc_drv.c
parentnet: stmmac: set phy to use polling by default (diff)
downloadlinux-dev-c25aaf814a63f9d9c4e45416f13d70ef0aa0be2e.tar.xz
linux-dev-c25aaf814a63f9d9c4e45416f13d70ef0aa0be2e.zip
hyperv: Enable sendbuf mechanism on the send path
We send packets using a copy-free mechanism (this is the Guest to Host transport via VMBUS). While this is obviously optimal for large packets, it may not be optimal for small packets. Hyper-V host supports a second mechanism for sending packets that is "copy based". We implement that mechanism in this patch. In this version of the patch I have addressed a comment from David Miller. With this patch (and all of the other offload and VRSS patches), we are now able to almost saturate a 10G interface between Linux VMs on Hyper-V on different hosts - close to 9 Gbps as measured via iperf. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index c76b66515e92..939e3af60ec4 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -236,10 +236,11 @@ static void netvsc_xmit_completion(void *context)
struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
struct sk_buff *skb = (struct sk_buff *)
(unsigned long)packet->send_completion_tid;
+ u32 index = packet->send_buf_index;
kfree(packet);
- if (skb)
+ if (skb && (index == NETVSC_INVALID_INDEX))
dev_kfree_skb_any(skb);
}