Re: [Linuxptp-devel] [PATCH] add report of PTP_SYS_OFFSET_PRECISE support to phc_ctl

2018-08-20 Thread Miroslav Lichvar
On Sat, Aug 18, 2018 at 10:07:59AM -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 03:22:51PM +, FUSTE Emmanuel wrote:
> > diff --git a/phc_ctl.c b/phc_ctl.c
> > index 4a78a19..f6234da 100644
> > --- a/phc_ctl.c
> > +++ b/phc_ctl.c
> > @@ -353,12 +353,14 @@ static int do_caps(clockid_t clkid, int cmdc, char 
> > *cmdv[])
> > "  %d programable alarms\n"
> > "  %d external time stamp channels\n"
> > "  %d programmable periodic signals\n"
> > -   "  %s pulse per second support",
> > +   "  %s pulse per second support\n"
> > +   "  %s precise system-device cross timestamps support",
> 
> This patch looks okay, but we want a newline here --^

Do we? In this case the string is printed by pr_notice(), which should
add a newline automatically when printing to terminal.

-- 
Miroslav Lichvar

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH RFC 0/3] Basis for SNMP support

2018-08-20 Thread Richard Cochran
On Mon, Aug 20, 2018 at 08:03:58AM +, Anders Selhammer wrote:
> I guess you want me to update the serie with the updates before, right?

Yes, please.  IIRC, you had some additional changes...

Thanks,
Richard

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH] add report of PTP_SYS_OFFSET_PRECISE support to phc_ctl

2018-08-20 Thread Richard Cochran
On Mon, Aug 20, 2018 at 09:00:33AM +0200, Miroslav Lichvar wrote:
> Do we? In this case the string is printed by pr_notice(), which should
> add a newline automatically when printing to terminal.

Oh, you're right.  Never mind!

Thanks,
Richard

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [PATCH RFC 0/3] Basis for SNMP support

2018-08-20 Thread Anders Selhammer
Thursday, July 26, 2018 9:34 AM

>Thursday, July 26, 2018 2:39 AM

>> Sounds good.
>You will apply the series without updates and I include it in next series then?
>Then I do not need to poll the mail the next few days 😊
Hi
Im back from vacation and since you have not applied the patches yet,
I guess you want me to update the serie with the updates before, right?

/Anders
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


[Linuxptp-devel] Master still sends out DELAY_REQ

2018-08-20 Thread Vincent Li X

Hi,
We found a tricky scenario is that after port goes from SLAVE->MASTER state, it 
still sends out DELAY_REQ continuously by default interval. Given that we are 
running interval as -6, the delay interval is random(0, 2*2pow interval), the 
timer could be short.
Could the reason be like this?

  1.  Event we cancel the FD_DELAY_TIMER?

static void port_e2e_transition(struct port *p, enum port_state next)

{

port_clr_tmo(p->fda.fd[FD_ANNOUNCE_TIMER]);

port_clr_tmo(p->fda.fd[FD_SYNC_RX_TIMER]);

port_clr_tmo(p->fda.fd[FD_DELAY_TIMER]);



  1.  But there is already timeout event on epoll?
  2.  Soon epoll event comes, we re-arm the FD_DELAY_TIMER again.

enum fsm_event port_event(struct port *p, int fd_index)

{

...

case FD_DELAY_TIMER:

pr_debug("port %hu: delay timeout", 
portnum(p));

port_set_delay_tmo(p);

return port_delay_request(p) ? 
EV_FAULT_DETECTED : EV_NONE;

  1.  Then it repeats.

BR,
Vincent
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] Master still sends out DELAY_REQ

2018-08-20 Thread Richard Cochran
On Mon, Aug 20, 2018 at 03:20:12PM +, Vincent Li X wrote:
> Could the reason be like this?
> 
>   1.  Event we cancel the FD_DELAY_TIMER?
...
>   1.  But there is already timeout event on epoll?
>   2.  Soon epoll event comes, we re-arm the FD_DELAY_TIMER again.

This was changed in:

commit a8b66ce7f24a3e031712b4352dd48780540018ba
Author: Richard Cochran 
Date:   Wed May 16 06:44:56 2018 -0700

Fix crash in hybrid E2E mode.

Now the delay timer event is handled before the announce receipt timeout.

What version are you running?

Thanks,
Richard

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 0/5] Adding support for AVnu Automotive Profile

2018-08-20 Thread Patel, Vedang
Thanks for the feedback Richard.

