From: Kurt Kanzenbach <kurt@linutronix.de>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Richard Cochran <richardcochran@gmail.com>,
Kamil Alkhouri <kamil.alkhouri@hs-offenburg.de>,
netdev@vger.kernel.org, Kurt Kanzenbach <kurt@linutronix.de>
Subject: [PATCH net-next v2 2/4] net: dsa: hellcreek: Add STP forwarding rule
Date: Tue, 14 Dec 2021 14:45:06 +0100 [thread overview]
Message-ID: <20211214134508.57806-3-kurt@linutronix.de> (raw)
In-Reply-To: <20211214134508.57806-1-kurt@linutronix.de>
Treat STP as management traffic. STP traffic is designated for the CPU port
only. In addition, STP traffic has to pass blocked ports.
Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
drivers/net/dsa/hirschmann/hellcreek.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index c4f840b20adf..17d3a4a3582e 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -1075,6 +1075,17 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
.reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */
.reprio_en = 1,
};
+ static struct hellcreek_fdb_entry stp = {
+ /* MAC: 01-80-C2-00-00-00 */
+ .mac = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 },
+ .portmask = 0x03, /* Management ports */
+ .age = 0,
+ .is_obt = 0,
+ .pass_blocked = 1,
+ .is_static = 1,
+ .reprio_tc = 6,
+ .reprio_en = 1,
+ };
int ret;
mutex_lock(&hellcreek->reg_lock);
@@ -1082,6 +1093,9 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
if (ret)
goto out;
ret = __hellcreek_fdb_add(hellcreek, &p2p);
+ if (ret)
+ goto out;
+ ret = __hellcreek_fdb_add(hellcreek, &stp);
out:
mutex_unlock(&hellcreek->reg_lock);
--
2.30.2
next prev parent reply other threads:[~2021-12-14 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 13:45 [PATCH net-next v2 0/4] net: dsa: hellcreek: Fix handling of MGMT protocols Kurt Kanzenbach
2021-12-14 13:45 ` [PATCH net-next v2 1/4] net: dsa: hellcreek: Fix insertion of static FDB entries Kurt Kanzenbach
2021-12-14 20:53 ` Vladimir Oltean
2021-12-14 13:45 ` Kurt Kanzenbach [this message]
2021-12-14 20:55 ` [PATCH net-next v2 2/4] net: dsa: hellcreek: Add STP forwarding rule Vladimir Oltean
2021-12-14 13:45 ` [PATCH net-next v2 3/4] net: dsa: hellcreek: Allow PTP P2P measurements on blocked ports Kurt Kanzenbach
2021-12-14 20:54 ` Vladimir Oltean
2021-12-14 13:45 ` [PATCH net-next v2 4/4] net: dsa: hellcreek: Add missing PTP via UDP rules Kurt Kanzenbach
2021-12-14 20:09 ` [PATCH net-next v2 0/4] net: dsa: hellcreek: Fix handling of MGMT protocols Richard Cochran
2021-12-15 3:00 ` patchwork-bot+netdevbpf
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=20211214134508.57806-3-kurt@linutronix.de \
--to=kurt@linutronix.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kamil.alkhouri@hs-offenburg.de \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=richardcochran@gmail.com \
--cc=vivien.didelot@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