From patchwork Fri Nov 24 15:03:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 169455 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1272679vqx; Fri, 24 Nov 2023 07:04:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9VLOAVRMIeA2cMOCS6/SmAUSv4pHm9NUJ0EeuCb5nmFs6gLC900M0Ei6VSzn5Zy8sd/mG X-Received: by 2002:a05:6830:1310:b0:6c6:4473:6f05 with SMTP id p16-20020a056830131000b006c644736f05mr3439085otq.9.1700838282350; Fri, 24 Nov 2023 07:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700838282; cv=none; d=google.com; s=arc-20160816; b=mt6syFbSQVCuiAZCcxEIi/9sKZk0rLMXKzLK2hos6sUaLNz5YQijWscYAP5Ypwh+lw FIfJ2JYeDOtK+i+Cb+5bTHCM+gDyX4sbEZRNmJJmkTGkaqt5HByRoPuGw6fJvmk7rzNp qmzX4OdMLPCP9G/LlLyuDkorv7xE8DTl+A1SyQPs2MVxhySTHXjSNbwZquvAT2n5cnB5 0zie33cGXisxxchUb4NYEo1X6L/xD8YdsUVG2w+9A8NxGRknaLMvZ7XK/CE/lgvZTOQ/ M4F5Ceiz2Hn3scNm1cHk8McfpA2PyiQxRGSY/s9prGwrj7+s7z52NfAC/LEmSrpLDpMb YzGg== 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=MP/kqRon8YWP8JK7KypairOFC79nCBjlfNY2qjRcFGJHo3dq8NlGnFoSQHWU4As0Lr LgofhZu3eB0IOHOlHnP1DpZU1GM0cfYRC90aeFlrR+o1fpsHFpUxMze59er4pWenKbzF zefXH/Ski+iRyou2KCLOO9UszxN6iuN+pPc5HKljSkdx8cU4jCade6MVgpWWMhI1EMGn oSX6IndxEXoRjGzuaADVwBUmjs9PeNkSo0rN/f92KpeskRdB0MrrwCWDr5XYuxxgY45D HDx1U+9ESYU7gzu+w+zJqWhT8M52rG7m6iL8X7tqNMNiaEnHTrdY08pz14roEUZkBXRD xvwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LaCJJGtU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l24-20020a05683004b800b006d802b4e79csi872687otd.141.2023.11.24.07.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LaCJJGtU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id F39518043993; Fri, 24 Nov 2023 07:04:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345512AbjKXPDt (ORCPT + 99 others); Fri, 24 Nov 2023 10:03:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345384AbjKXPDr (ORCPT ); Fri, 24 Nov 2023 10:03:47 -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 259D993 for ; Fri, 24 Nov 2023 07:03:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700838233; 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=LaCJJGtUISR+Ew2EjgkasLSjQAlm2xQNQoLLo4jk5m1dKtd3Q44IM9pVI/g8eWrrTb01rv UvlciLCB87VilyCTSRegzA7NgK4lh5/rylws9/PGcdQbXar01wzsFtuqHAVRu8l6NntqCA DypccxvBZeQ8duFdfkpN6VmZ4Bpnc2M= 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-581-J3KkISlDMFmYuwGt8AFG9w-1; Fri, 24 Nov 2023 10:03:49 -0500 X-MC-Unique: J3KkISlDMFmYuwGt8AFG9w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 A558E85A58B; Fri, 24 Nov 2023 15:03:48 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.226.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD8E340C6EB9; Fri, 24 Nov 2023 15:03:46 +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 v5 1/5] i40e: Use existing helper to find flow director VSI Date: Fri, 24 Nov 2023 16:03:39 +0100 Message-ID: <20231124150343.81520-2-ivecera@redhat.com> In-Reply-To: <20231124150343.81520-1-ivecera@redhat.com> References: <20231124150343.81520-1-ivecera@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 24 Nov 2023 07:04:37 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783458202680418995 X-GMAIL-MSGID: 1783458202680418995 Use existing i40e_find_vsi_by_type() to find a VSI associated with flow director. Reviewed-by: Wojciech Drewek Signed-off-by: Ivan Vecera Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Reviewed-by: Simon Horman --- 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.