On Fri, 2018-08-17 at 23:33 -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 10:42:10AM -0700, Vedang Patel wrote:
> > 
> > 
> > Changes in V2:
> > ~~~
> This looks a lot better, thanks!  I'll have a few small comments on
> the patches...
>  
> > 
> > Some Opens: 
> > - Currently, we are using masterOnly (a per-port config option) and
> > slaveOnly
> >   (a global config option) to determine role of the devices. This
> > configuration
> >   option might be a little confusing to a new comer. One idea is to
> > change
> >   slaveOnly to per-port config option. Are there any other ideas
> > for this or
> >   the current way is not as confusing as I think?
> Most users only have a single port.  Probably automotive will also
> mainly be single port devices.  Anyone making a BC or TC already has
> a
> super confusing swamp full of options to wade through.  In other
> words, I expect such "power users" to know what they are doing.
> 
makes sense.
> > 
> > - In port_p2p_transition(), we are setting up the delay timer when
> > BMCA is set
> >   as ‘noop’. Usually it is initialized then the device transitions
> > to
> >   PS_LISTENING. But, we are skipping the LISTENING state.
> These exceptional cases in the series don't seem too bad to me.
> 
> > 
> >   Another alternative
> >   is to transition to PS_LISTENING and then unconditionally
> > transfer to
> >   PS_MASTER/PS_SLAVE.
> What do you mean by "unconditionally"?  State transitions are
> triggered by events.
> 
Yeah, now that I think of it, I don't think triggering anything
unconditionally is going to work.

-Vedang
> Thanks,
> Richard
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 0/5] Adding support for AVnu Automotive Profile

2018-08-20 Thread Patel, Vedang
On Fri, 2018-08-17 at 23:50 -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 10:42:10AM -0700, Vedang Patel wrote:
> > 
> > - In port_p2p_transition(), we are setting up the delay timer when
> > BMCA is set
> >   as ‘noop’. Usually it is initialized then the device transitions
> > to
> >   PS_LISTENING. But, we are skipping the LISTENING state. Another
> > alternative
> >   is to transition to PS_LISTENING and then unconditionally
> > transfer to
> >   PS_MASTER/PS_SLAVE. But, that seems more of an hack than what is
> > currently
> >   being done. Any other alternatives?
> Maybe we can reset the delay timer unconditionally when entering
> SLAVE
> or MASTER.  It will cause a minor glitch in the delay timing, but
> will
> it matter?
> 
This will just mean that the interval between path delay calculation
might be atmost 2* delay_interval when you calculate delay the first
time after transition to master/slave state. I don't any immediate
issue with that. Will have to run some tests and see what really
happens.

Thanks,
Vedang
> Thanks,
> Richard
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 0/5] Adding support for AVnu Automotive Profile

2018-08-20 Thread Patel, Vedang
On Sat, 2018-08-18 at 00:03 -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 10:42:10AM -0700, Vedang Patel wrote:
> > 
> > - In port_p2p_transition(), we are setting up the delay timer when
> > BMCA is set
> >   as ‘noop’. Usually it is initialized then the device transitions
> > to
> >   PS_LISTENING. But, we are skipping the LISTENING state. Another
> > alternative
> >   is to transition to PS_LISTENING and then unconditionally
> > transfer to
> >   PS_MASTER/PS_SLAVE. But, that seems more of an hack than what is
> > currently
> >   being done. Any other alternatives?
> Another idea:
> 
> Can you have INITIALIZING -> LISTENING, and arrange for
> EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES to happen right away?
> 
> Then your fsm does LISTENING -> SLAVE on the
> EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES event.
> 
> (haven't looked at arranging that timeout, just brainstorming...)
> 
We can do something on the lines of the following (completely untested)
snippet:

diff --git a/port.c b/port.c
index f4a9fbb5a8d7..214a8329d27e 100644
--- a/port.c
+++ b/port.c
@@ -1623,7 +1623,7 @@ int port_initialize(struct port *p)
p->fda.fd[FD_FIRST_TIMER + i] = fd[i];
}
 
-   if (port_set_announce_tmo(p)) {
+   if (set_tmo_log(p->fda.fd[FD_ANNOUNCE_TIMER], 1, -10)) {
goto no_tmo;
}
if (unicast_client_enabled(p) && unicast_client_set_tmo(p)) {
        
This way, the timer will fire once (immediately after it's setup) even
if inhibit_announce is set. 

But, there is going to be a likely effect on the normal working of
linuxptp. We can fix this by only doing this when BMCA == noop. Again,
will have to actually test this to see what issues might pop up.

Thanks,
Vedang
> Thanks,
> Richard
> 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 2/5] Add BMCA config option.

2018-08-20 Thread Patel, Vedang
On Sat, 2018-08-18 at 00:07 -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 10:42:12AM -0700, Vedang Patel wrote:
> > 
> > diff --git a/fsm.c b/fsm.c
> > index ce6efad30937..a0c98891e39f 100644
> > --- a/fsm.c
> > +++ b/fsm.c
> > @@ -335,3 +335,103 @@ enum port_state ptp_slave_fsm(enum port_state
> > state, enum fsm_event event,
> >  
> >     return next;
> >  }
> > +
> > +enum port_state designated_master_fsm(enum port_state state,
> > +     enum fsm_event event,
> > +     int mdiff)
> > +{
>   ...
> > 
> > +}
> > +
> > +enum port_state designated_slave_fsm(enum port_state state,
> > +    enum fsm_event event,
> > +    int mdiff)
> > +{
>   ...
> > 
> > +}
> Can these two go into their own, new file?
> 
Yeah will move them out and name the file designated_fsm.c/.h.
> > 
> > @@ -2853,10 +2868,24 @@ struct port *port_open(int phc_index,
> >     goto err_port;
> >     }
> >  
> > -   p->state_machine = clock_slave_only(clock) ? ptp_slave_fsm
> > : ptp_fsm;
> >     p->phc_index = phc_index;
> >     p->jbod = config_get_int(cfg, interface->name,
> > "boundary_clock_jbod");
> >     transport = config_get_int(cfg, interface->name,
> > "network_transport");
> > +   p->master_only = config_get_int(cfg, p->name,
> > "masterOnly");
> > +   p->bmca = config_get_int(cfg, p->name, "BMCA");
> > +
> > +   if (p->bmca == BMCA_NOOP && transport != TRANS_UDS) {
> > +   if (p->master_only) {
> > +   p->state_machine = designated_master_fsm;
> > +   } else if (clock_slave_only(clock)) {
> > +   p->state_machine = designated_slave_fsm;
> > +   } else {
> > +   pr_err("Please enable atleast one of
> > masterOnly or slaveOnly when BMCA == noop.\n");
> "at least" ---^
> 
Will fix this.

Thanks,
Vedang
> Thanks,
> Richard
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 4/5] Add ignore_source_id config option.

2018-08-20 Thread Patel, Vedang
On Sat, 2018-08-18 at 00:11 -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 10:42:14AM -0700, Vedang Patel wrote:
> 
> > 
> > +static int check_source_identity(struct port *p, struct
> > ptp_message *m)
> > +{
> > +   struct PortIdentity master;
> > +
> > +   if (!p->ignore_source_id) {
> > +   master = clock_parent_identity(p->clock);
> > +   if (!pid_eq(&master, &m-
> > >header.sourcePortIdentity)) {
> > +   return -1;
> > +   }
> > +   }
> > +   return 0;
> > +}
> I prefer an "early out" pattern, like:
> 
>   if (p->ignore_source_id) {
>   return 0;
>   }
>   master = clock_parent_identity(p->clock);
>   if (!pid_eq(&master, &m->header.sourcePortIdentity)) {
>   return -1;
>   }
>   return 0;
> 
> or even:
> 
>   if (p->ignore_source_id) {
>   return 0;
>   }
>   master = clock_parent_identity(p->clock);
>   return pid_eq(&master, &m->header.sourcePortIdentity) ? 0 : -1;
> 
Will include the second version in v3.

Thanks,
Vedang
> Thanks,
> Richard
> 
> 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 5/5] Add example configuration for AVnu Automotive Profile.

2018-08-20 Thread Patel, Vedang
On Sat, 2018-08-18 at 00:22 -0400, Richard Cochran wrote:
> On Thu, Aug 16, 2018 at 10:42:15AM -0700, Vedang Patel wrote:
> > 
> >  create mode 100644 configs/AVnu-master.cfg
> >  create mode 100644 configs/AVnu-slave.cfg
> IIRC, AVnu had some earlier best practice paper about using 802.1-AS.
> So maybe these file names should include the word "automotive" in
> them.
> 
> Actually, considering this
> 
>    https://trademarks.justia.com/778/57/avnu-77857554.html
> 
> we should avoid the word AVnu altogether.
> 
Yeah. Renaming files to automotive-{master,slave}.cfg.

Also, do you want me to remove AVnu from the whole series code/commit
message or just the config file names?

Thanks,
Vedang
> Thanks,
> Richard
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel


Re: [Linuxptp-devel] [RFC v2 5/5] Add example configuration for AVnu Automotive Profile.

2018-08-20 Thread Richard Cochran
On Tue, Aug 21, 2018 at 12:51:18AM +, Patel, Vedang wrote:
> Also, do you want me to remove AVnu from the whole series code/commit
> message or just the config file names?

I would just remove the word "AVnu" everywhere and just say, the
automotive profile.  I want to avoid making the impression that AVnu
somehow sponsors or endorsesour implementation.

You can keep the link to the PDF in the cover letter.

Thanks,
Richard

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel