Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3229548pxk; Mon, 28 Sep 2020 11:38:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya1o4XBJY56au1FlnOd6cQPMV0fBrdzhhIO2t4P13rNGmgGIOQs+yWqMtd0kAV3GWm74Hq X-Received: by 2002:a05:6402:17fc:: with SMTP id t28mr3331723edy.244.1601318339744; Mon, 28 Sep 2020 11:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601318339; cv=none; d=google.com; s=arc-20160816; b=B7Otb8Ljh8pWKo9mGCGYxhuGlBxQCfmhkVzrfHt91XXF+KdSf3P6RtjY+ArUiuEq8l lG/T2LySV1D/Z2w0DGIoDEK1MXNFLlIPK6L7rlHsPDMnrw8aK0XbBMs4BGd+f973j0VH R3Su/93MS5MS1LWfI4Vo306MM9PLS0XYBxin1omq2VZIPz6zKAtsv43mJgsPoBV534IU dWGy4zaorSeRDoYpcozpGjNZB1Ly97nYAmfGvuxr3HlDHmUuBENF7+Yxjzs4iYaVy7S4 Ex4lwtcpFcteGvnfVXFv3sejAYXWT8z0oQ3J/3SJfF1kCDSt3m2Z52zr/dIUSxIfHjht gPVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=qD7K+UDAAPv7p1xhR7GsE6Qr4qBNVKTkChHI2rSdLN0=; b=QPvkVWIdzrGQ7eZIN3OlgGbBWV3uVcodXcKt3Lz80KyzgYsZQek298llm/m/tw1DIp 95c2SwnvOUFQScxm625jNS8B7Gej/XdXWGXJjwpuJHKUkqNacHcOQtK+Wrj1L+lalb8r GLRX5n5oBTijDY9oqkcgJcfNAUDaRLQfzRyoJft4C2UihQE6SijjMHhrQdqX5AQ3kPLi AR1/GG3MqDSIZaCm0qY1t/cjBt7W8avU6RpgNBsO0Akpw3wVdlV5f7MJejr6zjlp5qoo FcKNjK2/2WEYzNmQDaOTHZe79VwjyClbaJsfFPyVZHDlXqbVFPaU832Wn7fFkUSZXwY0 uCfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VK/zGwoc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si1023117ejc.669.2020.09.28.11.38.36; Mon, 28 Sep 2020 11:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VK/zGwoc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbgI1SgT (ORCPT + 99 others); Mon, 28 Sep 2020 14:36:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49669 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgI1SgS (ORCPT ); Mon, 28 Sep 2020 14:36:18 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601318177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=qD7K+UDAAPv7p1xhR7GsE6Qr4qBNVKTkChHI2rSdLN0=; b=VK/zGwocmhLhc8Y+AJnhmaRgBDqQASiqg7nvs3B3fF0VROoU0x3fF53W6h8kZf3sy10ePe 79noGuZaZuVroI5woBAJb99c49nFLOmO66MoQSuUKn5oZn7AtYQaA7yHWpvWIDzQteenw3 9E7cA24Mu9/pZAIoaRUqm7FvOTsvyn8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-UZjJXNY8NjeO5agRzp7SQQ-1; Mon, 28 Sep 2020 14:36:14 -0400 X-MC-Unique: UZjJXNY8NjeO5agRzp7SQQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1AE381CBDD; Mon, 28 Sep 2020 18:36:11 +0000 (UTC) Received: from virtlab719.virt.lab.eng.bos.redhat.com (virtlab719.virt.lab.eng.bos.redhat.com [10.19.153.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 261AE60C11; Mon, 28 Sep 2020 18:36:10 +0000 (UTC) From: Nitesh Narayan Lal To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, intel-wired-lan@lists.osuosl.org, frederic@kernel.org, mtosatti@redhat.com, sassmann@redhat.com, jesse.brandeburg@intel.com, lihong.yang@intel.com, helgaas@kernel.org, nitesh@redhat.com, jeffrey.t.kirsher@intel.com, jacob.e.keller@intel.com, jlelli@redhat.com, hch@infradead.org, bhelgaas@google.com, mike.marciniszyn@intel.com, dennis.dalessandro@intel.com, thomas.lendacky@amd.com, jiri@nvidia.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, lgoncalv@redhat.com Subject: [PATCH v4 3/4] i40e: Limit msix vectors to housekeeping CPUs Date: Mon, 28 Sep 2020 14:35:28 -0400 Message-Id: <20200928183529.471328-4-nitesh@redhat.com> In-Reply-To: <20200928183529.471328-1-nitesh@redhat.com> References: <20200928183529.471328-1-nitesh@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If we have isolated CPUs designated to perform real-time tasks, to keep the latency overhead to a minimum for real-time CPUs IRQ vectors are moved to housekeeping CPUs from the userspace. Creating MSIX vectors only based on the online CPUs could lead to exhaustion of housekeeping CPU IRQ vectors in such environments. This patch prevents i40e to create vectors only based on online CPUs by retrieving the online housekeeping CPUs that are designated to perform managed IRQ jobs. Signed-off-by: Nitesh Narayan Lal Reviewed-by: Marcelo Tosatti Acked-by: Jesse Brandeburg --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 2e433fdbf2c3..370b581cd48c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -5,6 +5,7 @@ #include #include #include +#include #include /* Local includes */ @@ -11002,7 +11003,7 @@ static int i40e_init_msix(struct i40e_pf *pf) * will use any remaining vectors to reach as close as we can to the * number of online CPUs. */ - cpus = num_online_cpus(); + cpus = housekeeping_num_online_cpus(HK_FLAG_MANAGED_IRQ); pf->num_lan_msix = min_t(int, cpus, vectors_left / 2); vectors_left -= pf->num_lan_msix; -- 2.18.2