Avnu / tsn-doc

Documentation on TSN Linux components, interfaces and usage
BSD 3-Clause "New" or "Revised" License
37 stars 21 forks source link

The pmc command need network interface, too #16

Closed zeerd closed 4 years ago

zeerd commented 4 years ago

If the NIC is no eth0 by default, this pmc command will do nothing usefull.

vedangpatel1 commented 4 years ago

Hi Charles,

when we are using pmc, we are communicate with ptp4l daemon (running on the current system) via unix socket. The default for UDS address for communicating is '/var/run/ptp4l'. So, interface name is not needed here and pmc will run as expected and modify the offset between CLOCK_TAI and CLOCK_REALTIME.

If your ptp4l client is using a different UDS address than the default one. You will need to use the '-u' argument to specify that address.

Thanks, Vedang

aguedes commented 4 years ago

If your ptp4l client is using a different UDS address than the default one. You will need to use the '-u' argument to specify that address.

I suppose you meant the "-s" argument here, right @vedangpatel1?

zeerd commented 4 years ago

But , when I add the -i parameter with enp2s0 as the interface name of my I210 network card. It works.

It's strange.

If the pmc command depends on the -s parameter, what is the -i parameter expect to do ?

vedangpatel1 commented 4 years ago

'-i' parameter is only needed if you are trying to use pmc to communicate with a ptp4l daemon which is running on the remote system.

Can you share the full command you are running?

zeerd commented 4 years ago

sudo pmc -u -b 0 -t 1 -i enp2s0 "SET GRANDMASTER_SETTINGS_NP clockClass 248 \ clockAccuracy 0xfe offsetScaledLogVariance 0xffff \ currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 \ ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 \ timeSource 0xa0"

The only thing I added is "-i enp2s0 ".

I will do more tests on this, too.

zeerd commented 4 years ago

Sorry, there must be something wrong from my side. I will close this pull.