Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: Wojciech Drewek <wojciech.drewek@intel.com>, netdev@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	linux-kernel@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Simon Horman <horms@kernel.org>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next 3/5] i40e: Add helpers to find VSI and VEB by SEID and use them
Date: Thu, 16 Nov 2023 14:59:25 +0100	[thread overview]
Message-ID: <483acf53-fe96-4ef3-933a-c5fd446042f6@redhat.com> (raw)
In-Reply-To: <72250942-17af-4f8d-b11f-ba902fbe2b58@intel.com>


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<ivecera@redhat.com>
>>>> ---
>>> Only one nit
>>> Reviewed-by: Wojciech Drewek<wojciech.drewek@intel.com>
>>>
>>>>    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

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-11-16 13:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 12:58 [Intel-wired-lan] [PATCH iwl-next 0/5] i40e: Simplify VSI and VEB handling Ivan Vecera
2023-11-13 12:58 ` [Intel-wired-lan] [PATCH iwl-next 1/5] i40e: Use existing helper to find flow director VSI Ivan Vecera
2023-11-13 13:09   ` Wojciech Drewek
2023-11-13 12:58 ` [Intel-wired-lan] [PATCH iwl-next 2/5] i40e: Introduce and use macros for iterating VSIs and VEBs Ivan Vecera
2023-11-13 13:21   ` Wojciech Drewek
2023-11-13 12:58 ` [Intel-wired-lan] [PATCH iwl-next 3/5] i40e: Add helpers to find VSI and VEB by SEID and use them Ivan Vecera
2023-11-13 13:27   ` Wojciech Drewek
2023-11-15 17:01     ` Ivan Vecera
2023-11-16 12:37       ` Wojciech Drewek
2023-11-16 13:59         ` Ivan Vecera [this message]
2023-11-16 14:21           ` Wojciech Drewek
2023-11-16 14:46             ` Ivan Vecera
2023-11-13 12:58 ` [Intel-wired-lan] [PATCH iwl-next 4/5] i40e: Fix broken support for floating VEBs Ivan Vecera
2023-11-14 13:21   ` Wojciech Drewek
2023-11-13 12:58 ` [Intel-wired-lan] [PATCH iwl-next 5/5] i40e: Remove VEB recursion Ivan Vecera
2023-11-16 14:20   ` Wojciech Drewek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=483acf53-fe96-4ef3-933a-c5fd446042f6@redhat.com \
    --to=ivecera@redhat.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wojciech.drewek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox