RE: [Intel-wired-lan] [PATCH v5 2/5] i40e: Introduce and use macros for iterating VSIs and VEBs
From: Pucha, HimasekharX Reddy
Date: Thu Nov 30 2023 - 00:23:21 EST
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of Ivan Vecera
> Sent: Friday, November 24, 2023 8:34 PM
> To: intel-wired-lan@xxxxxxxxxxxxxxxx
> Cc: Drewek, Wojciech <wojciech.drewek@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; Brandeburg, Jesse <jesse.brandeburg@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Eric Dumazet <edumazet@xxxxxxxxxx>; Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>; Keller, Jacob E <jacob.e.keller@xxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; David S . Miller <davem@xxxxxxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH v5 2/5] i40e: Introduce and use macros for iterating VSIs and VEBs
>
> Introduce i40e_for_each_vsi() and i40e_for_each_veb() helper
> macros and use them to iterate relevant arrays.
>
> Replace pattern:
> for (i = 0; i < pf->num_alloc_vsi; i++)
> by:
> i40e_for_each_vsi(pf, i, vsi)
>
> and pattern:
> for (i = 0; i < I40E_MAX_VEB; i++)
> by
> i40e_for_each_veb(pf, i, veb)
>
> These macros also check if array item pf->vsi[i] or pf->veb[i]
> are not NULL and skip such items so we can remove redundant
> checks from loop bodies.
>
> Reviewed-by: Wojciech Drewek <wojciech.drewek@xxxxxxxxx>
> Signed-off-by: Ivan Vecera <ivecera@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/i40e/i40e.h | 56 ++-
> drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 10 +-
> .../net/ethernet/intel/i40e/i40e_debugfs.c | 54 +--
> drivers/net/ethernet/intel/i40e/i40e_main.c | 389 ++++++++----------
> 4 files changed, 264 insertions(+), 245 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@xxxxxxxxx> (A Contingent worker at Intel)