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/rndis_filter.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/hyperv/rndis_filter.c') diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index fdfab1feccfc..a1604376aee1 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -210,6 +210,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, { int ret; struct hv_netvsc_packet *packet; + struct hv_page_buffer page_buf[2]; /* Setup the packet to send it */ packet = &req->pkt; @@ -217,6 +218,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, packet->is_data_pkt = false; packet->total_data_buflen = req->request_msg.msg_len; packet->page_buf_cnt = 1; + packet->page_buf = page_buf; packet->page_buf[0].pfn = virt_to_phys(&req->request_msg) >> PAGE_SHIFT; -- cgit v1.2.3-55-g7522