net: dsa: hellcreek: Allow PTP on blocked ports
Kurt Kanzenbach
maintainerPATCH 1/1 net: dsa: hellcreek: Allow PTP on blocked ports
PTP forms its own clock distribution tree. Therefore, PTP traffic is allowed to traverse blocked ports by STP. Adjust the static FDB entries accordingly.
--- drivers/net/dsa/hirschmann/hellcreek.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/dsa/hirschmann/hellcreek.c +7 -4
@@ -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,
Signature · 1 line
2.30.2
drivers/net/dsa/hirschmann/hellcreek.c static int hellcreek_setup_fdb(struct hellcreek *hellcreek) · line 1061
Quoted 6 lines · Kurt Kanzenbach
drivers/net/dsa/hirschmann/hellcreek.c +1
-1@@ -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.
drivers/net/dsa/hirschmann/hellcreek.c static int hellcreek_setup_fdb(struct hellcreek *hellcreek) · line 1072
Quoted 9 lines
drivers/net/dsa/hirschmann/hellcreek.c +1
-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,
This one is okay.
Quoted 6 lines
drivers/net/dsa/hirschmann/hellcreek.c +0
-0.is_static = 1, .reprio_tc = 6, /* TC: 6 as per IEEE 802.1AS */ .reprio_en = 1,Signature · 1 line
2.30.2
Thanks,
Richard
Kurt Kanzenbach
maintainerHi Richard,
Quoted 10 lines · Richard Cochran
drivers/net/dsa/hirschmann/hellcreek.c static int hellcreek_setup_fdb(struct hellcreek *hellcreek) · line 1061
Quoted 6 lines · Kurt Kanzenbach
drivers/net/dsa/hirschmann/hellcreek.c +1
-1@@ -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