Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp614735pxk; Wed, 23 Sep 2020 11:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyq6sitMWNEnoDrCX2Z48z56xyno3Tje7h8zq9WzoNs4FrwGhASkWTIyRZGvq6S0vCmd1c X-Received: by 2002:a50:bf47:: with SMTP id g7mr685320edk.26.1600885152313; Wed, 23 Sep 2020 11:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600885152; cv=none; d=google.com; s=arc-20160816; b=hUS6RcTwLf53SN+JZyjn3cpKm0d3w3N/zNnj79E714cUOP/Q0Hge9a73Ew534HSl+f cG0W10Oaf/a8yK2XmTUFEZJ9vtw+sTEopSHiqhAEpy/QuhmlV4nPINBjEbifOGbkTabL 9UueoLoizG09TYrRbImZQjYOk/cEZkTX4SId49AkNs+YXT7BIglT496F7ThXDhNTccBp RBZBu/5Sz/ydreldX5qrnCdyU9WbzWnEOjFJONx8eD7qoepBbkhDvGpFyECd3dpnw44t TlE3mopb+JxzTihrkgroK9ZeXu3o4jYbU91qTPPWBKlwksjdmkyuQEzKc3yJUusBzwef 75Jw== 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=6VBjsMo44nBEzcbomAkY1iDbxWkCmiCxCVDrlCHo4bI=; b=mBkP3Hi/ErdljasUp0VZT3hQY6+jM4VdydM+/8jbItj673EmSwtDljPdyC4DnvXTOQ wbv5DAlKdcdECSSuLvz3S7d4kcrIqEmYKaWdQ56h64Y4htE8jIP9g1MfvM9T73TKbWQK ZVxuV2iEL6MZ+7BdtLk9PUNwynFnkTElrbQEqGx8PN3vdgzQVVtIN63sX3Nzew0RhJ0R JlnsLRK7hQ4i6dVPed415i6KPgOuNxcPMPISrW80/ZEFanSLS50tQmewfJK38d72nmd6 Crqta8K2Rfq6poCqdxNL/UjTin8ZpC1ZxBX5fu+vZXeutjONAmqD2/EzUifbp/NAR4Hs 9iWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KqyzICB6; 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 q7si443288ejd.647.2020.09.23.11.18.47; Wed, 23 Sep 2020 11:19:12 -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=KqyzICB6; 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 S1726662AbgIWSRp (ORCPT + 99 others); Wed, 23 Sep 2020 14:17:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28379 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgIWSRm (ORCPT ); Wed, 23 Sep 2020 14:17:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600885061; 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=6VBjsMo44nBEzcbomAkY1iDbxWkCmiCxCVDrlCHo4bI=; b=KqyzICB6CQALBbcC6DR1wRB5DzTzKv0gV7lRjAT5a/JdmflWyM9PQw9t8evjWviNEExS/l gKSCU9tLZWFUQkDuvqoi3tAmabqxRgKY41CcSEkXCsgXLW0QoEnagxLZl2CvxFH4gMORgi KA/PptFYvRppiPT+rMgVLH/pYiHJzmM= 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-354-JtQTr2bZPVidisWtiOzHBQ-1; Wed, 23 Sep 2020 14:17:39 -0400 X-MC-Unique: JtQTr2bZPVidisWtiOzHBQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B57FB64088; Wed, 23 Sep 2020 18:17:36 +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 E051C5C1C7; Wed, 23 Sep 2020 18:17:34 +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, jerinj@marvell.com, mathias.nyman@intel.com, jiri@nvidia.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Subject: [PATCH v2 3/4] i40e: limit msix vectors based on housekeeping CPUs Date: Wed, 23 Sep 2020 14:11:25 -0400 Message-Id: <20200923181126.223766-4-nitesh@redhat.com> In-Reply-To: <20200923181126.223766-1-nitesh@redhat.com> References: <20200923181126.223766-1-nitesh@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a realtime environment, it is essential to isolate unwanted IRQs from isolated CPUs to prevent latency overheads. Creating MSIX vectors only based on the online CPUs could lead to a potential issue on an RT setup that has several isolated CPUs but a very few housekeeping CPUs. This is because in these kinds of setups an attempt to move the IRQs to the limited housekeeping CPUs from isolated CPUs might fail due to the per CPU vector limit. This could eventually result in latency spikes because of the IRQs that we fail to move from isolated CPUs. This patch prevents i40e to create vectors only based on online CPUs by using hk_num_online_cpus() instead. 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..fcb6fa3707e0 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 = hk_num_online_cpus(); pf->num_lan_msix = min_t(int, cpus, vectors_left / 2); vectors_left -= pf->num_lan_msix; -- 2.18.2