Skip to content

Commit 43ebceb

Browse files
committed
docs(linux): Add PTP support documentation for HSR and PRP offload
Document PTP synchronization support over HSR and PRP interfaces using the linuxptp-hsr implementation (hsr_prp_v2_plus branch). Add Prerequisites, Running PTP, and Verifying PTP Synchronization subsections to both HSR_Offload.rst and PRP_Offload.rst covering: - Cloning and building linuxptp-hsr - Patching config files with interface names and p2p_dst_mac - Running ptp4l with master/slave configs - Verifying sync via master offset values Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
1 parent 6448b30 commit 43ebceb

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/HSR_Offload.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,62 @@ Example:
339339
340340
# ip maddr del 01:80:c4:00:00:0e dev hsr0.5
341341
342+
.. rubric:: *PTP Support*
343+
344+
PTP (Precision Time Protocol) synchronization over HSR is supported using the
345+
`linuxptp-hsr <https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/linuxptp-hsr.git>`_
346+
implementation on the ``hsr_prp_v2_plus`` branch.
347+
348+
.. rubric:: Prerequisites
349+
350+
Clone and build linuxptp-hsr on each HSR node:
351+
352+
.. code-block:: console
353+
354+
git clone https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/linuxptp-hsr.git
355+
cd linuxptp-hsr
356+
git checkout hsr_prp_v2_plus
357+
358+
Patch the config files with the actual interface names and the P2P destination MAC address:
359+
360+
.. code-block:: console
361+
362+
sed -i '/^delay_mechanism P2P/a p2p_dst_mac 01:1B:19:00:00:01' configs/hsr-master.cfg configs/hsr-slave.cfg
363+
sed -i 's/^\[eth1\]/[<INTF_A>]/; s/^\[eth2\]/[<INTF_B>]/' configs/hsr-master.cfg configs/hsr-slave.cfg
364+
365+
Build and install:
366+
367+
.. code-block:: console
368+
369+
make && make install
370+
371+
.. rubric:: Running PTP
372+
373+
Set up the HSR interface as described in the Introduction section. On the PTP master node:
374+
375+
.. code-block:: console
376+
377+
./ptp4l -f configs/hsr-master.cfg
378+
379+
On each PTP slave node:
380+
381+
.. code-block:: console
382+
383+
./ptp4l -f configs/hsr-slave.cfg
384+
385+
.. rubric:: Verifying PTP Synchronization
386+
387+
PTP synchronization can be verified by inspecting the ``master offset`` values in the
388+
ptp4l log output.
389+
390+
Sample ptp4l output showing a synchronized slave:
391+
392+
.. code-block:: text
393+
394+
ptp4l[xx.xxx]: master offset -123 s2 freq +4321 path delay 543
395+
ptp4l[xx.xxx]: master offset 45 s2 freq +4290 path delay 541
396+
ptp4l[xx.xxx]: master offset -78 s2 freq +4310 path delay 544
397+
342398
.. rubric:: Performance
343399

344400
This section describes the throughput and CPU usage metrics in the offload case

source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRP_Offload.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,62 @@ Example:
309309
310310
# ip maddr del 01:80:c4:00:00:0e dev prp0.5
311311
312+
.. rubric:: *PTP Support*
313+
314+
PTP (Precision Time Protocol) synchronization over PRP is supported using the
315+
`linuxptp-hsr <https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/linuxptp-hsr.git>`_
316+
implementation on the ``hsr_prp_v2_plus`` branch.
317+
318+
.. rubric:: Prerequisites
319+
320+
Clone and build linuxptp-hsr on each PRP node:
321+
322+
.. code-block:: console
323+
324+
git clone https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/linuxptp-hsr.git
325+
cd linuxptp-hsr
326+
git checkout hsr_prp_v2_plus
327+
328+
Patch the config files with the actual interface names and the P2P destination MAC address:
329+
330+
.. code-block:: console
331+
332+
sed -i '/^delay_mechanism P2P/a p2p_dst_mac 01:1B:19:00:00:01' configs/prp-master.cfg configs/prp-slave.cfg
333+
sed -i 's/^\[eth1\]/[<INTF_A>]/; s/^\[eth2\]/[<INTF_B>]/' configs/prp-master.cfg configs/prp-slave.cfg
334+
335+
Build and install:
336+
337+
.. code-block:: console
338+
339+
make && make install
340+
341+
.. rubric:: Running PTP
342+
343+
Set up the PRP interface as described above. On the PTP master node:
344+
345+
.. code-block:: console
346+
347+
./ptp4l -f configs/prp-master.cfg
348+
349+
On the PTP slave node:
350+
351+
.. code-block:: console
352+
353+
./ptp4l -f configs/prp-slave.cfg
354+
355+
.. rubric:: Verifying PTP Synchronization
356+
357+
PTP synchronization can be verified by inspecting the ``master offset`` values in the
358+
ptp4l log output.
359+
360+
Sample ptp4l output showing a synchronized slave:
361+
362+
.. code-block:: text
363+
364+
ptp4l[xx.xxx]: master offset -123 s2 freq +4321 path delay 543
365+
ptp4l[xx.xxx]: master offset 45 s2 freq +4290 path delay 541
366+
ptp4l[xx.xxx]: master offset -78 s2 freq +4310 path delay 544
367+
312368
.. rubric:: Performance
313369

314370
This section describes the throughput and CPU usage metrics in the offload case

0 commit comments

Comments
 (0)