aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc.c
diff options
context:
space:
mode:
authorKY Srinivasan <kys@microsoft.com>2015-03-29 21:08:42 -0700
committerDavid S. Miller <davem@davemloft.net>2015-03-31 14:12:36 -0400
commitb08cc79155fc26d0d112b1470d1ece5034651a4b (patch)
treef1d9c3316edd991b7c08ae73099d0bd53e0c4b54 /drivers/net/hyperv/netvsc.c
parenthv_netvsc: Cleanup the test for freeing skb when we use sendbuf mechanism (diff)
downloadlinux-dev-b08cc79155fc26d0d112b1470d1ece5034651a4b.tar.xz
linux-dev-b08cc79155fc26d0d112b1470d1ece5034651a4b.zip
hv_netvsc: Eliminate memory allocation in the packet send path
The network protocol used to communicate with the host is the remote ndis (rndis) protocol. We need to decorate each outgoing packet with a rndis header and additional rndis state (rndis per-packet state). To manage this state, we currently allocate memory in the transmit path. Eliminate this allocation by requesting additional head room in the skb. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r--drivers/net/hyperv/netvsc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index ecbd81385e96..f69923695b5b 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -866,11 +866,15 @@ int netvsc_send(struct hv_device *device,
netvsc_copy_to_send_buf(net_device,
section_index, msd_len,
packet);
- skb = (struct sk_buff *)
- (unsigned long)packet->send_completion_tid;
+ if (!packet->part_of_skb) {
+ skb = (struct sk_buff *)
+ (unsigned long)
+ packet->send_completion_tid;
+
+ packet->send_completion_tid = 0;
+ }
packet->page_buf_cnt = 0;
- packet->send_completion_tid = 0;
packet->send_buf_index = section_index;
packet->total_data_buflen += msd_len;