]>
Commit | Line | Data |
---|---|---|
a7b0967d | 1 | From 56b3f72d3fed7f9b8d17dcf5d81455fa1b4327d7 Mon Sep 17 00:00:00 2001 |
5b3bd19f AF |
2 | From: Haiyang Zhang <haiyangz@microsoft.com> |
3 | Date: Sun, 9 Mar 2014 16:10:59 -0700 | |
a7b0967d | 4 | Subject: [PATCH 11/25] hyperv: Change the receive buffer size for legacy hosts |
5b3bd19f AF |
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> | |
a7b0967d MT |
11 | --- |
12 | drivers/net/hyperv/hyperv_net.h | 1 + | |
13 | drivers/net/hyperv/netvsc.c | 6 +++++- | |
14 | 2 files changed, 6 insertions(+), 1 deletion(-) | |
5b3bd19f AF |
15 | |
16 | diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h | |
a7b0967d | 17 | index 7d06b4959383..13010b4dae5b 100644 |
5b3bd19f AF |
18 | --- a/drivers/net/hyperv/hyperv_net.h |
19 | +++ b/drivers/net/hyperv/hyperv_net.h | |
20 | @@ -513,6 +513,7 @@ struct nvsp_message { | |
21 | #define NETVSC_MTU 65536 | |
22 | ||
23 | #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16) /* 16MB */ | |
24 | +#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY (1024*1024*15) /* 15MB */ | |
25 | ||
26 | #define NETVSC_RECEIVE_BUFFER_ID 0xcafe | |
27 | ||
28 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c | |
a7b0967d | 29 | index 1a0280dcba7e..daddea2654ce 100644 |
5b3bd19f AF |
30 | --- a/drivers/net/hyperv/netvsc.c |
31 | +++ b/drivers/net/hyperv/netvsc.c | |
32 | @@ -365,6 +365,11 @@ static int netvsc_connect_vsp(struct hv_device *device) | |
33 | goto cleanup; | |
34 | ||
35 | /* Post the big receive buffer to NetVSP */ | |
36 | + if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_2) | |
37 | + net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; | |
38 | + else | |
39 | + net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; | |
40 | + | |
41 | ret = netvsc_init_recv_buf(device); | |
42 | ||
43 | cleanup: | |
44 | @@ -898,7 +903,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) | |
45 | ndev = net_device->ndev; | |
46 | ||
47 | /* Initialize the NetVSC channel extension */ | |
48 | - net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; | |
49 | spin_lock_init(&net_device->recv_pkt_list_lock); | |
50 | ||
51 | INIT_LIST_HEAD(&net_device->recv_pkt_list); | |
52 | -- | |
a7b0967d | 53 | 2.4.3 |
5b3bd19f | 54 |