netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: netdev@vger.kernel.org
Cc: f.fainelli@gmail.com, andrew@lunn.ch, Marek Vasut <marex@denx.de>,
	Tristram Ha <Tristram.Ha@microchip.com>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	Woojung Huh <woojung.huh@microchip.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH V3 3/3] net: dsa: ksz: Add STP multicast handling
Date: Sat, 15 Dec 2018 01:58:06 +0100	[thread overview]
Message-ID: <20181215005806.3856-4-marex@denx.de> (raw)
In-Reply-To: <20181215005806.3856-1-marex@denx.de>

In case the destination address is link local, add override bit into the
switch tag to let such a packet through the switch even if the port is
blocked.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
V2: New patch
V3: - Replace down with blocked in commit message
    - Add R-B
---
 net/dsa/tag_ksz.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
index c98b53f691bd..da71b9e2af52 100644
--- a/net/dsa/tag_ksz.c
+++ b/net/dsa/tag_ksz.c
@@ -110,6 +110,10 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
 	addr = skb_mac_header(nskb);
 
 	*tag = BIT(dp->index);
+
+	if (is_link_local_ether_addr(addr))
+		*tag |= KSZ9477_TAIL_TAG_OVERRIDE;
+
 	*tag = cpu_to_be16(*tag);
 
 	return nskb;
-- 
2.18.0

  parent reply	other threads:[~2018-12-15  0:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15  0:58 [PATCH V3 0/3] net: dsa: ksz: Clean up the tag code in prep for more switches Marek Vasut
2018-12-15  0:58 ` [PATCH V3 1/3] net: dsa: ksz: Rename NET_DSA_TAG_KSZ to _KSZ9477 Marek Vasut
2018-12-15  1:03   ` Florian Fainelli
2018-12-15  0:58 ` [PATCH V3 2/3] net: dsa: ksz: Factor out common tag code Marek Vasut
2018-12-15 17:23   ` Andrew Lunn
2018-12-15  0:58 ` Marek Vasut [this message]
2018-12-15  1:02   ` [PATCH V3 3/3] net: dsa: ksz: Add STP multicast handling Florian Fainelli
2018-12-16 22:24 ` [PATCH V3 0/3] net: dsa: ksz: Clean up the tag code in prep for more switches David Miller

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=20181215005806.3856-4-marex@denx.de \
    --to=marex@denx.de \
    --cc=Tristram.Ha@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    --cc=woojung.huh@microchip.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;
as well as URLs for NNTP newsgroup(s).