2021-01-13 12:59:20

by Gilles Doffe

[permalink] [raw]
Subject: [PATCH net 4/6] net: dsa: ksz: do not change tagging on del

If a VLAN is removed, the tagging policy should not be changed as
still active VLANs could be impacted.

Signed-off-by: Gilles DOFFE <[email protected]>
---
drivers/net/dsa/microchip/ksz8795.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index 193f03ef9160..b55fb2761993 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -880,7 +880,6 @@ static void ksz8795_port_vlan_add(struct dsa_switch *ds, int port,
static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan)
{
- bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
struct ksz_device *dev = ds->priv;
u16 data, vid, pvid, new_pvid = 0;
u8 fid, member, valid;
@@ -888,8 +887,6 @@ static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
ksz_pread16(dev, port, REG_PORT_CTRL_VID, &pvid);
pvid = pvid & 0xFFF;

- ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_REMOVE_TAG, untagged);
-
for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
ksz8795_r_vlan_table(dev, vid, &data);
ksz8795_from_vlan(data, &fid, &member, &valid);
--
2.25.1


2021-01-14 00:06:14

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH net 4/6] net: dsa: ksz: do not change tagging on del

On 1/13/21 4:45 AM, Gilles DOFFE wrote:
> If a VLAN is removed, the tagging policy should not be changed as
> still active VLANs could be impacted.
>
> Signed-off-by: Gilles DOFFE <[email protected]>

It sounds like you need to consolidate the patches dealing with
tagging/untagged of a VLAN/port into a single patch, that may be clearer
and easier to review rather than doing this piecemeal.
--
Florian

2021-01-14 00:45:05

by Vladimir Oltean

[permalink] [raw]
Subject: Re: [PATCH net 4/6] net: dsa: ksz: do not change tagging on del

On Wed, Jan 13, 2021 at 01:45:20PM +0100, Gilles DOFFE wrote:
> If a VLAN is removed, the tagging policy should not be changed as
> still active VLANs could be impacted.
>
> Signed-off-by: Gilles DOFFE <[email protected]>
> ---
> drivers/net/dsa/microchip/ksz8795.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
> index 193f03ef9160..b55fb2761993 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -880,7 +880,6 @@ static void ksz8795_port_vlan_add(struct dsa_switch *ds, int port,
> static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
> const struct switchdev_obj_port_vlan *vlan)
> {
> - bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
> struct ksz_device *dev = ds->priv;
> u16 data, vid, pvid, new_pvid = 0;
> u8 fid, member, valid;
> @@ -888,8 +887,6 @@ static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
> ksz_pread16(dev, port, REG_PORT_CTRL_VID, &pvid);
> pvid = pvid & 0xFFF;
>
> - ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_REMOVE_TAG, untagged);
> -
> for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
> ksz8795_r_vlan_table(dev, vid, &data);
> ksz8795_from_vlan(data, &fid, &member, &valid);
> --
> 2.25.1
>

What do you mean the tagging policy "should not be changed". Nothing is
changed, the write to PORT_REMOVE_TAG is identical to the one done on
.port_vlan_add. If anything, the egress untagging policy is reinforced
on delete, not changed...

What's the actual problem (beside for the fact that the driver is
obviously a lot more broken than you can fix through patches to "net")?