It seems that port_is_ieee8021as(p) returning zero if p->as_capable ==
ALWAYS_CAPABLE was originally intended for skipping checks in
port_capable but this is quite unclear.  There are only three callers
left in the current code and this quirk doesn't seem to make them any
more compliant with either 802.1AS version or the Automotive profile.

On the other hand the calculation of neighborRateRatio (in the Rx path)
can now depend on the return value of port_is_ieee8021as() which seems
to have been the intention, rather than on whether p->follow_up_info is
set.  The description of follow_up_info in the man page implies it
rather affects the Tx path.  (The NRR will also need to be calculated
in a future CMLDS instance, with or without 802.1AS, so this if clause
will change again).

Signed-off-by: Andrew Zaborowski <andrew.zaborow...@intel.com>
---
Vinicius Gomes and myself tried to analyze configurations in which this
behavior may be required but we didn't find any.  The description of
asCapable=true in the man page doesn't talk about non-standard
behavior.  A comment in as_capable.h does but it suggests this is in
order to better support the Automotive Profile which is not consistent
with port_is_ieee8021as() returning 0.

There's a short discussion in
https://github.com/nxp-archive/openil_linuxptp/issues/16
(non-conclusive)
---
 port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/port.c b/port.c
index 76f817c..5e9bd6f 100644
--- a/port.c
+++ b/port.c
@@ -852,7 +852,7 @@ static int port_sync_incapable(struct port *p)
 static int port_is_ieee8021as(struct port *p)
 {
        if (p->asCapable == ALWAYS_CAPABLE) {
-               return 0;
+               return 1;
        }
        return p->follow_up_info ? 1 : 0;
 }
@@ -2435,7 +2435,7 @@ static void port_peer_delay(struct port *p)
 calc:
        t3c = tmv_add(t3, tmv_add(c1, c2));
 
-       if (p->follow_up_info)
+       if (port_is_ieee8021as(p))
                port_nrate_calculate(p, t3c, t4);
 
        tsproc_set_clock_rate_ratio(p->tsproc, p->nrate.ratio *
-- 
2.34.1



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

Reply via email to