On Wed, Jul 13, 2022 at 03:33:06PM +0200, Marco Davids (SIDN) via 
Linuxptp-users wrote:
> Most of the time when I reboot this Linux server, ptp0 is connected to eno1:
> 
> ptp4l: [18.144] eno1 selected /dev/ptp0 as PTP clock
> 
> But sometimes this is ptp1, which is pretty annoying:
> 
> ptp4l: [18.745] eno1 selected /dev/ptp1 as PTP clock
> 
> Does anyone has a suggestion on how to prevent this and make the mapping
> between interface and ptp device more robust?

Beside custom scripts determining the mapping, it's possible to use
udev rules (e.g. /etc/udev/rules.d/80-phc.rules) like this:

KERNEL=="ptp[0-9]*", 
DEVPATH=="/devices/pci0000:00/0000:00:1c.0/0000:03:00.0/*", 
SYMLINK+="ptp-i350-1"
KERNEL=="ptp[0-9]*", 
DEVPATH=="/devices/pci0000:00/0000:00:1c.0/0000:03:00.1/*", 
SYMLINK+="ptp-i350-2"

This should create stable symlinks for the two PHC devices matching
the PCI device path.

You can find the device path for an existing device like this:

# udevadm info /dev/ptp7
P: /devices/pci0000:00/0000:00:1c.0/0000:03:00.1/ptp/ptp7
N: ptp7
E: DEVNAME=/dev/ptp7
E: DEVPATH=/devices/pci0000:00/0000:00:1c.0/0000:03:00.1/ptp/ptp7
E: MAJOR=249
E: MINOR=7
E: SUBSYSTEM=ptp

-- 
Miroslav Lichvar



_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to