Do you means that you wish the ptp4l to use more then one network namespace?

Or is it a more convenient to start in the default network namespace?

Just ask you to clarify why do we need this patch.

I'm not an export on network namespace myself.

Yours
   Erez
________________________________________
From: Anders Selhammer [anders.selham...@est.tech]
Sent: 09 November 2018 14:44
To: Geva, Erez (ext) (PD PA CI R&D 3)
Cc: linuxptp-devel@lists.sourceforge.net
Subject: SV: [PATCH 2/6] config: Added network_namespace as config parameter

Friday, 9 November, 2018 11:36 AM

> What about "ip netns exec"?

Im not an expert on this so maybe I got it wrong but do you mean that you 
should start the ptp4l
program directly in the correct namespace?
If that is what you mean, you will bump into the problem which can be solved by 
this series of patches.
If you only have one or several ports operating in same namespace, then it is 
ok to open the program
directly in correct namespace but when you have at least one port that is in 
another, you will end up
with error printouts such as:
ioctl SIOCETHTOOL failed: No such device
ioctl SIOCGIFINDEX failed: No such device
for these ports before the .
One way to avoid this, is to open the stack in default namespace and provide 
the namespace for the
ports which operates in other namespace than default so the program itself can 
change namespace
just before calling a function which provides a file descriptor that needs to 
be in correct namespace.

Or is there any other way you solve this easily?

/Anders

________________________________________
From: Anders Selhammer [anders.selham...@est.tech]
Sent: 09 November 2018 10:25
To: linuxptp-devel@lists.sourceforge.net
Subject: [Linuxptp-devel] [PATCH 2/6] config: Added network_namespace as config 
parameter

Signed-off-by: Anders Selhammer <anders.selham...@est.tech>
---
 config.c | 1 +
 ptp4l.8  | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/config.c b/config.c
index b8e7977..fef31b3 100644
--- a/config.c
+++ b/config.c
@@ -260,6 +260,7 @@ struct config_item config_tab[] = {
        PORT_ITEM_INT("min_neighbor_prop_delay", -20000000, INT_MIN, -1),
        PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX),
        PORT_ITEM_INT("net_sync_monitor", 0, 0, 1),
+       PORT_ITEM_STR("network_namespace", ""),
        PORT_ITEM_ENU("network_transport", TRANS_UDP_IPV4, nw_trans_enu),
        GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX),
        GLOB_ITEM_INT("offsetScaledLogVariance", 0xffff, 0, UINT16_MAX),
diff --git a/ptp4l.8 b/ptp4l.8
index 99b085c..51d5b94 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -274,6 +274,12 @@ Relevant only with L2 transport. The default is 
01:1B:19:00:00:00.
 The MAC address to which peer delay messages should be sent.
 Relevant only with L2 transport. The default is 01:80:C2:00:00:0E.
 .TP
+.B network_namespace
+The network namspace the port operates in.
+This option is only used when ptp4l program is opened in default
+namespace and ports are operating in other than default.
+Skip this option to select default namespace.
+.TP
 .B network_transport
 Select the network transport. Possible values are UDPv4, UDPv6 and L2.
 The default is UDPv4.
--
1.8.3.1



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


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

Reply via email to