Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp982573rdf; Wed, 22 Nov 2023 02:17:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsUirG1tyCo5JWuxpVSzAJPnvOtPq1Lf47uwXZjS946aA282rFLtuU3wYoT2tZLwpPkC/u X-Received: by 2002:a05:6870:678d:b0:1f9:58b9:3abb with SMTP id gc13-20020a056870678d00b001f958b93abbmr2496784oab.46.1700648243174; Wed, 22 Nov 2023 02:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700648243; cv=none; d=google.com; s=arc-20160816; b=fc/ZqZD51mjfL4Z0h7+IllTh/tY8c0Qz8163ImiHLtFPCr6Ix8Btj7MkWaEGg59/ji Eexe5GzALn9V6eWPe06yt4x/7M2Uof+zGn2tOZSmL6zSFrlEGR8tSb9EokOpMzjQiacK CINSlS3vl9nvONGukG/6Qxxl4QbpUqHdaFRE8gw79V2oace8q4gZu5H+yE3haqASbJBu 3fJPbQpgwloWIYBFhN7NpExba9rgfkAPxysorCwUEU7w7m7wTOyDNUc9B2vZbMYLiS5P zQMHgH48rHUvH9XFRmWfKySFGpQ9SaPP4PVZemqja228tmGmoB6v5w3lUScmEU7EAo0N fPyQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ntIwoh8nmo6x8jvo27voHZh3WCaqdVm0ct3IIneIzKs=; fh=Ire9X/f+poHf+LCGYaDugOGHU/myEYCp7lvBMoNWOik=; b=VGGXp/HLYvHsyUwePoZ1I7saDcERpDIEnCAoTZglbTucNUR3bMoaiYOt6MOsm97/wq NE71af6D1SFLhtW5oscR5QioJdNAF2oqtCbhQ+ebSBpBJZ6rJjuvMjU0bdBslIdFyRhh QhjODwlQvmO9nbkv1ZfW98hMucPDDpbJIdPt72Voy83DDJ7RLZ7/r3hnwz3WLMGC6gG9 xnIHnwc2KaEaQJUu0llHf40Zh8RMQrWi3+Q5JVHneNAfBqAHMVSz7uh30sMl27/X+KkN ynPOdqCq2A0P74uXuf0vzwBYyWce4ma6VtDyp8p3CJddcDVB5GdWT7pHS+xf6Ry0p9ZC oGAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QmniymKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h14-20020a056a00218e00b006cb906d800esi6973056pfi.107.2023.11.22.02.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 02:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QmniymKV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 233CA81167A4; Wed, 22 Nov 2023 02:17:13 -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 S1343643AbjKVKQF (ORCPT + 99 others); Wed, 22 Nov 2023 05:16:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235134AbjKVKQA (ORCPT ); Wed, 22 Nov 2023 05:16:00 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D04CB10C for ; Wed, 22 Nov 2023 02:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700648156; 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: in-reply-to:in-reply-to:references:references; bh=ntIwoh8nmo6x8jvo27voHZh3WCaqdVm0ct3IIneIzKs=; b=QmniymKVXrHHHUgAsQyT4uqnHXfMOa4GgHWjeKaUq8zubUFC3zr7MeLRnnVNTsRw0IElfp WqrSic+Ar+WF1gct982PDdGZEoimG3H01dGFSGFl1W6gmFciXHSHzC/WEC2BKWEZZub0O9 j+vcsnJ24bMOOz+6Nq4ek7L1yzsC/x4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-189-j5C4KuyhMn6RYTjlXQrnvg-1; Wed, 22 Nov 2023 05:15:51 -0500 X-MC-Unique: j5C4KuyhMn6RYTjlXQrnvg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 DB7B1101A550; Wed, 22 Nov 2023 10:15:50 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.226.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BCCB10EA1; Wed, 22 Nov 2023 10:15:48 +0000 (UTC) From: Ivan Vecera To: intel-wired-lan@lists.osuosl.org Cc: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jacob Keller , Wojciech Drewek , Simon Horman , mschmidt@redhat.com, netdev@vger.kernel.org Subject: [PATCH v4 1/5] i40e: Use existing helper to find flow director VSI Date: Wed, 22 Nov 2023 11:15:41 +0100 Message-ID: <20231122101545.28819-2-ivecera@redhat.com> In-Reply-To: <20231122101545.28819-1-ivecera@redhat.com> References: <20231122101545.28819-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 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 Precedence: bulk List-ID: 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, 22 Nov 2023 02:17:13 -0800 (PST) Use existing i40e_find_vsi_by_type() to find a VSI associated with flow director. Reviewed-by: Wojciech Drewek Signed-off-by: Ivan Vecera --- drivers/net/ethernet/intel/i40e/i40e_main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 51ee870ffa36..90966878333c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -15645,6 +15645,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) #ifdef CONFIG_I40E_DCB enum i40e_get_fw_lldp_status_resp lldp_status; #endif /* CONFIG_I40E_DCB */ + struct i40e_vsi *vsi; struct i40e_pf *pf; struct i40e_hw *hw; u16 wol_nvm_bits; @@ -15655,7 +15656,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) #endif /* CONFIG_I40E_DCB */ int err; u32 val; - u32 i; err = pci_enable_device_mem(pdev); if (err) @@ -16005,12 +16005,9 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) INIT_LIST_HEAD(&pf->vsi[pf->lan_vsi]->ch_list); /* if FDIR VSI was set up, start it now */ - for (i = 0; i < pf->num_alloc_vsi; i++) { - if (pf->vsi[i] && pf->vsi[i]->type == I40E_VSI_FDIR) { - i40e_vsi_open(pf->vsi[i]); - break; - } - } + vsi = i40e_find_vsi_by_type(pf, I40E_VSI_FDIR); + if (vsi) + i40e_vsi_open(vsi); /* The driver only wants link up/down and module qualification * reports from firmware. Note the negative logic. -- 2.41.0