public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Simon Waterer <simon.waterer@gmail.com>,
	Arun Ramadoss <arun.ramadoss@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>,
	netdev@vger.kernel.org
Subject: Re: DSA switch: VLAN tag not added on packets directed to a PVID,untagged switchport
Date: Thu, 18 Jan 2024 02:52:01 +0200	[thread overview]
Message-ID: <20240118005201.zxpk3r4agkl7y7yi@skbuf> (raw)
In-Reply-To: <526bf36a-f0e6-4149-90c9-16f91ff039ce@gmail.com>

On Tue, Jan 16, 2024 at 10:23:30AM -0800, Florian Fainelli wrote:
> Since the proposed changes were not in an unified diff format, it was not
> clear to me what was being proposed, but what you are suggesting is that the
> following should be applied to b53?
> 
> diff --git a/drivers/net/dsa/b53/b53_common.c
> b/drivers/net/dsa/b53/b53_common.c
> index 0d628b35fd5c..354dcfd23da8 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -1556,9 +1556,6 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
>         if (pvid == vlan->vid)
>                 pvid = b53_default_pvid(dev);
> 
> -       if (untagged && !b53_vlan_port_needs_forced_tagged(ds, port))
> -               vl->untag &= ~(BIT(port));
> -
>         b53_set_vlan_entry(dev, vlan->vid, vl);
>         b53_fast_age_vlan(dev, vlan->vid);
> 
> 
> or did I completely miss what was being changed?
> -- 
> Florian
> 

Yes, I had this patch, notice how the entire 'untagged' variable
disappears too.

From 67ae82a8ba11ebc992ed8450d9ded3f39700b341 Mon Sep 17 00:00:00 2001
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Tue, 16 Jan 2024 18:58:40 +0200
Subject: [PATCH] net: dsa: b53: remove use of vlan->flags in port_vlan_del()

The flags are always set to zero by the function callers, i.e.
br_switchdev_port_vlan_del() and dsa_user_vlan_rx_kill_vid().

This makes the vlan->flags handling in driver implementations
practically dead code.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/dsa/b53/b53_common.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 0d628b35fd5c..3b071ef2d836 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1541,7 +1541,6 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
 		 const struct switchdev_obj_port_vlan *vlan)
 {
 	struct b53_device *dev = ds->priv;
-	bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
 	struct b53_vlan *vl;
 	u16 pvid;
 
@@ -1556,9 +1555,6 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
 	if (pvid == vlan->vid)
 		pvid = b53_default_pvid(dev);
 
-	if (untagged && !b53_vlan_port_needs_forced_tagged(ds, port))
-		vl->untag &= ~(BIT(port));
-
 	b53_set_vlan_entry(dev, vlan->vid, vl);
 	b53_fast_age_vlan(dev, vlan->vid);
 
-- 
2.34.1


      reply	other threads:[~2024-01-18  0:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15  4:37 DSA switch: VLAN tag not added on packets directed to a PVID,untagged switchport Simon Waterer
2024-01-15 18:15 ` Vladimir Oltean
2024-01-16  4:32   ` Simon Waterer
2024-01-16 13:10     ` Vladimir Oltean
2024-01-16 18:23       ` Florian Fainelli
2024-01-18  0:52         ` Vladimir Oltean [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240118005201.zxpk3r4agkl7y7yi@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=simon.waterer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox