[#5678] ptpd would switch from master to slave status if there is another machine set to master in the lan

Document created by Aaronwu Employee on Sep 5, 2013
Version 1Show Document
  • View in full screen mode

[#5678] ptpd would switch from master to slave status if there is another machine set to master in the lan

Submitted By: Mingquan Pan

Open Date

2009-11-12 05:32:56    

Priority:

Low     Assignee:

Barry Song

Status:

Open     Fixed In Release:

N/A

Found In Release:

2010R1     Release:

Category:

N/A     Board:

N/A

Processor:

BF518     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Under Debugging

Uboot version or rev.:

    Toolchain version or rev.:

trunk head

App binary format:

N/A     

Summary: ptpd would switch from master to slave status if there is another machine set to master in the lan

Details:

 

ptpd would switch from master to slave status if there is another machine set to master in the lan.

 

Connect two bf518F ezbrd onto the company network,

Master one is:

root:/> ifconfig

eth0      Link encap:Ethernet  HWaddr 00:E0:FE:6A:65:53

          inet addr:10.99.29.117  Bcast:10.99.29.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1157 errors:0 dropped:0 overruns:0 frame:0

          TX packets:343 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:146585 (143.1 KiB)  TX bytes:40523 (39.5 KiB)

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

root:/> date

Sat Nov 14 17:16:46 UTC 2009

root:/> ps auxf

  PID USER       VSZ STAT COMMAND

    1 root       108 S    /init

    2 root         0 SW<  [kthreadd]

    3 root         0 SW<  [ksoftirqd/0]

    4 root         0 SW<  [watchdog/0]

    5 root         0 SW<  [events/0]

    6 root         0 SW<  [khelper]

    9 root         0 SW<  [async/mgr]

   56 root         0 SW<  [kblockd/0]

   63 root         0 SW<  [kmmcd]

   81 root         0 SW   [khungtaskd]

   82 root         0 SW   [pdflush]

   83 root         0 SW   [pdflush]

   84 root         0 SW<  [kswapd0]

  199 root         0 SW<  [mtdblockd]

  200 root         0 SW<  [bfin-spi.0]

  202 root         0 SW<  [bfin-spi.1]

  238 root       423 S    -/bin/sh

  239 root        44 S    /sbin/inetd

  240 root       412 S    /sbin/syslogd -n

  241 root       408 S    /sbin/klogd -n

  242 root        36 S    /bin/watchdogd -f -s

  244 root        88 S    dhcpcd

  247 root        56 S    /bin/telnetd

  248 root       423 S    -sh

  266 root        92 S    ptpd -z linux_hw

  273 root       412 R    ps auxf

 

Slave one is:

root:/> date

Sat Nov 14 17:16:29 UTC 2009

root:/> ps auxf

  PID USER       VSZ STAT COMMAND

    1 root       108 S    /init

    2 root         0 SW<  [kthreadd]

    3 root         0 SW<  [ksoftirqd/0]

    4 root         0 SW<  [watchdog/0]

    5 root         0 SW<  [events/0]

    6 root         0 SW<  [khelper]

    9 root         0 SW<  [async/mgr]

   56 root         0 SW<  [kblockd/0]

   63 root         0 SW<  [kmmcd]

   81 root         0 SW   [khungtaskd]

   82 root         0 SW   [pdflush]

   83 root         0 SW   [pdflush]

   84 root         0 SW<  [kswapd0]

  199 root         0 SW<  [mtdblockd]

  200 root         0 SW<  [bfin-spi.0]

  202 root         0 SW<  [bfin-spi.1]

  238 root       423 S    -/bin/sh

  239 root        44 S    /sbin/inetd

  240 root       412 S    /sbin/syslogd -n

  241 root       408 S    /sbin/klogd -n

  242 root        36 S    /bin/watchdogd -f -s

  246 root        92 S    ptpd -z linux_hw -g

  251 root       412 R    ps auxf

root:/> date

Sat Nov 14 17:16:5root:/> ifconfig

eth0      Link encap:Ethernet  HWaddr 00:E0:FE:22:EB:E4

          inet addr:10.99.29.111  Bcast:10.99.29.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:909 (909.0 B)  TX bytes:42 (42.0 B)

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

                                                                                                                                                           1 UTC 2009                                                                                                                              

 

And then, if you reboot the slave one and set it with ptpd -z linux_hw, it would be master and the previous master one would be slave and change the time with it. At this time , on the screen, the date of new slave(previous master) is:

 

oot:/> date

Thu Oct 11 05:56:38 UTC 2035

 

which is the same with the new master(previous slave).

 

 

The kernel version is:

root:/> version

kernel:    Linux release 2.6.31.6-ADI-2010R1-pre-svn7786, build #10 Thu Nov 12 16:22:51 CST 2009

toolchain: bfin-uclinux-gcc release gcc version 4.3.4 (ADI-trunk/svn-3679)

user-dist: release svn-9135, build #3 Thu Nov 12 16:22:18 CST 2009

root:/>

 

 

 

Follow-ups

 

--- Barry Song                                               2009-11-12 11:18:23

Practically, there is one host running "ptpd -z linux_hw" as the

master in the whole network and others run "ptpd -z linux_hw -g" as

slaves. It is not a real-life case for two hosts to run "ptpd -z

linux_hw" as masters. But it doesn't make sense that the 1st master becomes

slave while the 2nd startups. So I will check the state machine of ptpd to find

any possible robustness issue in it.

Thanks for pointing out.

 

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes