From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH net-stable 09/24] hv_netvsc: Use the num_online_cpus() for channel limit Date: Mon, 14 May 2018 15:32:08 -0700 Message-ID: <20180514223223.25433-10-sthemmin@microsoft.com> References: <20180514223223.25433-1-sthemmin@microsoft.com> Cc: netdev@vger.kernel.org, Haiyang Zhang To: davem@davemloft.net Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:41697 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbeENWco (ORCPT ); Mon, 14 May 2018 18:32:44 -0400 Received: by mail-pf0-f194.google.com with SMTP id v63-v6so6682795pfk.8 for ; Mon, 14 May 2018 15:32:44 -0700 (PDT) In-Reply-To: <20180514223223.25433-1-sthemmin@microsoft.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Haiyang Zhang commit 25a39f7f975c3c26a0052fbf9b59201c06744332 upstream Since we no longer localize channel/CPU affiliation within one NUMA node, num_online_cpus() is used as the number of channel cap, instead of the number of processors in a NUMA node. This patch allows a bigger range for tuning the number of channels. Signed-off-by: Haiyang Zhang Signed-off-by: David S. Miller --- drivers/net/hyperv/rndis_filter.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 0c99d9926085..05109ed5377c 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -1221,7 +1221,6 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, struct ndis_recv_scale_cap rsscap; u32 rsscap_size = sizeof(struct ndis_recv_scale_cap); u32 mtu, size; - const struct cpumask *node_cpu_mask; u32 num_possible_rss_qs; int i, ret; @@ -1290,14 +1289,8 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, if (ret || rsscap.num_recv_que < 2) goto out; - /* - * We will limit the VRSS channels to the number CPUs in the NUMA node - * the primary channel is currently bound to. - * - * This also guarantees that num_possible_rss_qs <= num_online_cpus - */ - node_cpu_mask = cpumask_of_node(cpu_to_node(dev->channel->target_cpu)); - num_possible_rss_qs = min_t(u32, cpumask_weight(node_cpu_mask), + /* This guarantees that num_possible_rss_qs <= num_online_cpus */ + num_possible_rss_qs = min_t(u32, num_online_cpus(), rsscap.num_recv_que); net_device->max_chn = min_t(u32, VRSS_CHANNEL_MAX, num_possible_rss_qs); -- 2.17.0