From patchwork Fri Jan 19 20:35:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haiyang Zhang X-Patchwork-Id: 863799 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=microsoft.com header.i=@microsoft.com header.b="Wq5QKbFB"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zNXds0XPyz9s4s for ; Sat, 20 Jan 2018 07:35:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756311AbeASUfm (ORCPT ); Fri, 19 Jan 2018 15:35:42 -0500 Received: from mail-cys01nam02on0128.outbound.protection.outlook.com ([104.47.37.128]:45289 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756027AbeASUfh (ORCPT ); Fri, 19 Jan 2018 15:35:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BgABwCMEouHAxm7+ssfp5GNALiSzChKjNaf63lwh2jA=; b=Wq5QKbFBYf0fQSEzxSIT/v4+V1putVub1wz0JF431leHSV9+1fQ+rzg26u71mcfeaH2+gGwQEN3YUxGdBO2Zw9kFLjwieyf0V7HxAIkpzv1+PISpC3I4CO2wzhPzN46/t7lmX89Rk+QbhmPiDU/sH7f0f+7c9CkKKvJ+s84pF7Q= Received: from CY4PR2101MB0867.namprd21.prod.outlook.com (52.132.102.138) by CY4PR2101MB0801.namprd21.prod.outlook.com (52.132.99.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.464.0; Fri, 19 Jan 2018 20:35:35 +0000 Received: from CY4PR2101MB0867.namprd21.prod.outlook.com ([fe80::a11d:a968:27a4:53d9]) by CY4PR2101MB0867.namprd21.prod.outlook.com ([fe80::a11d:a968:27a4:53d9%4]) with mapi id 15.20.0444.004; Fri, 19 Jan 2018 20:35:35 +0000 From: Haiyang Zhang To: "davem@davemloft.net" , "netdev@vger.kernel.org" CC: Haiyang Zhang , KY Srinivasan , Stephen Hemminger , "olaf@aepfle.de" , "vkuznets@redhat.com" , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH net-next] hv_netvsc: Use the num_online_cpus() for channel limit Thread-Topic: [PATCH net-next] hv_netvsc: Use the num_online_cpus() for channel limit Thread-Index: AQHTkWP7SkbboKHX70CpXMfbFZ56Y6N7pmHw Date: Fri, 19 Jan 2018 20:35:35 +0000 Message-ID: References: <20180119202643.30942-1-haiyangz@exchange.microsoft.com> In-Reply-To: <20180119202643.30942-1-haiyangz@exchange.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=haiyangz@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-01-19T20:35:34.1647938Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [69.130.166.81] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR2101MB0801; 6:AmM5qm9QgQvmXrf9qU+2QLta7mAYdyzaJU6kQW6bVpJ8pI7x9YSBAQmHm1kFcKVuR/TFKqee1Jw+Nnuzc8qe/SpnxiES8n3xf6bPL4Fs3SGuaitFiHUZhL+JuMj+htVaX+blwcSAw23xMO/4PJhj8Om96fzEYJXNrYeneb7ClFSM4ryIgPPLjvvvgHLTHzDbrBR7NQJUI+9H6++/sqtaGtAROYl7SwsW3A3W6iiu+Q1zHYZ3x7g57GkwehiteTFmzaAJSgFazqQMZjrKatitZCCMuQ5SQN3zRvy+3qYmZAqXf+T1o/Ido4hTgzbGoA16CuZcBwSuPmtSvxHmVoFgm6fgHcJj5QkRplkAr4XPoRgSGWYMK5khlLFvQmE96saO; 5:AC7oQ/nGWC5HOX56xoKd8NJyVG2S874GQ/btPt8rvGyMBSVLhiq+zkcZtR4WAfZuNGIBSPdEZTJKLmr73qDu/fFKNsWvsAaowSqcDkNjc+82pBadctq5oQPXFCpk0BxhR8bfL5p2R/Px5/xWS/FFUGp24Ucwhm5+NaCFvjY7xOc=; 24:LD9j+lboYkjJ4Nsjtt7g1FfsRrjmmDu6wYsYdtjDcC4a8sa5hL5cyTwQ7DiiyQ+Da0w2Z/cNLfDPf4lnKSUXo8cp+MMKJzyZ4n9obyakYhU=; 7:Wgy4FNOd9Se9tG/ncATYtUF+6DFnXLQ+kP1GDW/bWo8Zjp0A+0tJJJ4jwchHkDC+xwR1P1k3qBsppATiw3dvNp1djhTgKnhabbnj5EUK55oejmPQZgN1ERx0ZUdQ58iKrjSfx6uPsFOtYTUqH+YJfSI+ulPV7u7E7VC2X8ZCr8ba+EsoBtqve6mwTu2ceIQjaLEMycl6CGOuVsY/8ouQ+UvI2dZIt6n+OrCWj0bgv3llhgj78IJkAcf57SQ4NRJX x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-correlation-id: 2c78c334-63fa-49da-4d6a-08d55f7c31c3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7193020); SRVR:CY4PR2101MB0801; x-ms-traffictypediagnostic: CY4PR2101MB0801: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040498)(2401047)(5005006)(8121501046)(3231046)(2400081)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041285)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR2101MB0801; BCL:0; PCL:0; RULEID:(100000803126)(100110400120); SRVR:CY4PR2101MB0801; x-forefront-prvs: 0557CBAD84 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(39380400002)(396003)(346002)(366004)(39860400002)(199004)(189003)(106356001)(8990500004)(105586002)(25786009)(86362001)(4326008)(81166006)(5660300001)(102836004)(81156014)(3846002)(6116002)(22452003)(5250100002)(6346003)(2501003)(8676002)(99286004)(54906003)(305945005)(110136005)(316002)(2900100001)(7736002)(74316002)(10090500001)(3660700001)(3280700002)(9686003)(55016002)(478600001)(53936002)(68736007)(86612001)(8936002)(2950100002)(6436002)(76176011)(66066001)(33656002)(7696005)(59450400001)(14454004)(2906002)(6506007)(26005)(97736004)(10290500003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR2101MB0801; H:CY4PR2101MB0867.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=haiyangz@microsoft.com; x-microsoft-antispam-message-info: MB7uyqNiBlp/3z1Hk8L4yzl6oRcKJo9QuQsfADNGyQQinTM0/VEOJ0Z3YSPJY7UYuALhvM3/P9xcHWNjJoQ/ng== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c78c334-63fa-49da-4d6a-08d55f7c31c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2018 20:35:35.7328 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR2101MB0801 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Haiyang Zhang 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 --- drivers/net/hyperv/rndis_filter.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) -- 2.15.1 diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 91a67c5297f7..c3ca191fea7f 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);