* [PATCH net] net: dsa: hellcreek: Allow PTP on blocked ports
@ 2021-12-13 10:18 Kurt Kanzenbach
2021-12-13 12:14 ` Richard Cochran
0 siblings, 1 reply; 3+ messages in thread
From: Kurt Kanzenbach @ 2021-12-13 10:18 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski
Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
Richard Cochran, Kamil Alkhouri, netdev, Kurt Kanzenbach
PTP forms its own clock distribution tree. Therefore, PTP traffic is allowed to
traverse blocked ports by STP. Adjust the static FDB entries accordingly.
Fixes: ddd56dfe52c9 ("net: dsa: hellcreek: Add PTP clock support")
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
drivers/net/dsa/hirschmann/hellcreek.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index 4e0b53d94b52..072fc442cde2 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -710,8 +710,9 @@ static int __hellcreek_fdb_add(struct hellcreek *hellcreek,
u16 meta = 0;
dev_dbg(hellcreek->dev, "Add static FDB entry: MAC=%pM, MASK=0x%02x, "
- "OBT=%d, REPRIO_EN=%d, PRIO=%d\n", entry->mac, entry->portmask,
- entry->is_obt, entry->reprio_en, entry->reprio_tc);
+ "OBT=%d, PASS_BLOCKED=%d, REPRIO_EN=%d, PRIO=%d\n", entry->mac,
+ entry->portmask, entry->is_obt, entry->pass_blocked,
+ entry->reprio_en, entry->reprio_tc);
/* Add mac address */
hellcreek_write(hellcreek, entry->mac[1] | (entry->mac[0] << 8), HR_FDBWDH);
@@ -722,6 +723,8 @@ static int __hellcreek_fdb_add(struct hellcreek *hellcreek,
meta |= entry->portmask << HR_FDBWRM0_PORTMASK_SHIFT;
if (entry->is_obt)
meta |= HR_FDBWRM0_OBT;
+ if (entry->pass_blocked)
+ meta |= HR_FDBWRM0_PASS_BLOCKED;
if (entry->reprio_en) {
meta |= HR_FDBWRM0_REPRIO_EN;
meta |= entry->reprio_tc << HR_FDBWRM0_REPRIO_TC_SHIFT;
@@ -1055,7 +1058,7 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
.portmask = 0x03, /* Management ports */
.age = 0,
.is_obt = 0,
- .pass_blocked = 0,
+ .pass_blocked = 1,
.is_static = 1,
.reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */
.reprio_en = 1,
@@ -1066,7 +1069,7 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
.portmask = 0x03, /* Management ports */
.age = 0,
.is_obt = 0,
- .pass_blocked = 0,
+ .pass_blocked = 1,
.is_static = 1,
.reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */
.reprio_en = 1,
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: dsa: hellcreek: Allow PTP on blocked ports
2021-12-13 10:18 [PATCH net] net: dsa: hellcreek: Allow PTP on blocked ports Kurt Kanzenbach
@ 2021-12-13 12:14 ` Richard Cochran
2021-12-14 8:13 ` Kurt Kanzenbach
0 siblings, 1 reply; 3+ messages in thread
From: Richard Cochran @ 2021-12-13 12:14 UTC (permalink / raw)
To: Kurt Kanzenbach
Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Vivien Didelot,
Florian Fainelli, Vladimir Oltean, Kamil Alkhouri, netdev
On Mon, Dec 13, 2021 at 11:18:10AM +0100, Kurt Kanzenbach wrote:
> @@ -1055,7 +1058,7 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
> .portmask = 0x03, /* Management ports */
> .age = 0,
> .is_obt = 0,
> - .pass_blocked = 0,
> + .pass_blocked = 1,
This one should stay blocked.
> .is_static = 1,
> .reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */
> .reprio_en = 1,
> @@ -1066,7 +1069,7 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
> .portmask = 0x03, /* Management ports */
> .age = 0,
> .is_obt = 0,
> - .pass_blocked = 0,
> + .pass_blocked = 1,
This one is okay.
> .is_static = 1,
> .reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */
> .reprio_en = 1,
> --
> 2.30.2
>
Thanks,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: dsa: hellcreek: Allow PTP on blocked ports
2021-12-13 12:14 ` Richard Cochran
@ 2021-12-14 8:13 ` Kurt Kanzenbach
0 siblings, 0 replies; 3+ messages in thread
From: Kurt Kanzenbach @ 2021-12-14 8:13 UTC (permalink / raw)
To: Richard Cochran
Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Vivien Didelot,
Florian Fainelli, Vladimir Oltean, Kamil Alkhouri, netdev
[-- Attachment #1: Type: text/plain, Size: 785 bytes --]
Hi Richard,
On Mon Dec 13 2021, Richard Cochran wrote:
> On Mon, Dec 13, 2021 at 11:18:10AM +0100, Kurt Kanzenbach wrote:
>
>> @@ -1055,7 +1058,7 @@ static int hellcreek_setup_fdb(struct hellcreek *hellcreek)
>> .portmask = 0x03, /* Management ports */
>> .age = 0,
>> .is_obt = 0,
>> - .pass_blocked = 0,
>> + .pass_blocked = 1,
>
> This one should stay blocked.
You're right. I confirmed with Hirschmann. Only peer delay measurements
should be allowed on blocked ports. In addition, we also have to add
static entries for STP with pass_blocked bit set. Furthermore, the UDP
entries are missing as well. Currently it only works for 802.1AS even
though the driver happily announces V2_EVENT capability.
I'll clean it up and resend properly.
Thanks,
Kurt
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-14 8:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-13 10:18 [PATCH net] net: dsa: hellcreek: Allow PTP on blocked ports Kurt Kanzenbach
2021-12-13 12:14 ` Richard Cochran
2021-12-14 8:13 ` Kurt Kanzenbach
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).