Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1916221imm; Thu, 24 May 2018 02:53:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruDnscQ/TkcDrqwGpn8WND5sLnQZnrR8sJhCnCkR4BZzzNQwljNXYa3kyLF+OpYx3mkWFt X-Received: by 2002:a63:91c8:: with SMTP id l191-v6mr3796974pge.53.1527155605894; Thu, 24 May 2018 02:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155605; cv=none; d=google.com; s=arc-20160816; b=k2EBjG4uOC6XdCmtV8fEbNCFo91Hb7U7JP+0d/fZVYS7ijRSmt1YhATOQwQedu4ze/ XOUxz6xTeR5yM98D3uGe/B/QliQSAPxMpr04AwZzi2IIP8KFiwSoPWdekHG1u452v+ky zXktsPt6mu9b8sYEwjnJDllSZONZfX4aS/ttNdspNqxj0EYKfjhw+R61c00i2i0/uS6v LOwtQMHpJcC4e5wsYAcgx2qO2MeCVF/dBrTCf0jgl3tW1VSZrTJ4xseDXE3DLh3gs5QJ wmYyPizfZpRH8wZ5tAc8wS7QbNhrdmQUHimHphG8seQ7IfGYihV+dCfqreAixdEer8HV zZZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=F2I0tiLSuw+ce+zW8wahDtdr1Eqf8yrUrO4prj34rZU=; b=CQNNYInEYcaY5oniiGx1sWWliriTuygBlTzV4QueNFxGm8XmTlRVtc83tmYr+/n+2q IFTowNxaU570YZjJ++3Uy/w/phoR4ovV8YnEGCKF5R84bvhdN77MZh2G3nZZAZtSiO5t c1t0HGWv8NkGtT4wHQP+jpZXoXRJ4ZpjJDfNgace4uWEcbfRo11UQj5IZMTJs7UZmo6V NeM+t5oD0jxNPPxizp5HEIalvV9Wgz8hHuuqZRH5R7yqAH9PnPzQ4NL7KfCxOtrfcnzg FTAwkamEd5ydoyiAdP0Kz0F+EulhCcndg+1X4ACAm5LvPBYb81jaFV8lIT/YJMuMvbSc QCCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RKK1SEaL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f88-v6si20821069pfk.107.2018.05.24.02.53.11; Thu, 24 May 2018 02:53:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RKK1SEaL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967828AbeEXJwK (ORCPT + 99 others); Thu, 24 May 2018 05:52:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:48820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967380AbeEXJwD (ORCPT ); Thu, 24 May 2018 05:52:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3450B20847; Thu, 24 May 2018 09:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155522; bh=GL8UHcTrdKWQ0VvXBm6g9oZpVBTJTF7giH8YSD02RAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKK1SEaLzLbqy5LHhXhG4imyGB/IJhq1k83v4fqVbJH2VPbqtXWxeyEW8EFJCi5Kl P/NDC5cGiRqvlp1i9tG8LEvN7h3U25oSeW/uJ1l89RgAcgFe0aGi4vrBJNAO+ZXsrz E1DoSG5aTuQVAZNOKD1elXl+uaFo3Voo2PRLV/N0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haiyang Zhang , "David S. Miller" Subject: [PATCH 4.14 020/165] hv_netvsc: Use the num_online_cpus() for channel limit Date: Thu, 24 May 2018 11:37:06 +0200 Message-Id: <20180524093622.799862232@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/rndis_filter.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -1221,7 +1221,6 @@ struct netvsc_device *rndis_filter_devic 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_devic 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);