Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp483582pxk; Wed, 9 Sep 2020 10:18:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQo3bd8lV15fmTG2oFa/V/94AVERtr+bQxwpFCgA1N0yrSNB3ojI/6Z6iCfGJlieG5bHS+ X-Received: by 2002:a17:906:8258:: with SMTP id f24mr4452760ejx.551.1599671927665; Wed, 09 Sep 2020 10:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599671927; cv=none; d=google.com; s=arc-20160816; b=L2NFadPwvvisI2XmECSdZLGApGjp7tx0FzA4ACoWYWzCG6Gn+NU7ekEo2UROd4jUoh p6N0Twtx//ShrTTLWU2PIzICh47d0hVMUDdzyTtuDu421XRPm6xs7kW77sFZ/GpFz1wY uSYSLBimyN+WByWPZEYkJ/cHvKmlaYShwCVtxJAHL0dRkYYk/522GQz6bG2Bt04fYz8M mr1AGvtRm0UjUsnKp4bU3zQHxJm0NzX1bnsUNzUN01r2ieerz4UGFGhFEV/FKRBXpAfy NU3+7Qee7Y+DKw78Z8aOL3MrQyNP7a8Q8pT1psyI0kokMhmU5rrbdw3B+7UIz4GGvza+ IYxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=WiK+CLNHCkGtArM+EWzVkhYFO4V34cQn5Dk8gnAgqYI=; b=oZIEgvEXHIjxrw0aEEbk9v69IWpGC06d8T25Fu/46/6JLKZINSWeEadwUjCZWu6PHa MVCrHOtBc5yej83fsxgAWFGLjcyqBZt1qTVcGhoLNZq4cEMtWJCdY0DhLmp1FYGM4TWA foRHnmHQ4cYShyTb+a1gqoNY+YDKF76/KvkcxVbCUBgj4u7arqDG6uE00962sDtJBo5E u63rch5vuJzsmVEk5Swa5psPANFXw0bDiHxHCVaRAEY4YRPy5+8kmSnOtyrQ4oGIlT22 +gMMarMgpajGfJt7H+xI3Ax17UvUrntck9cmFhttptDMZQlOV0XacR8lmamzhRTYFsT/ B2zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="JbR6/g1f"; 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 h9si2002795edv.170.2020.09.09.10.18.24; Wed, 09 Sep 2020 10:18:47 -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="JbR6/g1f"; 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 S1730547AbgIIRRd (ORCPT + 99 others); Wed, 9 Sep 2020 13:17:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:25869 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730150AbgIIP2A (ORCPT ); Wed, 9 Sep 2020 11:28:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599665244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WiK+CLNHCkGtArM+EWzVkhYFO4V34cQn5Dk8gnAgqYI=; b=JbR6/g1fMBYV9guWPu7wh0TG7ODY66R4TBMd/PRPJpBkqvBxgr+YxSUJd8oC75tqlrvayU WoVCJGAJBCmRxJwaPOu1eg3LVejxU/GQM6umIxIazftZfqR4tAmSygZ/ZjkEhSHb5F57r8 GqqNo4Bqp5U4pl7Z7SxWeX0FrcVsy7M= 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-22-InbDKSgzP6WcdO2Nor3JbQ-1; Wed, 09 Sep 2020 11:09:10 -0400 X-MC-Unique: InbDKSgzP6WcdO2Nor3JbQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 323CB8015A5; Wed, 9 Sep 2020 15:09:06 +0000 (UTC) Received: from wsfd-advnetlab06.anl.lab.eng.bos.redhat.com (wsfd-advnetlab06.anl.lab.eng.bos.redhat.com [10.19.107.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id B667119C4F; Wed, 9 Sep 2020 15:09:04 +0000 (UTC) From: Nitesh Narayan Lal To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, frederic@kernel.org, mtosatti@redhat.com, sassmann@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 Subject: [RFC][Patch v1 2/3] i40e: limit msix vectors based on housekeeping CPUs Date: Wed, 9 Sep 2020 11:08:17 -0400 Message-Id: <20200909150818.313699-3-nitesh@redhat.com> In-Reply-To: <20200909150818.313699-1-nitesh@redhat.com> References: <20200909150818.313699-1-nitesh@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org 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 IRQ threads that we fail to move from isolated CPUs. This patch prevents i40e to add vectors only based on available housekeeping CPUs by using num_housekeeping_cpus(). Signed-off-by: Nitesh Narayan Lal --- 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..3b4cd4b3de85 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 = num_housekeeping_cpus(); pf->num_lan_msix = min_t(int, cpus, vectors_left / 2); vectors_left -= pf->num_lan_msix; -- 2.27.0