From b08cc79155fc26d0d112b1470d1ece5034651a4b Mon Sep 17 00:00:00 2001 From: KY Srinivasan Date: Sun, 29 Mar 2015 21:08:42 -0700 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/hyperv/netvsc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/net/hyperv/netvsc.c') 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; -- cgit v1.2.3-59-g8ed1b