> -----Original Message-----
> From: vincent.cheng...@renesas.com <vincent.cheng...@renesas.com>
> Sent: Sunday, March 13, 2022 10:01 PM
> To: linuxptp-devel@lists.sourceforge.net
> Subject: [Linuxptp-devel] [PATCH v2 0/4] port: Cancel unicast service when
> closing port.
> 
> From: Vincent Cheng <vincent.cheng...@renesas.com>
> 
> ptp4l currently does not cancel unicast service on program exit.
> This causes problems for subsequent ptp4l session that is using different
> masters.
> 
> Below example has debug statements to print out announce master address and
> received packet address.
> 
> Start unicast slave session with master 10.64.10.13, and unicast_req_duration
> 300.
> 
>   ptp4l[682807.352]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
>   ptp4l[682811.352]: debug: announce master 10.64.10.13
>   ptp4l[682812.770]: debug: sk_receive from 10.64.10.13
>   ptp4l[682812.810]: debug: sk_receive from 10.64.10.13
>   ptp4l[682813.120]: selected local clock 000a35.fffe.002201 as best master
>   ptp4l[682814.755]: port 1 (eth0): new foreign master 84c807.fffe.10c570-1
> 
> Exit ptp4l.
> 
> The unicast master continues to send SYNC packets to slave until renewal 
> period
> expires.
> 
> Start unicast same slave, but different master 10.64.10.14.  This master is 
> not
> online, so ptp4l should choose local clock as best master.
> 
> However, because there is no checking of received unicast master to configured
> unicast table, ptp4l is quite content with packets from previous master
> 10.64.10.13.
> 
>   ptp4l[682848.858]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
>   ptp4l[682848.892]: debug: sk_receive from 10.64.10.13
>   ...
>   ptp4l[682850.704]: debug: sk_receive from 10.64.10.13
>   ptp4l[682850.751]: debug: sk_receive from 10.64.10.13
>   ptp4l[682850.751]: port 1 (eth0): new foreign master 84c807.fffe.10c570-1
>   ptp4l[682850.766]: debug: sk_receive from 10.64.10.13
>   ...
>   ptp4l[682852.829]: debug: sk_receive from 10.64.10.13
>   ptp4l[682852.858]: debug: announce master 10.64.10.14
>   ptp4l[682852.891]: debug: sk_receive from 10.64.10.13
>   ptp4l[682854.751]: port 1 (eth0): LISTENING to UNCALIBRATED on RS_SLAVE
>   ptp4l[682854.766]: debug: sk_receive from 10.64.10.13
>   ...
>   ptp4l[682854.891]: master offset      -3269 s0 freq    -397 path delay      
> 4757
> 
> Add check to ensure a unicast client will check the source address of an 
> announce
> message is from an entry in the unicast master table before adding to foreign
> master table.
> Add canceling unicast session on exit so that subsequent session is not 
> polluted
> by lingering unicast session traffic.
> 

So with this series, we now fix our program to be nice and stop the session, 
and we also fix our program to verify that we got a valid unicast address 
before accepting it.

Excellent.

> Vincent Cheng (4):
>   unicast: Add support to check if message was received from an entry in
>     the unicast master table.
>   unicast: Add support to send CANCEL_UNICAST_TRANSMISSION TLVs.
>   port: unicast client - do not add master to foreign master table if
>     not in the unicast master table.
>   port: cancel unicast transmission when closing port.
> 
>  port.c           | 44 +++++++++++++++++++++++++++++++-
>  unicast_client.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++
>  unicast_client.h | 19 ++++++++++++++
>  3 files changed, 128 insertions(+), 1 deletion(-)
> 
> --
> 2.34.1
> 
> 
> 
> _______________________________________________
> Linuxptp-devel mailing list
> Linuxptp-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to