Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1317431pxk; Fri, 25 Sep 2020 11:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1Fbut2cYBzoz0DcpjSDx8yszrcUWbAyYKMY+azQDeydYDiOXEgPsatq24Jii/1+2nktAu X-Received: by 2002:aa7:d5d2:: with SMTP id d18mr2683407eds.115.1601058523320; Fri, 25 Sep 2020 11:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601058523; cv=none; d=google.com; s=arc-20160816; b=vzUPBsAYDLw3LBfONkrw5Ba5mAFwH5DArh06Zbgk+30jo4uFVs8bDMDV2B1+gwypNB oToTRcllVCjniMEYMR/QpzPSxNnlulNPryc82aaZam+s4Joa7pxArZaUAd7yRxky9aWe dWG1S28d7+l99+W6q0WS1u1lrffA/VUAdOCkN0BGdAZGMKhzAs3xamcbXwrZkkd174jZ GH3qqWb5lm6UTb15ohlVsBj9HSb0CTgHegof84hCxJXq3+46dERmBqFPquBL2QOSZhGO 2/G2Nq+Ap5a0QJwRlS/AkVfUJDrXLkbvDRca5rCgn7ex8aoPizoxiqrH5WgQGpH3Uwoo nAPQ== 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=oF4r19/4Oub59izv7RBcKPYOR6SY31/dJoOyQdeWw/yvJHVYHdq/NU7u8CMja/lhND SzWN9HLuCHDBvsHDXksfzBrVTxZi8+a7m06BlGGH4RQJr2LMR6E0+pPo5WoEIFoR1xtu jupICD2Ra/3cDj4cYT1hCoUufCLK+nvspB78q2aUlMjwGDSJPuRrEEnHYx7Ypoc1A6uB 3UDKK598BI+gMR35PqNeD1oESECaFJe/NnJBJEb1RdAXKxGC5iWLTSWC+c1nxe2SX2kl M5yWsyzhl7y6YT3IBmHRbhI7L1mEa4MaJLd6t0UZzFtFhaUKIFEKrvM5VeLfqpD/dzLA iVWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Af/VqgtU"; 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 v23si2419650ejf.312.2020.09.25.11.28.20; Fri, 25 Sep 2020 11:28:43 -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="Af/VqgtU"; 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 S1729772AbgIYS1T (ORCPT + 99 others); Fri, 25 Sep 2020 14:27:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38211 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbgIYS1Q (ORCPT ); Fri, 25 Sep 2020 14:27:16 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601058435; 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=Af/VqgtUERVxYAEKyPKEVkh9CEGDJdPugaT62GaNlTDbzFb99xRcleCDF5iKcvQC+YOeOM gq7YIyknkSC9gZvyIlA3qlL6Z51RWXHd/YxNCrdMS9ozPx+TdwIvECmokGH+jdfHKwsIC1 OZh5KqmocuYANo7BuM5cSvgjxNS8qe4= 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-501-deZDjWaiMCqrv1ZQexTisA-1; Fri, 25 Sep 2020 14:27:12 -0400 X-MC-Unique: deZDjWaiMCqrv1ZQexTisA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0216D1007474; Fri, 25 Sep 2020 18:27:09 +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 4FE1078810; Fri, 25 Sep 2020 18:27:07 +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 v3 3/4] i40e: Limit msix vectors to housekeeping CPUs Date: Fri, 25 Sep 2020 14:26:53 -0400 Message-Id: <20200925182654.224004-4-nitesh@redhat.com> In-Reply-To: <20200925182654.224004-1-nitesh@redhat.com> References: <20200925182654.224004-1-nitesh@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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