diff options
author | KY Srinivasan <kys@microsoft.com> | 2015-03-29 21:08:42 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-31 14:12:36 -0400 |
commit | b08cc79155fc26d0d112b1470d1ece5034651a4b (patch) | |
tree | f1d9c3316edd991b7c08ae73099d0bd53e0c4b54 /drivers/net/hyperv/netvsc.c | |
parent | cbacec76bcd03ff21b37ac331e652b5a8f3ea644 (diff) | |
download | linux-b08cc79155fc26d0d112b1470d1ece5034651a4b.tar.bz2 |
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.c | 10 |
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; |