Thread: [Linuxptp-users] unabel to start ptp4l service in centos 7.4
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Raveendra M. <rav...@gm...> - 2019-03-13 12:49:54
|
I am using following kernel version in development machine 3.10.0-rt56 #2 SMP PREEMPT RT Tue May 22 08:44:25 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux Hardware capbility of ethernet nic card [root@2-9 ~]# ethtool -T eth0 Time stamping parameters for eth0: Capabilities: software-receive (SOF_TIMESTAMPING_RX_SOFTWARE) software-system-clock (SOF_TIMESTAMPING_SOFTWARE) PTP Hardware Clock: none Hardware Transmit Timestamp Modes: none Hardware Receive Filter Modes: none [root@2-9 ~]# After installing started the ptp4l service [root@2-9 ~]# systemctl start ptp4l [root@2-9 ~]# systemctl status ptp4l â— ptp4l.service - Precision Time Protocol (PTP) service Loaded: loaded (/usr/lib/systemd/system/ptp4l.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2019-03-13 17:56:17 IST; 5s ago Process: 8939 ExecStart=/usr/sbin/ptp4l $OPTIONS (code=exited, status=255) Main PID: 8939 (code=exited, status=255) Syslog captured following log Mar 13 17:56:17 2-9.mavenir1.com systemd[1]: Started Precision Time Protocol (PTP) service. Mar 13 17:56:17 2-9.mavenir1.com systemd[1]: Starting Precision Time Protocol (PTP) service... Mar 13 17:56:17 2-9.mavenir1.com ptp4l[8939]: failed to create a clock Mar 13 17:56:17 2-9.mavenir1.com systemd[1]: ptp4l.service: main process exited, code=exited, status=255/n/a Mar 13 17:56:17 2-9.mavenir1.com systemd[1]: Unit ptp4l.service entered failed state. Mar 13 17:56:17 2-9.mavenir1.com systemd[1]: ptp4l.service failed. ar 13 17:54:16 2-9 systemd: Starting Session 2998 of user root. Mar 13 17:55:05 2-9 systemd: Reloading. Mar 13 17:55:05 2-9 kernel: hrtimer: interrupt took 10571539 ns Mar 13 17:56:17 2-9 systemd: Started Precision Time Protocol (PTP) service. Mar 13 17:56:17 2-9 systemd: Starting Precision Time Protocol (PTP) service... Mar 13 17:56:17 2-9 ptp4l: [1397593.140] interface 'eth0' does not support requested timestamping mode Mar 13 17:56:17 2-9 ptp4l: failed to create a clock Mar 13 17:56:17 2-9 systemd: ptp4l.service: main process exited, code=exited, status=255/n/a Mar 13 17:56:17 2-9 systemd: Unit ptp4l.service entered failed state. Mar 13 17:56:17 2-9 systemd: ptp4l.service failed. Any suggestion how ptp4l service can be started and also use software based timestamping for ptp protocol. Thanking you, Raveendra M |
From: Miroslav L. <mli...@re...> - 2019-03-13 12:55:13
|
On Wed, Mar 13, 2019 at 06:19:34PM +0530, Raveendra Muniyappa wrote: > [root@2-9 ~]# ethtool -T eth0 > Time stamping parameters for eth0: > Capabilities: > software-receive (SOF_TIMESTAMPING_RX_SOFTWARE) > software-system-clock (SOF_TIMESTAMPING_SOFTWARE) > Mar 13 17:56:17 2-9 ptp4l: [1397593.140] interface 'eth0' does not support > requested timestamping mode > Any suggestion how ptp4l service can be started and also use software based > timestamping for ptp protocol. ptp4l cannot be started on this interface. It requires the SOF_TIMESTAMPING_TX_SOFTWARE capability, which is not printed by ethtool. -- Miroslav Lichvar |
From: Raveendra M. <rav...@gm...> - 2019-03-13 13:18:16
|
I found some information regarding SOF_TIMESTAMPING_TX_SOFTWARE capability https://sourceforge.net/p/linuxptp/mailman/message/35474590/ You need to add one line to the transmit path in the driver: skb_tx_timestamp(skb); Quoting include/linux/skbuff.h: * skb_tx_timestamp() - Driver hook for transmit timestamping * * Ethernet MAC Drivers should call this function in their hard_xmit() * function immediately before giving the sk_buff to the MAC hardware. * * Specifically, one should make absolutely sure that this function is * called before TX completion of this packet can trigger. Otherwise * the packet could potentially already be freed. if I modify the nic driver with above changes then will ptp4l able to start the ptp service ? Regards, Raveendra On Wed, Mar 13, 2019 at 6:25 PM Miroslav Lichvar <mli...@re...> wrote: > On Wed, Mar 13, 2019 at 06:19:34PM +0530, Raveendra Muniyappa wrote: > > [root@2-9 ~]# ethtool -T eth0 > > Time stamping parameters for eth0: > > Capabilities: > > software-receive (SOF_TIMESTAMPING_RX_SOFTWARE) > > software-system-clock (SOF_TIMESTAMPING_SOFTWARE) > > > Mar 13 17:56:17 2-9 ptp4l: [1397593.140] interface 'eth0' does not > support > > requested timestamping mode > > > Any suggestion how ptp4l service can be started and also use software > based > > timestamping for ptp protocol. > > ptp4l cannot be started on this interface. It requires the > SOF_TIMESTAMPING_TX_SOFTWARE capability, which is not printed by > ethtool. > > -- > Miroslav Lichvar > |
From: Miroslav L. <mli...@re...> - 2019-03-13 13:46:49
|
On Wed, Mar 13, 2019 at 06:47:56PM +0530, Raveendra Muniyappa wrote: > I found some information regarding SOF_TIMESTAMPING_TX_SOFTWARE capability > > > https://sourceforge.net/p/linuxptp/mailman/message/35474590/ > > > You need to add one line to the transmit path in the driver: > > skb_tx_timestamp(skb); > if I modify the nic driver with above changes then will ptp4l able to > start the ptp service ? Yes. I'd suggest to look at the current Linux code. It's likely the driver already has this call and you would just backport that change to your kernel. -- Miroslav Lichvar |