[OpenWrt-Devel] [patch] [x86] Backport hyperv change the receive buffer size for legacy hosts to 3.14 tree

Ning Ye ning at oaklight.us
Mon Jan 26 11:16:10 EST 2015


Signed-off-by: Ning Ye <ning at oaklight.us>
commit 3a3021bfa90d0fbc0b49e84983d02036591f517c
Author: Ning Ye <ning at oaklight.us>
Date:   Sun Jan 25 21:50:38 2015 -0500

    Backport hyperv change the receive buffer size for legacy hosts to 3.14
tree.  Without this patch, linux 3.14 wouldn't recognize NIC cards in
Windows 2008 R2.  Linux 3.15 and up has already had this patch in the
upstream.

diff --git
a/target/linux/x86/patches-3.14/700-hyperv-buffer_size_for_legacy_hosts.patc
h
b/target/linux/x86/patches-3.14/700-hyperv-buffer_size_for_legacy_hosts.patc
h
new file mode 100755
index 0000000..ff369cc
--- /dev/null
+++
b/target/linux/x86/patches-3.14/700-hyperv-buffer_size_for_legacy_hosts.patc
h
@@ -0,0 +1,47 @@
+From 99d3016de4f2a29635f5382b0e9bd0e5f2151487 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz at microsoft.com>
+Date: Sun, 9 Mar 2014 16:10:59 -0700
+Subject: hyperv: Change the receive buffer size for legacy hosts
+
+Due to a bug in the Hyper-V host verion 2008R2, we need to use a slightly
smaller
+receive buffer size, otherwise the buffer will not be accepted by the
legacy hosts.
+
+Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+
+diff --git a/drivers/net/hyperv/hyperv_net.h
b/drivers/net/hyperv/hyperv_net.h
+index 7d06b49..13010b4 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -513,6 +513,7 @@ struct nvsp_message {
+ #define NETVSC_MTU 65536
+
+ #define NETVSC_RECEIVE_BUFFER_SIZE            (1024*1024*16)  /* 16MB */
++#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY     (1024*1024*15)  /* 15MB */
+
+ #define NETVSC_RECEIVE_BUFFER_ID              0xcafe
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index 1a0280d..daddea2 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -365,6 +365,11 @@ static int netvsc_connect_vsp(struct hv_device
*device)
+               goto cleanup;
+
+       /* Post the big receive buffer to NetVSP */
++      if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_2)
++              net_device->recv_buf_size =
NETVSC_RECEIVE_BUFFER_SIZE_LEGACY;
++      else
++              net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
++
+       ret = netvsc_init_recv_buf(device);
+
+ cleanup:
+@@ -898,7 +903,6 @@ int netvsc_device_add(struct hv_device *device, void
*additional_info)
+       ndev = net_device->ndev;
+
+       /* Initialize the NetVSC channel extension */
+-      net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
+       spin_lock_init(&net_device->recv_pkt_list_lock);
+
+       INIT_LIST_HEAD(&net_device->recv_pkt_list);
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list