Re: [Linuxptp-devel] [PATCH v2 2/2] Improve port-related log messages.

2021-01-28 Thread Cliff Spradlin via Linuxptp-devel
Hi, On Fri, Jan 29, 2021 at 2:54 AM Grygorii Strashko wrote: > I've being thinking - shouldn't be implemented as new api, like > port_pr_xx(port, ...)? > (similar to kernel dev_xx(dev)). The problem is: 1) There are 8 basic log level macros, and then another 8 rate-limited macros. If I

Re: [Linuxptp-devel] [PATCH v2 2/2] Improve port-related log messages.

2021-01-28 Thread Grygorii Strashko via Linuxptp-devel
On 28/01/2021 10:30, Cliff Spradlin via Linuxptp-devel wrote: Previously, only the logical port number was emitted for most port-related log messages. Now, the interface name is included. old: port 12: assuming the grand master role new: port 12 (eth8): assuming the grand master role

[Linuxptp-devel] [PATCHv2 5/6] clock: Add read-only UDS port for monitoring.

2021-01-28 Thread Miroslav Lichvar
Add a second UDS port to allow untrusted applications to monitor ptp4l. On this "read-only" UDS port disable non-GET actions and forwarding. The path can be configured with the uds_ro_address option (default is /var/run/ptp4lro). Forwarding is disabled to limit the access to the local ptp4l

[Linuxptp-devel] [PATCHv2 6/6] timemaster: Set uds_ro_address for ptp4l instances.

2021-01-28 Thread Miroslav Lichvar
This prevents conflicts on the new UDS-RO port. Signed-off-by: Miroslav Lichvar --- timemaster.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/timemaster.c b/timemaster.c index fb27d72..616a99a 100644 --- a/timemaster.c +++ b/timemaster.c @@ -712,7 +712,7 @@

[Linuxptp-devel] [PATCHv2 2/6] port: Ignore non-management messages on UDS port.

2021-01-28 Thread Miroslav Lichvar
Drop non-management messages on the UDS port early in the processing to prevent them from changing the port or clock state. Signed-off-by: Miroslav Lichvar --- port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/port.c b/port.c index 87f2c06..f491252 100644 --- a/port.c +++ b/port.c

[Linuxptp-devel] [PATCHv2 1/6] port: Don't assume transport from port number.

2021-01-28 Thread Miroslav Lichvar
In port_open(), don't assume that UDS ports always have to have a zero number. Check the transport directly to make the code cleaner. While at it, switch all checks for the UDS in the port code to use a helper function. Signed-off-by: Miroslav Lichvar --- port.c | 40

[Linuxptp-devel] [PATCHv2 0/6] GET-only UDS port

2021-01-28 Thread Miroslav Lichvar
v2: - renamed uds_address2 option to uds_ro_address - added a helper function for UDS check in port.c This patchset adds a new UDS port to be used by untrusted applications for monitoring purposes. The first four patches are cleanup and preparation. The fifth patch is the main change. As this

[Linuxptp-devel] [PATCHv2 4/6] clock: Rename UDS variables to read-write.

2021-01-28 Thread Miroslav Lichvar
In preparation for a new read-only UDS port, rename variables of the current UDS port to make it clear it is read-write, as opposed to read-only. Signed-off-by: Miroslav Lichvar --- clock.c | 49 + 1 file changed, 25 insertions(+), 24 deletions(-)

[Linuxptp-devel] [PATCHv2 3/6] clock: Don't allow COMMAND action on non-UDS port.

2021-01-28 Thread Miroslav Lichvar
No COMMAND actions are currently supported, but check the port early in clock_manage() before reaching port_manage(). Signed-off-by: Miroslav Lichvar --- clock.c | 5 + 1 file changed, 5 insertions(+) diff --git a/clock.c b/clock.c index 08c61eb..aff9589 100644 --- a/clock.c +++ b/clock.c

[Linuxptp-devel] [PATCH v2 1/2] port: Cache display name for logs.

2021-01-28 Thread Cliff Spradlin via Linuxptp-devel
Adds a string to the port struct that can easily identify a port. This is intended to be used in log messages that refer to a port. Signed-off-by: Cliff Spradlin Change-Id: Ic45d61c05b0aa970c9caf9e17528693dc0090c31 --- port.c | 23 ++- port.h | 7 +++

[Linuxptp-devel] [PATCH v2 0/2] improve port log messages

2021-01-28 Thread Cliff Spradlin via Linuxptp-devel
This patch improves the readability of many log messages. Previously, only the logical port number was emitted for most port-related log messages. Now, the interface name is included. old: port 12: assuming the grand master role new: port 12 (eth8): assuming the grand master role This changes

[Linuxptp-devel] [PATCH v2 2/2] Improve port-related log messages.

2021-01-28 Thread Cliff Spradlin via Linuxptp-devel
Previously, only the logical port number was emitted for most port-related log messages. Now, the interface name is included. old: port 12: assuming the grand master role new: port 12 (eth8): assuming the grand master role Signed-off-by: Cliff Spradlin Change-Id: