From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D74BC4360F for ; Thu, 4 Apr 2019 21:58:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30F0B20663 for ; Thu, 4 Apr 2019 21:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729697AbfDDV6d (ORCPT ); Thu, 4 Apr 2019 17:58:33 -0400 Received: from mga17.intel.com ([192.55.52.151]:57974 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728663AbfDDV6c (ORCPT ); Thu, 4 Apr 2019 17:58:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2019 14:58:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,309,1549958400"; d="scan'208";a="333901080" Received: from ellie.jf.intel.com ([10.54.70.67]) by fmsmga006.fm.intel.com with ESMTP; 04 Apr 2019 14:58:32 -0700 From: Vinicius Costa Gomes To: intel-wired-lan@lists.osuosl.org Cc: Vinicius Costa Gomes , jeffrey.t.kirsher@intel.com, netdev@vger.kernel.org, Bhagath Singh Karunakaran Subject: [next-queue PATCH v1] igb: Fix limiting the number of queues to number of cpus Date: Thu, 4 Apr 2019 14:56:32 -0700 Message-Id: <20190404215632.9881-1-vinicius.gomes@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We have seen some reports[1] of users complaining that they aren't able to use some queues when their machines have less than 4 cpus. This affects some TSN workloads, as different traffic classes are assigned different queues. The current behavior limits the number of traffic classes that can be reliably handled. In practice, what is not working, it returns an invalid parameter error, in hosts with less than 4 cpus is something like this: $ tc qdisc replace dev IFACE parent root mqprio \ num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ queues 1@0 1@1 2@2 hw 0 Because changing the default logic of the allocation of queues could bring other effects, we propose adding a module parameter so expert users may override that decision. [1] https://github.com/jeez/iproute2/issues/1 Reported-by: Bhagath Singh Karunakaran Signed-off-by: Vinicius Costa Gomes --- A similar fix should also be needed for igc, even if I don't have the hardware to test, I can produce a patch, if others are able to test. I am not totally sure that using a module parameter is the best solution, so, suggestions are welcome. drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 32d61d5a2706..87072d47c305 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -247,6 +247,10 @@ static int debug = -1; module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); +static unsigned int num_queues; +module_param(num_queues, uint, 0); +MODULE_PARM_DESC(num_queues, "Allocate at maximum this number of queues (0=num_cpus(), default)"); + struct igb_reg_info { u32 ofs; char *name; @@ -3763,7 +3767,13 @@ static void igb_init_queue_configuration(struct igb_adapter *adapter) u32 max_rss_queues; max_rss_queues = igb_get_max_rss_queues(adapter); - adapter->rss_queues = min_t(u32, max_rss_queues, num_online_cpus()); + + if (num_queues > 0) + adapter->rss_queues = min_t(u32, max_rss_queues, + num_queues); + else + adapter->rss_queues = min_t(u32, max_rss_queues, + num_online_cpus()); igb_set_flag_queue_pairs(adapter, max_rss_queues); } -- 2.21.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinicius Costa Gomes Date: Thu, 4 Apr 2019 14:56:32 -0700 Subject: [Intel-wired-lan] [next-queue PATCH v1] igb: Fix limiting the number of queues to number of cpus Message-ID: <20190404215632.9881-1-vinicius.gomes@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: We have seen some reports[1] of users complaining that they aren't able to use some queues when their machines have less than 4 cpus. This affects some TSN workloads, as different traffic classes are assigned different queues. The current behavior limits the number of traffic classes that can be reliably handled. In practice, what is not working, it returns an invalid parameter error, in hosts with less than 4 cpus is something like this: $ tc qdisc replace dev IFACE parent root mqprio \ num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \ queues 1 at 0 1 at 1 2 at 2 hw 0 Because changing the default logic of the allocation of queues could bring other effects, we propose adding a module parameter so expert users may override that decision. [1] https://github.com/jeez/iproute2/issues/1 Reported-by: Bhagath Singh Karunakaran Signed-off-by: Vinicius Costa Gomes --- A similar fix should also be needed for igc, even if I don't have the hardware to test, I can produce a patch, if others are able to test. I am not totally sure that using a module parameter is the best solution, so, suggestions are welcome. drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 32d61d5a2706..87072d47c305 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -247,6 +247,10 @@ static int debug = -1; module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); +static unsigned int num_queues; +module_param(num_queues, uint, 0); +MODULE_PARM_DESC(num_queues, "Allocate at maximum this number of queues (0=num_cpus(), default)"); + struct igb_reg_info { u32 ofs; char *name; @@ -3763,7 +3767,13 @@ static void igb_init_queue_configuration(struct igb_adapter *adapter) u32 max_rss_queues; max_rss_queues = igb_get_max_rss_queues(adapter); - adapter->rss_queues = min_t(u32, max_rss_queues, num_online_cpus()); + + if (num_queues > 0) + adapter->rss_queues = min_t(u32, max_rss_queues, + num_queues); + else + adapter->rss_queues = min_t(u32, max_rss_queues, + num_online_cpus()); igb_set_flag_queue_pairs(adapter, max_rss_queues); } -- 2.21.0