]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/linux/0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch
make.sh limit build to 23 parallel threads.
[ipfire-2.x.git] / src / patches / linux / 0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch
CommitLineData
a7b0967d
MT
1From 348a5d691d84759dda8cdd3cbf9f071115c1240e Mon Sep 17 00:00:00 2001
2From: KY Srinivasan <kys@microsoft.com>
3Date: Sun, 16 Feb 2014 16:38:44 -0800
4Subject: [PATCH 02/25] Drivers: net: hyperv: Cleanup the receive path
5
6Make the receive path a little more efficient by parameterizing the
7required state rather than re-establishing that state.
8
9Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
10Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
11Signed-off-by: David S. Miller <davem@davemloft.net>
12---
13 drivers/net/hyperv/netvsc.c | 29 +++++++++++++----------------
14 1 file changed, 13 insertions(+), 16 deletions(-)
15
16diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
17index 03a2c6e17158..7fa2bbade327 100644
18--- a/drivers/net/hyperv/netvsc.c
19+++ b/drivers/net/hyperv/netvsc.c
20@@ -432,17 +432,14 @@ static inline u32 hv_ringbuf_avail_percent(
21 return avail_write * 100 / ring_info->ring_datasize;
22 }
23
24-static void netvsc_send_completion(struct hv_device *device,
25+static void netvsc_send_completion(struct netvsc_device *net_device,
26+ struct hv_device *device,
27 struct vmpacket_descriptor *packet)
28 {
29- struct netvsc_device *net_device;
30 struct nvsp_message *nvsp_packet;
31 struct hv_netvsc_packet *nvsc_packet;
32 struct net_device *ndev;
33
34- net_device = get_inbound_net_device(device);
35- if (!net_device)
36- return;
37 ndev = net_device->ndev;
38
39 nvsp_packet = (struct nvsp_message *)((unsigned long)packet +
40@@ -561,13 +558,13 @@ int netvsc_send(struct hv_device *device,
41 }
42
43 static void netvsc_send_recv_completion(struct hv_device *device,
44+ struct netvsc_device *net_device,
45 u64 transaction_id, u32 status)
46 {
47 struct nvsp_message recvcompMessage;
48 int retries = 0;
49 int ret;
50 struct net_device *ndev;
51- struct netvsc_device *net_device = hv_get_drvdata(device);
52
53 ndev = net_device->ndev;
54
55@@ -653,14 +650,15 @@ static void netvsc_receive_completion(void *context)
56
57 /* Send a receive completion for the xfer page packet */
58 if (fsend_receive_comp)
59- netvsc_send_recv_completion(device, transaction_id, status);
60+ netvsc_send_recv_completion(device, net_device, transaction_id,
61+ status);
62
63 }
64
65-static void netvsc_receive(struct hv_device *device,
66- struct vmpacket_descriptor *packet)
67+static void netvsc_receive(struct netvsc_device *net_device,
68+ struct hv_device *device,
69+ struct vmpacket_descriptor *packet)
70 {
71- struct netvsc_device *net_device;
72 struct vmtransfer_page_packet_header *vmxferpage_packet;
73 struct nvsp_message *nvsp_packet;
74 struct hv_netvsc_packet *netvsc_packet = NULL;
75@@ -673,9 +671,6 @@ static void netvsc_receive(struct hv_device *device,
76
77 LIST_HEAD(listHead);
78
79- net_device = get_inbound_net_device(device);
80- if (!net_device)
81- return;
82 ndev = net_device->ndev;
83
84 /*
85@@ -741,7 +736,7 @@ static void netvsc_receive(struct hv_device *device,
86 spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
87 flags);
88
89- netvsc_send_recv_completion(device,
90+ netvsc_send_recv_completion(device, net_device,
91 vmxferpage_packet->d.trans_id,
92 NVSP_STAT_FAIL);
93
94@@ -825,11 +820,13 @@ static void netvsc_channel_cb(void *context)
95 desc = (struct vmpacket_descriptor *)buffer;
96 switch (desc->type) {
97 case VM_PKT_COMP:
98- netvsc_send_completion(device, desc);
99+ netvsc_send_completion(net_device,
100+ device, desc);
101 break;
102
103 case VM_PKT_DATA_USING_XFER_PAGES:
104- netvsc_receive(device, desc);
105+ netvsc_receive(net_device,
106+ device, desc);
107 break;
108
109 default:
110--
1112.4.3
112