Message ID | 20231108160104.86140-1-ivecera@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp1009546vqo; Wed, 8 Nov 2023 08:02:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgW9kgb6E2MT0iPrXuGVLAhtKkePcbNuXAcUpmgs5cBCJkp/JYl9cQXjQ3Aj5hYKZv3JZZ X-Received: by 2002:a05:6602:2345:b0:7a9:4a6e:66a2 with SMTP id r5-20020a056602234500b007a94a6e66a2mr2440942iot.16.1699459355113; Wed, 08 Nov 2023 08:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699459355; cv=none; d=google.com; s=arc-20160816; b=noVq2gN+EmnbN1f8yyDlbYy/3YN0d3hpErTXPIQlkL+vL5RIphrjhZdGTrLLhF24MD zCY56TDW1d700/gdrKsOZAsNJtfqvzpvjC4EunBuGmcBxXUKew45rdYvE1vwI2YgzhxX lhaXRRb4iqTFt3YhHvBLH3me9GKsmgFtIcGXRELBFhif/A1zhGzJMLamQUxMmtAISO1R UjbplkTeg1ru11sOhsFYDNJiFVXk84/j0ZcuRVteb0axaLJMjU2rijX6sICajSvcGtwP PxPmhCKvX04haJidlNpGzV0sCT+TTBGxtKFMiKshHiXRFV81G34UKMVyKVhXEOOCepMR pknQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rQ51b9eM0IFRwZBnxfiG5qJhLYeuJ0C09QIPA+aM9L8=; fh=JA/FAkCa7P9XIVUvhXtZ+HrjOGsfoQYn6YSz1bHHDGs=; b=s56JGzsj8npERjT4bbWbAmx530dEqgltkbr5mqDHO2B3SU/U9FbMuzlbBPpCQEscXs M6lmAaexZLFkzAfT65SuW38eVS58/gGXD7P0oCCuNtwAB8/iCKlbi+NkvVYxyqZDaQr3 5YInMZpkx9o34XVmgmWth3fbTWuP8Ymaug7qhhPcjAtG90bJ4dVbt+wf6Te0D3UysYxY +T0w0FVmAq9cS49EW5CMOrefBAaCx+6ngnvizTaalWvmyU10tagub6VbL7/f47kqaSh9 QgZyLD0a7/TErgEID6Fu5InHF1B5HkLfq77IY0NSebVH8y5KcjMtRUOXPCMcuIzZh03J cOSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fAihju2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 17-20020a5d9c51000000b00794e7c461f7si5698438iof.72.2023.11.08.08.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 08:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fAihju2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C0D29808EDD9; Wed, 8 Nov 2023 08:02:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232086AbjKHQCD (ORCPT <rfc822;jaysivo@gmail.com> + 32 others); Wed, 8 Nov 2023 11:02:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjKHQCC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Nov 2023 11:02:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1FC1BD7 for <linux-kernel@vger.kernel.org>; Wed, 8 Nov 2023 08:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699459273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=rQ51b9eM0IFRwZBnxfiG5qJhLYeuJ0C09QIPA+aM9L8=; b=fAihju2MQ0Jq7f/+fCZ7Gjhu2di3FL0HbYqDuIK1L/TG1FIaWPyaIqihuFwgd15I3VVZWZ ee/Y412Jkfk73/fvNMjFNPWhpUqSZhnT2kDKvX+zscy9wNXYHAesKFZtOaWeB5Wb/y2xuZ UfUpguQnmAtZl5nTT0RINOCjHdoDw2s= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-3s9y6T4AMICaPuwOeGB2SA-1; Wed, 08 Nov 2023 11:01:08 -0500 X-MC-Unique: 3s9y6T4AMICaPuwOeGB2SA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A634A3810D35; Wed, 8 Nov 2023 16:01:06 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.225.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id C75042166B27; Wed, 8 Nov 2023 16:01:04 +0000 (UTC) From: Ivan Vecera <ivecera@redhat.com> To: intel-wired-lan@lists.osuosl.org Cc: Jacob Keller <jacob.e.keller@intel.com>, Wojciech Drewek <wojciech.drewek@intel.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jeff Kirsher <jeffrey.t.kirsher@intel.com>, Neerav Parikh <neerav.parikh@intel.com>, netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH iwl-net] i40e: Fix waiting for queues of all VSIs to be disabled Date: Wed, 8 Nov 2023 17:01:03 +0100 Message-ID: <20231108160104.86140-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 08 Nov 2023 08:02:24 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782012292442440415 X-GMAIL-MSGID: 1782012292442440415 |
Series |
[iwl-net] i40e: Fix waiting for queues of all VSIs to be disabled
|
|
Commit Message
Ivan Vecera
Nov. 8, 2023, 4:01 p.m. UTC
The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs
up to 'pf->hw.func_caps.num_vsis' but this is incorrect because
the real number of VSIs can be up to 'pf->num_alloc_vsi' that
can be higher. Fix this loop.
Fixes: 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 11/8/2023 8:01 AM, Ivan Vecera wrote: > The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs > up to 'pf->hw.func_caps.num_vsis' but this is incorrect because > the real number of VSIs can be up to 'pf->num_alloc_vsi' that > can be higher. Fix this loop. This confused me at first, but as described in i40e_probe: > /* The number of VSIs reported by the FW is the minimum guaranteed > * to us; HW supports far more and we share the remaining pool with > * the other PFs. We allocate space for more than the guarantee with > * the understanding that we might not get them all later. > */ > if (pf->hw.func_caps.num_vsis < I40E_MIN_VSI_ALLOC) > pf->num_alloc_vsi = I40E_MIN_VSI_ALLOC; > else > pf->num_alloc_vsi = pf->hw.func_caps.num_vsis; The func_caps.num_vsis is really a minimum guaranteed amount and a single PF could get more from the shared pool. Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> > > Fixes: 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration") > Signed-off-by: Ivan Vecera <ivecera@redhat.com> > --- > drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c > index 6a2907674583..de19d753ba83 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c > @@ -5340,7 +5340,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf) > { > int v, ret = 0; > > - for (v = 0; v < pf->hw.func_caps.num_vsis; v++) { > + for (v = 0; v < pf->num_alloc_vsi; v++) { > if (pf->vsi[v]) { > ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]); > if (ret)
On 08.11.2023 17:01, Ivan Vecera wrote: > The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs > up to 'pf->hw.func_caps.num_vsis' but this is incorrect because > the real number of VSIs can be up to 'pf->num_alloc_vsi' that > can be higher. Fix this loop. > > Fixes: 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration") > Signed-off-by: Ivan Vecera <ivecera@redhat.com> Thanks Ivan! Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> > --- > drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c > index 6a2907674583..de19d753ba83 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c > @@ -5340,7 +5340,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf) > { > int v, ret = 0; > > - for (v = 0; v < pf->hw.func_caps.num_vsis; v++) { > + for (v = 0; v < pf->num_alloc_vsi; v++) { > if (pf->vsi[v]) { > ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]); > if (ret)
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Ivan Vecera > Sent: Wednesday, November 8, 2023 9:31 PM > To: intel-wired-lan@lists.osuosl.org > Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; open list:NETWORKING DRIVERS <netdev@vger.kernel.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>; Neerav Parikh <neerav.parikh@intel.com>; open list <linux-kernel@vger.kernel.org>; Eric Dumazet <edumazet@google.com>; Nguyen, Anthony L <anthonyl.nguyen@intel.com>; Jeff Kirsher <jeffrey.t.kirsher@intel.com>; Keller, Jacob E <jacob.e.keller@intel.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller <davem@davemloft.net> > Subject: [Intel-wired-lan] [PATCH iwl-net] i40e: Fix waiting for queues of all VSIs to be disabled > > The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs > up to 'pf->hw.func_caps.num_vsis' but this is incorrect because > the real number of VSIs can be up to 'pf->num_alloc_vsi' that > can be higher. Fix this loop. > > Fixes: 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration") > Signed-off-by: Ivan Vecera <ivecera@redhat.com> > --- > drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 6a2907674583..de19d753ba83 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -5340,7 +5340,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf) { int v, ret = 0; - for (v = 0; v < pf->hw.func_caps.num_vsis; v++) { + for (v = 0; v < pf->num_alloc_vsi; v++) { if (pf->vsi[v]) { ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]); if (ret)