Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725351 > unrolled thread

[PATCH net-next, 3/4] hv_netvsc: Simplify the limit check in netvsc_set_channels()

Started byHaiyang Zhang <haiyangz@exchange.microsoft.com>
First post2017-09-01 23:40 +0200
Last post2017-09-01 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next, 3/4] hv_netvsc: Simplify the limit check in netvsc_set_channels() Haiyang Zhang <haiyangz@exchange.microsoft.com> - 2017-09-01 23:40 +0200

#1725351 — [PATCH net-next, 3/4] hv_netvsc: Simplify the limit check in netvsc_set_channels()

FromHaiyang Zhang <haiyangz@exchange.microsoft.com>
Date2017-09-01 23:40 +0200
Subject[PATCH net-next, 3/4] hv_netvsc: Simplify the limit check in netvsc_set_channels()
Message-ID<ul1Pr-2fo-3@gated-at.bofh.it>
From: Haiyang Zhang <haiyangz@microsoft.com>

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>
---
 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
index b8e23e257f00..718d126108f6 100644
--- 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;
 
-- 
2.14.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web