lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 16 Nov 2023 13:37:12 +0100
From: Wojciech Drewek <wojciech.drewek@...el.com>
To: Ivan Vecera <ivecera@...hat.com>, <netdev@...r.kernel.org>
CC: Jesse Brandeburg <jesse.brandeburg@...el.com>, Tony Nguyen
	<anthony.l.nguyen@...el.com>, "David S. Miller" <davem@...emloft.net>, "Eric
 Dumazet" <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, <intel-wired-lan@...ts.osuosl.org>,
	<linux-kernel@...r.kernel.org>, Jacob Keller <jacob.e.keller@...el.com>,
	Simon Horman <horms@...nel.org>, <mschmidt@...hat.com>
Subject: Re: [PATCH iwl-next 3/5] i40e: Add helpers to find VSI and VEB by
 SEID and use them



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@...hat.com>
>>> ---
>> Only one nit
>> Reviewed-by: Wojciech Drewek<wojciech.drewek@...el.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}"

> 
> Ivan
> 

Powered by blists - more mailing lists