Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp348951pxk; Fri, 11 Sep 2020 08:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7S+cxu3iswmhy1L4u+vXJDY7UYqCYOkOS/nPwZW3MjsaElQH2mM2UhCsX7gXPD6o98ISp X-Received: by 2002:a17:906:70d4:: with SMTP id g20mr2718662ejk.413.1599838424255; Fri, 11 Sep 2020 08:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599838424; cv=none; d=google.com; s=arc-20160816; b=NFJcOuQArdaXPuBnPWM8dMVKFa6rVb1zQWR/KvLhdzQ7mC4XuBDZOUMvHq9+qEXvWG ftTKO/mMPqgMkoLAFZwPZpTDcTYC9LHc+u3O2NP7t1Q2sxK+uYrp6IwQD0V8PJVHTqjR SAMeUZXmXzQyVhEGcfD0GA9W521jHHPBfp4NSikxaRbehpNaikzmUotUZisat5zXiwsM oXYeThOQ2uE7dwjM5zIy/VgvfzCZYeWgHdyO88Qx98q+rJSsf4iV/ShtmKasp5ixT6hE u18RQ+wk5hE2ZOP8ZyZ2JwLmbNhdMQ+RZVZuLTT3rSygczT6rd3QXNphogHCobqKgqpd gzfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iJ/U/CoQkEukOmnim/wnnLlXQJbF+mCf7O0yvaasEUI=; b=duP3wHqzfr1EPAfB/DHMra4ZC80A3/3I/FOR4bwp7yk80OD+Inu5fYyUYwKuaco4Eh fUl1aLUnNnlqguQqzxDu5C49l66U5oukpgGuUkS8nb5Odv9Sj7CU5ykx0pg9XeZ+uWwB jTkwBCSv297pyzNTBaXHouYC7eaTpODBux0kKTvoIwtihhWc/M1+6sistSvyIh5aehjG IUQOhbiKOLDLqe8SFVnG7QhJM1L51iTbFKxheMsupHPEAxj4qTRJuXj41pcOwUxE04h9 Jc+2s2hgYFXWMmWmTSNL0kGLQDGUzqoOtAwMTFp1h5BtrQG7o81mEzYCTLyYjPT4dOqn mTJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ka9IYn1O; 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 f4si1513730ejt.278.2020.09.11.08.33.13; Fri, 11 Sep 2020 08:33:44 -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=Ka9IYn1O; 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 S1726479AbgIKPaN (ORCPT + 99 others); Fri, 11 Sep 2020 11:30:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30212 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbgIKPYW (ORCPT ); Fri, 11 Sep 2020 11:24:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599837860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iJ/U/CoQkEukOmnim/wnnLlXQJbF+mCf7O0yvaasEUI=; b=Ka9IYn1OYm7kntVMXBDiVtFCrTVISjmh6q5rAuzGkdB9jLsFDCtLfTywlmdb0csDvfCQjN KBkefUQzqq7nIr6J/WWVoHuV4yQVdK6S9nYfazAKeE/8/GXC+44LD2id7prczQxl1uADMC nQGLMc5QBvPNM9Rd5vN8+B4X1ANhHzc= 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-488-GWhH9Sb-Pf2rVZMqBlDXxA-1; Fri, 11 Sep 2020 11:24:17 -0400 X-MC-Unique: GWhH9Sb-Pf2rVZMqBlDXxA-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 BA8E9107B270; Fri, 11 Sep 2020 15:24:14 +0000 (UTC) Received: from fuller.cnet (ovpn-112-3.gru2.redhat.com [10.97.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44A057ED65; Fri, 11 Sep 2020 15:24:11 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id EFACE41853FD; Fri, 11 Sep 2020 12:23:44 -0300 (-03) Date: Fri, 11 Sep 2020 12:23:44 -0300 From: Marcelo Tosatti To: Nitesh Narayan Lal Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, frederic@kernel.org, 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: Re: [RFC][Patch v1 2/3] i40e: limit msix vectors based on housekeeping CPUs Message-ID: <20200911152344.GA21157@fuller.cnet> References: <20200909150818.313699-1-nitesh@redhat.com> <20200909150818.313699-3-nitesh@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200909150818.313699-3-nitesh@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 11:08:17AM -0400, Nitesh Narayan Lal wrote: > 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 For patches 1 and 2: Reviewed-by: Marcelo Tosatti