]>
Commit | Line | Data |
---|---|---|
1 | From 99d3016de4f2a29635f5382b0e9bd0e5f2151487 Mon Sep 17 00:00:00 2001 | |
2 | From: Haiyang Zhang <haiyangz@microsoft.com> | |
3 | Date: Sun, 9 Mar 2014 16:10:59 -0700 | |
4 | Subject: hyperv: Change the receive buffer size for legacy hosts | |
5 | ||
6 | Due to a bug in the Hyper-V host verion 2008R2, we need to use a slightly smaller | |
7 | receive buffer size, otherwise the buffer will not be accepted by the legacy hosts. | |
8 | ||
9 | Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> | |
10 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
11 | ||
12 | diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h | |
13 | index 7d06b49..13010b4 100644 | |
14 | --- a/drivers/net/hyperv/hyperv_net.h | |
15 | +++ b/drivers/net/hyperv/hyperv_net.h | |
16 | @@ -513,6 +513,7 @@ struct nvsp_message { | |
17 | #define NETVSC_MTU 65536 | |
18 | ||
19 | #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */ | |
20 | +#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024*1024*15) /* 15MB */ | |
21 | ||
22 | #define NETVSC_RECEIVE_BUFFER_ID 0xcafe | |
23 | ||
24 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c | |
25 | index 1a0280d..daddea2 100644 | |
26 | --- a/drivers/net/hyperv/netvsc.c | |
27 | +++ b/drivers/net/hyperv/netvsc.c | |
28 | @@ -365,6 +365,11 @@ static int netvsc_connect_vsp(struct hv_device *device) | |
29 | goto cleanup; | |
30 | ||
31 | /* Post the big receive buffer to NetVSP */ | |
32 | + if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_2) | |
33 | + net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; | |
34 | + else | |
35 | + net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; | |
36 | + | |
37 | ret = netvsc_init_recv_buf(device); | |
38 | ||
39 | cleanup: | |
40 | @@ -898,7 +903,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) | |
41 | ndev = net_device->ndev; | |
42 | ||
43 | /* Initialize the NetVSC channel extension */ | |
44 | - net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; | |
45 | spin_lock_init(&net_device->recv_pkt_list_lock); | |
46 | ||
47 | INIT_LIST_HEAD(&net_device->recv_pkt_list); | |
48 | -- | |
49 | cgit v0.10.2 | |
50 |