Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3292885rdb; Thu, 16 Nov 2023 05:59:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz1jQso8TYTrvOLnVAxQE2wwGcOLos8LFE0lVpzdTMVzTJJGvW+nIrQ7Im5lNoG1dZXefq X-Received: by 2002:a05:6a21:3391:b0:186:a0d9:41a7 with SMTP id yy17-20020a056a21339100b00186a0d941a7mr11694978pzb.21.1700143194203; Thu, 16 Nov 2023 05:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700143194; cv=none; d=google.com; s=arc-20160816; b=U4aO0xLSvZmWACNqzQvISAJK+rrDRr151wLbRnNdHibHZXf75Fuim6sjPDa497vlPT OdvcAIOZ5+ky+hW5PhKbmEXJh3oJ5eV5/Qq8athPD7OrzzxNUF8OUAezA2KmHhfuYNws Y9Y62vKQGWNAiOqK9+Y14dG87qSjU9VBXYJSZWhLXKSXvuGabywF5jxTrHFcLZB/QbO4 Q5LN1BaSrgfYeAcNLEdfrxvG4OoZSY1rfPXHmjd2Nah85rWowrq0yxAhepWDz5CYMdBA IlBQpZ+h0XfWO0r0xS3luy9NHB2vDhtZYEfW8VwPShlUYCs8jK4oSn26dMD42Mo6X9zH wNtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rcFm4CYE9xVUh7GTYUarkXRDjUbvhgbuzrK/6r8vxYo=; fh=x3P7WJLeCFZ2qcQ1N2LjDzJn3Xwp/tVPTRNZcEvuV48=; b=huCV8nQaieU8gJJixzXsSy024H8iyPhfzCD6QKHDACxc9YyiEQRl3NS7svOOk6Pk9w igzTCKCa3Lh5ANtceq4hhqYzvUkuZYPo7iPpyjtxcxU5Bctxv+47zmUa3gPyfy1BAZvz x2igAS5FlJi5eX4r4PXiH11bOssvFdtLne5F6vrn2ba3BOfNjTyFa1tq4RmHAzKGTkVi SkZO8kBI0EKPQ4kxG/Y+m0jpnWGKikVIDXssNM8FRdLTDQUHxMCcPV/bTbmc9sy8DWVS 5WI/mg+uzk4ZN/X6kOJzhI+Mpzf/0yydM9Ln1UpGd+BHbUBx5+nCU085DaX4DE62lOEi oiUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WF48LOMs; 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 Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y20-20020a056a001c9400b006be15fece6csi12542032pfw.360.2023.11.16.05.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 05:59:54 -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=WF48LOMs; 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 82F838074041; Thu, 16 Nov 2023 05:59:51 -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 S1345280AbjKPN7j (ORCPT + 99 others); Thu, 16 Nov 2023 08:59:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345194AbjKPN7i (ORCPT ); Thu, 16 Nov 2023 08:59:38 -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 F317411F for ; Thu, 16 Nov 2023 05:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700143174; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rcFm4CYE9xVUh7GTYUarkXRDjUbvhgbuzrK/6r8vxYo=; b=WF48LOMstUVyq4wQATbA0tuzYjHIB3h7r0mWQXLFCOohY6yXp6I2vUxaSxgNjkzrBxZPGO u72qLtgD83aC0iYaDX6AApE29KFSm9u9RakSscRHLSCba4taIgg+Zc0WWBtB6uauFyxA5h dVDNgu3zh4YpsPVYNvDSTqmMemiQIC4= 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-226-tRuM4eFGNN2-6MYcUchipw-1; Thu, 16 Nov 2023 08:59:29 -0500 X-MC-Unique: tRuM4eFGNN2-6MYcUchipw-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 488243C0F42D; Thu, 16 Nov 2023 13:59:28 +0000 (UTC) Received: from [10.45.225.144] (unknown [10.45.225.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B06440C6EBB; Thu, 16 Nov 2023 13:59:26 +0000 (UTC) Message-ID: <483acf53-fe96-4ef3-933a-c5fd446042f6@redhat.com> Date: Thu, 16 Nov 2023 14:59:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH iwl-next 3/5] i40e: Add helpers to find VSI and VEB by SEID and use them Content-Language: en-US To: Wojciech Drewek , netdev@vger.kernel.org Cc: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, Jacob Keller , Simon Horman , mschmidt@redhat.com References: <20231113125856.346047-1-ivecera@redhat.com> <20231113125856.346047-4-ivecera@redhat.com> <3c640be7-8f1e-4f9e-8556-3aac92644dec@intel.com> <36889885-71c7-46f7-8c21-e5791986ad5a@redhat.com> <72250942-17af-4f8d-b11f-ba902fbe2b58@intel.com> From: Ivan Vecera In-Reply-To: <72250942-17af-4f8d-b11f-ba902fbe2b58@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Spam-Status: No, score=-1.0 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]); Thu, 16 Nov 2023 05:59:51 -0800 (PST) On 16. 11. 23 13:37, Wojciech Drewek wrote: > > > On 15.11.2023 18:01, Ivan Vecera wrote: >> >> On 13. 11. 23 14:27, Wojciech Drewek wrote: >>> >>> On 13.11.2023 13:58, Ivan Vecera wrote: >>>> Add two helpers i40e_(veb|vsi)_get_by_seid() to find corresponding >>>> VEB or VSI by their SEID value and use these helpers to replace >>>> existing open-coded loops. >>>> >>>> Signed-off-by: Ivan Vecera >>>> --- >>> Only one nit >>> Reviewed-by: Wojciech Drewek >>> >>>>   drivers/net/ethernet/intel/i40e/i40e.h        | 34 +++++++++ >>>>   .../net/ethernet/intel/i40e/i40e_debugfs.c    | 38 ++-------- >>>>   drivers/net/ethernet/intel/i40e/i40e_main.c   | 76 ++++++------------- >>>>   3 files changed, 64 insertions(+), 84 deletions(-) >>>> >>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h >>>> index 1e9266de270b..220b5ce31519 100644 >>>> --- a/drivers/net/ethernet/intel/i40e/i40e.h >>>> +++ b/drivers/net/ethernet/intel/i40e/i40e.h >>>> @@ -1360,4 +1360,38 @@ static inline struct i40e_pf *i40e_hw_to_pf(struct i40e_hw *hw) >>>>     struct device *i40e_hw_to_dev(struct i40e_hw *hw); >>>>   +/** >>>> + * i40e_vsi_get_by_seid - find VSI by SEID >>>> + * @pf: pointer to a PF >>>> + **/ >>>> +static inline struct i40e_vsi * >>>> +i40e_vsi_get_by_seid(struct i40e_pf *pf, u16 seid) >>>> +{ >>>> +    struct i40e_vsi *vsi; >>>> +    int i; >>>> + >>>> +    i40e_pf_for_each_vsi(pf, i, vsi) >>>> +        if (vsi->seid == seid) >>>> +            return vsi; >>>> + >>>> +    return NULL; >>>> +} >>>> + >>>> +/** >>>> + * i40e_veb_get_by_seid - find VEB by SEID >>>> + * @pf: pointer to a PF >>>> + **/ >>>> +static inline struct i40e_veb * >>>> +i40e_veb_get_by_seid(struct i40e_pf *pf, u16 seid) >>>> +{ >>>> +    struct i40e_veb *veb; >>>> +    int i; >>>> + >>>> +    i40e_pf_for_each_veb(pf, i, veb) >>>> +        if (veb->seid == seid) >>>> +            return veb; >>>> + >>>> +    return NULL; >>>> +} >>> I would prefer i40e_get_{veb|vsi}_by_seid but it's my opinion. >> >> I'd rather use i40e_pf_ prefix... >> >> What about i40e_pf_get_vsi_by_seid() and i40e_pf_get_veb_by_seid() ? > > Sounds good, my point was that I prefer to have "get" before "{veb|vsi}" OK, got it... Will repost v2 with this change + "too many also..." issue ;-) Btw. what about the last patch? Ivan