Subject: Re: [PATCH net-next 1/5] net: dsa: mv88e6xxx: Provide generic VTU iterator

From: Tobias Waldekranz <[email-masked]>
Date: Wed, 17 Mar 2021 10:41:44 +0100

On Tue, Mar 16, 2021 at 10:42, Vladimir Oltean <[email-masked]> wrote:
> On Mon, Mar 15, 2021 at 10:13:56PM +0100, Tobias Waldekranz wrote:
>> @@ -2184,25 +2230,7 @@ static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port,
>>  	if (err)
>>  		return err;
>>  
>> -	/* Dump VLANs' Filtering Information Databases */
>> -	vlan.vid = mv88e6xxx_max_vid(chip);
>> -	vlan.valid = false;
>> -
>> -	do {
>> -		err = mv88e6xxx_vtu_getnext(chip, &vlan);
>> -		if (err)
>> -			return err;
>> -
>> -		if (!vlan.valid)
>> -			break;
>> -
>> -		err = mv88e6xxx_port_db_dump_fid(chip, vlan.fid, vlan.vid, port,
>> -						 cb, data);
>> -		if (err)
>> -			return err;
>> -	} while (vlan.vid < mv88e6xxx_max_vid(chip));
>> -
>> -	return err;
>> +	return mv88e6xxx_vtu_walk(chip, mv88e6xxx_port_db_dump_vlan, &ctx);
>>  }
>
> Can the mv88e6xxx_port_db_dump_fid(VLAN 0) located above this call be
> covered by the same mv88e6xxx_vtu_walk?

The port's default default FID does not belong to any VLAN, so it is
never loaded in the VTU. That is why it handled separately. So, no :)