Thread: [Linuxptp-users] Config section for /var/log/ptp4lro creates an additional port
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Martin P. <pec...@fe...> - 2022-03-29 19:29:18
Attachments:
smime.p7s
|
I added the following to my config to set some properties of the read-only UDS port: [/var/run/ptp4lro] # options However, when I start ptp4l, it creates a superfluous socket that brings in many problems: ptp4l[215.643]: ioctl SIOCETHTOOL failed: No such device ptp4l[215.752]: port 1 (enp2s0f0): INITIALIZING to SLAVE on INIT_COMPLETE ptp4l[215.752]: port 2 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[215.753]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[215.753]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE port2 is what I normally don't have. Is there a way to configure the RO socket without having this side-effect? Thanks for help, Martin |
From: Richard C. <ric...@gm...> - 2022-03-30 03:14:57
|
On Tue, Mar 29, 2022 at 09:29:06PM +0200, Martin Pecka wrote: > I added the following to my config to set some properties of the read-only > UDS port: > > [/var/run/ptp4lro] > # options > > However, when I start ptp4l, it creates a superfluous socket that brings in > many problems: Right, the config sections are for network interfaces only. > Is there a way to configure the RO socket without having this side-effect? What are you trying to accomplish? Thanks, Richard |
From: Martin P. <pec...@fe...> - 2022-03-30 11:10:44
Attachments:
smime.p7s
|
> Right, the config sections are for network interfaces only. > >> Is there a way to configure the RO socket without having this side-effect? > What are you trying to accomplish? That goes along with my proposal (on linuxptp-devel) to allow specifying file mode for the UDS sockets. Ideally, I'd set 0660 to the RW socket and 0666 to the RO socket. Unfortunately, when the socket is being created, it doesn't have the information whether it is the RW or RO socket, it knows only its name. So it doesn't seem possible to define e.g. two config options file_mode_rw and file_mode_ro. Thanks, Martin |
From: Richard C. <ric...@gm...> - 2022-03-30 14:34:59
|
On Wed, Mar 30, 2022 at 01:10:23PM +0200, Martin Pecka wrote: > > > Right, the config sections are for network interfaces only. > > > > > Is there a way to configure the RO socket without having this side-effect? > > What are you trying to accomplish? > > That goes along with my proposal (on linuxptp-devel) to allow specifying > file mode for the UDS sockets. Ideally, I'd set 0660 to the RW socket and > 0666 to the RO socket. Unfortunately, when the socket is being created, it > doesn't have the information whether it is the RW or RO socket, it knows > only its name. So it doesn't seem possible to define e.g. two config options > file_mode_rw and file_mode_ro. Make it a global option and not a port specific option. (The UDS interfaces are not PTP ports, but they are implemented as ports for the sake of code simplicity.) Thanks, Richard |
From: Martin P. <pec...@fe...> - 2022-03-30 14:57:34
Attachments:
smime.p7s
|
> Make it a global option and not a port specific option. That works, but it loses the beauty of having a "public" RO port and a root-only RW port. Martin |
From: Richard C. <ric...@gm...> - 2022-03-31 04:22:06
|
On Wed, Mar 30, 2022 at 04:57:14PM +0200, Martin Pecka wrote: > That works, but it loses the beauty of having a "public" RO port and a > root-only RW port. You can make two global options, one for each flavor. Thanks, Richard |
From: Martin P. <pec...@fe...> - 2022-03-31 08:03:29
Attachments:
smime.p7s
|
> On Wed, Mar 30, 2022 at 04:57:14PM +0200, Martin Pecka wrote: >> That works, but it loses the beauty of having a "public" RO port and a >> root-only RW port. > You can make two global options, one for each flavor. I'm sorry, I don't understand your suggestion. Can you explain in a bit more detail, please? Thank you Martin |
From: Richard C. <ric...@gm...> - 2022-03-31 14:14:49
|
On Thu, Mar 31, 2022 at 10:03:10AM +0200, Martin Pecka wrote: > > > On Wed, Mar 30, 2022 at 04:57:14PM +0200, Martin Pecka wrote: > > > That works, but it loses the beauty of having a "public" RO port and a > > > root-only RW port. > > You can make two global options, one for each flavor. > > I'm sorry, I don't understand your suggestion. Can you explain in a bit more > detail, please? Right now we have: uds_address /var/run/ptp4l uds_ro_address /var/run/ptp4lro You could add: uds_address_filemode 0660 uds_ro_address_filemode 0666 Hm? Thanks, Richard |
From: Martin P. <pec...@fe...> - 2022-03-31 14:38:18
Attachments:
smime.p7s
|
>>> You can make two global options, one for each flavor. >> I'm sorry, I don't understand your suggestion. Can you explain in a bit more >> detail, please? > Right now we have: > > uds_address /var/run/ptp4l > uds_ro_address /var/run/ptp4lro > > You could add: > > uds_address_filemode 0660 > uds_ro_address_filemode 0666 > > Hm? That would be ideal, but I'm out of ideas with the implementation. The file mode setting is needed in uds.c, but the uds_open() function has no flag telling it whether it is RW or RO (or some other?) UDS port. Maybe a little bit hacky but working solution would be to compare name and uds_path. For the RO port, name is /var/run/ptp4lro and uds_path is /var/run/ptp4l. But I can imagine this can be pretty fragile detection. |
From: Keller, J. E <jac...@in...> - 2022-03-31 20:16:18
|
> -----Original Message----- > From: Martin Pecka <pec...@fe...> > Sent: Thursday, March 31, 2022 7:38 AM > To: Richard Cochran <ric...@gm...> > Cc: lin...@li... > Subject: Re: [Linuxptp-users] Config section for /var/log/ptp4lro creates an > additional port > > > >>> You can make two global options, one for each flavor. > >> I'm sorry, I don't understand your suggestion. Can you explain in a bit more > >> detail, please? > > Right now we have: > > > > uds_address /var/run/ptp4l > > uds_ro_address /var/run/ptp4lro > > > > You could add: > > > > uds_address_filemode 0660 > > uds_ro_address_filemode 0666 > > > > Hm? > > That would be ideal, but I'm out of ideas with the implementation. The > file mode setting is needed in uds.c, but the uds_open() function has no > flag telling it whether it is RW or RO (or some other?) UDS port. > Change the uds_open function to pass in the file mode. |
From: Martin P. <pec...@fe...> - 2022-03-31 20:59:09
|
<div dir='auto'><div><br><div><br><div class="elided-text">On Mar 31, 2022 22:16, "Keller, Jacob E" <jac...@in...> wrote:<blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr"> Change the uds_open function to pass in the file mode. <br> </p> </blockquote></div>I can do that, but that would require changing the transport_open interface (and thus also raw_open, udp_open etc.) and probably also either port_initialize or adding a member variable to port class. All of that seem like pretty big changes for such a small feature. Any better ideas?</div></div></div> |