[Intel-wired-lan] [PATCH iwl-net] i40e: fix i40e_count_filters() to count only active/new filters

Loktionov, Aleksandr aleksandr.loktionov at intel.com
Tue Mar 12 10:44:10 UTC 2024



> -----Original Message-----
> From: Paul Menzel <pmenzel at molgen.mpg.de>
> Sent: Tuesday, March 12, 2024 10:36 AM
> To: Loktionov, Aleksandr <aleksandr.loktionov at intel.com>
> Cc: intel-wired-lan at lists.osuosl.org; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; netdev at vger.kernel.org; Kubalewski,
> Arkadiusz <arkadiusz.kubalewski at intel.com>
> Subject: Re: [Intel-wired-lan] [PATCH iwl-net] i40e: fix
> i40e_count_filters() to count only active/new filters
> 
> Dear Aleksandr,
> 
> 
> Thank you for your patch.
> 
> Am 12.03.24 um 09:13 schrieb Aleksandr Loktionov:
> > Fix counter to be bumped only for new or active filters.
> 
> Although it’s a small diffstat, could you please elaborate, and at
> least describe the problem in more detail.
> 
> How can this be tested?
> 
The bug usually affects untrusted VFs, because they are limited to 18MACs, it affects them badly, not letting to create MAC filters.
Not stable to reproduce, it happens when VF user creates MAC filters when other MACVLAN operations are happened in parallel.
But consequence is that VF can't receive desired traffic.

> > Fixes: 621650cabee5 ("i40e: Refactoring VF MAC filters counting
> to
> > make more reliable")
> > Signed-off-by: Aleksandr Loktionov
> <aleksandr.loktionov at intel.com>
> > Reviewed-by: Arkadiusz Kubalewski
> <arkadiusz.kubalewski at intel.com>
> > ---
> >   drivers/net/ethernet/intel/i40e/i40e_main.c | 7 +++++--
> >   1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > index 89a3401..6010a49 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > @@ -1257,8 +1257,11 @@ int i40e_count_filters(struct i40e_vsi
> *vsi)
> >   	int bkt;
> >   	int cnt = 0;
> >
> > -	hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist)
> > -		++cnt;
> > +	hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {
> > +		if (f->state == I40E_FILTER_NEW ||
> > +		    f->state == I40E_FILTER_ACTIVE)
> > +			++cnt;
> > +	}
> >
> >   	return cnt;
> >   }
> 
> 
> Kind regards,
> 
> Paul


More information about the Intel-wired-lan mailing list