Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:29 +0200
commit98621aae96869e74e424e31699dd56f682dc0e54 (patch)
tree8ffe84c5d5838e22767916a48a0cb19c305d72c8
parent3cf46ece6a3553db462019daaa81b6b598ef5bf5 (diff)
hv_netvsc: Simplify the limit check in netvsc_set_channels()
-rw-r--r--patches.suse/msft-hv-1459-hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1459-hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch b/patches.suse/msft-hv-1459-hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch
new file mode 100644
index 0000000000..67d0c1466e
--- /dev/null
+++ b/patches.suse/msft-hv-1459-hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch
@@ -0,0 +1,39 @@
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Fri, 1 Sep 2017 14:30:06 -0700
+Patch-mainline: v4.14-rc1
+Subject: hv_netvsc: Simplify the limit check in netvsc_set_channels()
+Git-commit: 06be580ac7b650938cb3f2cf8cd02d73ff96d3e4
+References: fate#323887
+
+Because of the following code, net->num_tx_queues equals to
+VRSS_CHANNEL_MAX, and max_chn is less than or equals to VRSS_CHANNEL_MAX.
+
+netvsc_drv.c:
+alloc_etherdev_mq(sizeof(struct net_device_context),
+ VRSS_CHANNEL_MAX);
+rndis_filter.c:
+net_device->max_chn = min_t(u32, VRSS_CHANNEL_MAX, num_possible_rss_qs);
+
+So this patch removes the unnecessary limit check before comparing
+with "max_chn".
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/net/hyperv/netvsc_drv.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -830,9 +830,6 @@ static int netvsc_set_channels(struct net_device *net,
+ channels->rx_count || channels->tx_count || channels->other_count)
+ return -EINVAL;
+
+- if (count > net->num_tx_queues || count > VRSS_CHANNEL_MAX)
+- return -EINVAL;
+-
+ if (!nvdev || nvdev->destroy)
+ return -ENODEV;
+
diff --git a/series.conf b/series.conf
index ace79fce07..8745cbee57 100644
--- a/series.conf
+++ b/series.conf
@@ -1707,6 +1707,7 @@
patches.suse/msft-hv-1456-netvsc-allow-driver-to-be-removed-even-if-VF-is-pres.patch
patches.suse/msft-hv-1457-hv_netvsc-Clean-up-an-unused-parameter-in-rndis_filt.patch
patches.suse/msft-hv-1458-hv_netvsc-Simplify-num_chn-checking-in-rndis_filter_.patch
+ patches.suse/msft-hv-1459-hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch
patches.suse/suse-hv-guest-os-id.patch
patches.suse/suse-hv-kvp_on_msg.dbg.patch