Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1659202 > unrolled thread

[PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2017-06-06 23:00 +0200
Last post2017-06-07 22:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-06 23:00 +0200
    Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU  entry Florian Fainelli <f.fainelli@gmail.com> - 2017-06-07 21:40 +0200
      Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-07 22:10 +0200

#1659202 — [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-06-06 23:00 +0200
Subject[PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry
Message-ID<tPtK2-5mC-23@gated-at.bofh.it>
The mv88e6xxx driver currently tries to be smart and remove by itself a
VLAN entry from the VTU when the driven switch sees no user ports as
members of the VLAN.

This is bad in a multi-chip switch fabric, since a chip in between
others may have no bridge port members, but still needs to be aware of
the VID in order to correctly pass frames in the data path.

Remove the code purging a VTU entry when updating a port membership.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 522f023bb17e..64c0f88f9e79 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1325,9 +1325,8 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
 static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
 				    int port, u16 vid)
 {
-	struct dsa_switch *ds = chip->ds;
 	struct mv88e6xxx_vtu_entry vlan;
-	int i, err;
+	int err;
 
 	err = mv88e6xxx_vtu_get(chip, vid, &vlan, false);
 	if (err)
@@ -1339,18 +1338,6 @@ static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
 
 	vlan.member[port] = GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER;
 
-	/* keep the VLAN unless all ports are excluded */
-	vlan.valid = false;
-	for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) {
-		if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i))
-			continue;
-
-		if (vlan.member[i] != GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER) {
-			vlan.valid = true;
-			break;
-		}
-	}
-
 	err = mv88e6xxx_vtu_loadpurge(chip, &vlan);
 	if (err)
 		return err;
-- 
2.13.0

[toc] | [next] | [standalone]


#1660142 — Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-06-07 21:40 +0200
SubjectRe: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry
Message-ID<tPOYa-2pK-15@gated-at.bofh.it>
In reply to#1659202
On 06/06/2017 01:56 PM, Vivien Didelot wrote:
> The mv88e6xxx driver currently tries to be smart and remove by itself a
> VLAN entry from the VTU when the driven switch sees no user ports as
> members of the VLAN.
> 
> This is bad in a multi-chip switch fabric, since a chip in between
> others may have no bridge port members, but still needs to be aware of
> the VID in order to correctly pass frames in the data path.
> 
> Remove the code purging a VTU entry when updating a port membership.

In that case the switch sitting between two other chips and passing
traffic would still have at least two of its DSA ports be part of a VTU
entry, right?

So could not we just do ....

> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 522f023bb17e..64c0f88f9e79 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -1325,9 +1325,8 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
>  static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
>  				    int port, u16 vid)
>  {
> -	struct dsa_switch *ds = chip->ds;
>  	struct mv88e6xxx_vtu_entry vlan;
> -	int i, err;
> +	int err;
>  
>  	err = mv88e6xxx_vtu_get(chip, vid, &vlan, false);
>  	if (err)
> @@ -1339,18 +1338,6 @@ static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
>  
>  	vlan.member[port] = GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER;
>  
> -	/* keep the VLAN unless all ports are excluded */
> -	vlan.valid = false;
> -	for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) {
> -		if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i))
> -			continue;

... break the loop here?

> -
> -		if (vlan.member[i] != GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER) {
> -			vlan.valid = true;
> -			break;
> -		}
> -	}
> -
>  	err = mv88e6xxx_vtu_loadpurge(chip, &vlan);
>  	if (err)
>  		return err;
> 


-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1660159

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-06-07 22:10 +0200
Message-ID<tPPrb-2PB-7@gated-at.bofh.it>
In reply to#1660142
Hi Florian,

Florian Fainelli <f.fainelli@gmail.com> writes:

> On 06/06/2017 01:56 PM, Vivien Didelot wrote:
>> The mv88e6xxx driver currently tries to be smart and remove by itself a
>> VLAN entry from the VTU when the driven switch sees no user ports as
>> members of the VLAN.
>> 
>> This is bad in a multi-chip switch fabric, since a chip in between
>> others may have no bridge port members, but still needs to be aware of
>> the VID in order to correctly pass frames in the data path.
>> 
>> Remove the code purging a VTU entry when updating a port membership.
>
> In that case the switch sitting between two other chips and passing
> traffic would still have at least two of its DSA ports be part of a VTU
> entry, right?

That is correct.

>
> So could not we just do ....
>
>> 
>> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
>> ---
>>  drivers/net/dsa/mv88e6xxx/chip.c | 15 +--------------
>>  1 file changed, 1 insertion(+), 14 deletions(-)
>> 
>> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
>> index 522f023bb17e..64c0f88f9e79 100644
>> --- a/drivers/net/dsa/mv88e6xxx/chip.c
>> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
>> @@ -1325,9 +1325,8 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
>>  static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
>>  				    int port, u16 vid)
>>  {
>> -	struct dsa_switch *ds = chip->ds;
>>  	struct mv88e6xxx_vtu_entry vlan;
>> -	int i, err;
>> +	int err;
>>  
>>  	err = mv88e6xxx_vtu_get(chip, vid, &vlan, false);
>>  	if (err)
>> @@ -1339,18 +1338,6 @@ static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
>>  
>>  	vlan.member[port] = GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER;
>>  
>> -	/* keep the VLAN unless all ports are excluded */
>> -	vlan.valid = false;
>> -	for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) {
>> -		if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i))
>> -			continue;
>
> ... break the loop here?

I can remove only the dsa_is_{cpu,dsa}_port condition above, this will
make the code ready for when the DSA core will remove VLAN on DSA ports.

Thanks!

        Vivien

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web