On Thu, Dec 08, 2022 at 04:06:08PM EST, Geva, Erez wrote:
>On Mon, 2022-12-05 at 12:52 -0500, vincent.cheng...@renesas.com wrote:
>> On Mon, Dec 05, 2022 at 02:44:07AM EST, Geva, Erez wrote:
>> > On Fri, 2022-12-02 at 15:33 -0500,
>> > vincent.cheng...@renesas.com wrote:
>> > > From: Vincent Cheng <vincent.cheng...@renesas.com>
>> > > 
>> > > In handle_state_decision_event(), the update of the clock's
>> > > parent
>> > > pid after
>> > > best master change is non-deterministic. It depends on the port
>> > > processing
>> > > order and bmc_state_decision() results.
>> > > 
>> > > +static void clock_update_parent_identity(struct clock *c)
>> > > +{
>> > > +       struct parentDS *pds = &c->dad.pds;
>> > > +
>> > > +       if (c->best) {
>> > > +               pds->parentPortIdentity = c->best-
>> > > >dataset.sender;
>> > > +       } else {
>> > > +               pds->parentPortIdentity.clockIdentity = c-
>> > > > dds.clockIdentity;
>> > > +               pds->parentPortIdentity.portNumber    = 0;
>> > 
>> > Why is the port 0?
>> > It make sense that defaultDS do not have port as we work in the
>> > context
>> > of the clock.
>> > Is it make sense to use port ID here?
>> 
>> I would like to say it is port 0 because I consulted 1588-2019.pdf
>> and found the
>> requirement in "Table 30 - Updates for state decision code M1 and
>> M2".
>> 
>>   parentDS.clockIdentity member set to the value of
>> defaultDS.clockIdentity field.
>>   parentDS.parentPortIdentity.portNumber member is 0
>> 
>> However, realistically speaking, I copied the logic from
>> clock_update_grandmaster()
>> and clock_update_slave() first and then looked it up afterwards.
>
>Make sense, please live a comment on the value assignment :-)
>
>Something like ~ "follow IEEE table 30 updates for M1".
>No need for a long one, just a short reference.

Sure thing. Fixed in PATCH v2.  However, clock_update_parent_identity() is
not needed, so put the comment in clock_update_grandmaster().

Vincent



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

Reply via email to