Discussion:
[Linuxptp-devel] [PATCH] Introduce options to set DSCP values in PTP messages
Jesuiter, Henry (ALC NetworX GmbH)
2016-07-08 07:46:25 UTC
Permalink
Richard,

please find below the new patch and commit message. Thanks for your patience especially respective the makefile-issue. As you may already assume, we are using our own build system here. BTW: Are you interested in some patches that remove gcc warnings if the code is compiled using -Wsign-compare and -Wtype-limits?

---
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.

Signed-off-by: Henry Jesuiter <***@alcnetworx.de>
---
diff -rwbBu a/config.c b/config.c
--- a/config.c 2015-09-19 16:25:11.000000000 +0200
+++ b/config.c 2016-07-07 13:13:44.465579808 +0200
@@ -226,6 +226,8 @@
PORT_ITEM_INT("syncReceiptTimeout", 0, 0, UINT8_MAX),
GLOB_ITEM_INT("timeSource", INTERNAL_OSCILLATOR, 0x10, 0xfe),
GLOB_ITEM_ENU("time_stamping", TS_HARDWARE, timestamping_enu),
+ GLOB_ITEM_INT("tos_event", 0, 0, 63),
+ GLOB_ITEM_INT("tos_general", 0, 0, 63),
PORT_ITEM_INT("transportSpecific", 0, 0, 0x0F),
PORT_ITEM_ENU("tsproc_mode", TSPROC_FILTER, tsproc_enu),
GLOB_ITEM_INT("twoStepFlag", 1, 0, 1),
diff -rwbBu a/default.cfg b/default.cfg
--- a/default.cfg 2015-09-19 16:25:11.000000000 +0200
+++ b/default.cfg 2016-07-07 13:14:21.333731697 +0200
@@ -12,6 +12,8 @@
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
+tos_event 0
+tos_general 0
#
# Port Data Set
#
diff -rwbBu a/makefile b/makefile
--- a/makefile 2015-09-19 16:25:11.000000000 +0200
+++ b/makefile 2016-07-08 09:33:11.046145469 +0200
@@ -55,9 +55,10 @@

hwstamp_ctl: hwstamp_ctl.o version.o

-phc_ctl: phc_ctl.o phc.o sk.o util.o clockadj.o sysoff.o print.o version.o
+phc_ctl: config.o hash.o phc_ctl.o phc.o sk.o util.o clockadj.o sysoff.o \
+print.o version.o

-timemaster: print.o sk.o timemaster.o util.o version.o
+timemaster: config.o hash.o print.o sk.o timemaster.o util.o version.o

version.o: .version version.sh $(filter-out version.d,$(DEPEND))

diff -rwbBu a/ptp4l.8 b/ptp4l.8
--- a/ptp4l.8 2015-09-19 16:25:11.000000000 +0200
+++ b/ptp4l.8 2016-07-08 09:28:46.381541843 +0200
@@ -446,6 +446,20 @@
Specifies the address of the UNIX domain socket for receiving local
management messages. The default is /var/run/ptp4l.
.TP
+.B tos_event
+Defines the Differentiated Services Codepoint (DSCP) to be used for PTP
+event messages. Must be a value between 0 and 63. There are several media
+streaming standards out there that require specific values for this option.
+For example 46 (EF PHB) in AES67 or 48 (CS6 PHB) in RAVENNA. The default
+is 0.
+.TP
+.B tos_general
+Defines the Differentiated Services Codepoint (DSCP) to be used for PTP
+general messages. Must be a value between 0 and 63. There are several media
+streaming standards out there that recommend specific values for this option.
+For example 34 (AF41 PHB) in AES67 or 46 (EF PHB) in RAVENNA. The default
+is 0.
+.TP
.B logging_level
The maximum logging level of messages which should be printed.
The default is 6 (LOG_INFO).
diff -rwbBu a/sk.c b/sk.c
--- a/sk.c 2015-09-19 16:25:11.000000000 +0200
+++ b/sk.c 2016-07-08 09:30:54.549742470 +0200
@@ -31,6 +31,7 @@
#include <poll.h>

#include "address.h"
+#include "config.h"
#include "ether.h"
#include "missing.h"
#include "print.h"
@@ -78,6 +79,29 @@
return 0;
}

+static int set_priority(int fd, uint8_t dscp)
+{
+ int tos;
+ socklen_t tos_len;
+
+ tos_len = sizeof(tos);
+ if (getsockopt(fd, SOL_IP, IP_TOS, &tos, &tos_len) < 0) {
+ tos = 0;
+ }
+
+ /* clear old DSCP value */
+ tos &= ~0xFC;
+
+ /* set new DSCP value */
+ tos |= dscp<<2;
+ tos_len = sizeof(tos);
+ if (setsockopt(fd, SOL_IP, IP_TOS, &tos, tos_len) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
/* public methods */

int sk_interface_index(int fd, const char *name)
@@ -105,6 +129,25 @@
return 0;
}

+int sk_set_priority(struct config *c, int event_fd, int general_fd)
+{
+ uint8_t event_dscp = config_get_int(c, NULL, "tos_event");
+ uint8_t general_dscp = config_get_int(c, NULL, "tos_general");
+
+ int err = 0;
+
+ if (event_dscp) {
+ err = set_priority(event_fd, event_dscp);
+ }
+
+ if (!err && general_dscp) {
+ err = set_priority(general_fd, general_dscp);
+ }
+
+ return err;
+}
+
+
int sk_get_ts_info(const char *name, struct sk_ts_info *sk_info)
{
#ifdef ETHTOOL_GET_TS_INFO
diff -rwbBu a/sk.h b/sk.h
--- a/sk.h 2015-09-19 16:25:11.000000000 +0200
+++ b/sk.h 2016-07-06 17:16:19.000000000 +0200
@@ -55,6 +55,16 @@
int sk_general_init(int fd);

/**
+ * Set DSCP value for socket.
+ * @param c Current linuxptp configuration.
+ * @param event_fd Open socket for ptp event messages.
+ * @param dscp Open socket for ptp general messages.
+ * @return Zero on success, negative on failure
+ *
+ */
+int sk_set_priority(struct config *c, int event_fd, int general_fd);
+
+/**
* Obtain supported timestamping information
* @param name The name of the interface
* @param info Struct containing obtained timestamping information.
diff -rwbBu a/udp6.c b/udp6.c
--- a/udp6.c 2015-09-19 16:25:11.000000000 +0200
+++ b/udp6.c 2016-07-07 13:16:00.134088652 +0200
@@ -196,6 +196,10 @@
if (sk_general_init(gfd))
goto no_timestamping;

+ if (sk_set_priority(t->cfg, efd, gfd) < 0) {
+ pr_warning("Failure on setting DSCP priority.");
+ }
+
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
return 0;
diff -rwbBu a/udp.c b/udp.c
--- a/udp.c 2015-09-19 16:25:11.000000000 +0200
+++ b/udp.c 2016-07-07 13:15:48.358049636 +0200
@@ -186,6 +186,10 @@
if (sk_general_init(gfd))
goto no_timestamping;

+ if (sk_set_priority(t->cfg, efd, gfd) < 0) {
+ pr_warning("Failure on setting DSCP priority.");
+ }
+
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
return 0;
---

Best regards
Henry Jesuiter
Richard Cochran
2016-07-08 09:24:03 UTC
Permalink
Post by Jesuiter, Henry (ALC NetworX GmbH)
BTW: Are you interested in some patches that remove gcc warnings if
the code is compiled using -Wsign-compare and -Wtype-limits?
The answer is, "it depends."

If the patchs fix real issues, then I'll take them.

If they only silence gcc's false positives, then I am less interested.

There is no harm in posting patches, even if they don't get merged...

Thanks,
Richard
Richard Cochran
2016-07-08 14:49:44 UTC
Permalink
Henry,

The fact that two unrelated binaries needed new linking bothered me.
I think it is cleaner and more consistent to have the new sk.c method
operate on one socket at a time.

If you agree, I would like to merge your patch, but with my changes.


Thanks,
Richard

Cc: Henry Jesuiter <***@alcnetworx.de>


Henry Jesuiter (1):
Introduce options to set DSCP values in PTP messages.

config.c | 2 ++
default.cfg | 2 ++
ptp4l.8 | 14 ++++++++++++++
sk.c | 23 +++++++++++++++++++++++
sk.h | 8 ++++++++
udp.c | 11 +++++++++++
udp6.c | 11 +++++++++++
7 files changed, 71 insertions(+)
--
2.1.4
Richard Cochran
2016-07-08 14:49:45 UTC
Permalink
From: Henry Jesuiter <***@alcnetworx.de>

In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.

[ RC: - Changed sk.c method to operate on a single socket.
- Arranged new sk.c method in alphabetical order. ]

Signed-off-by: Henry Jesuiter <***@alcnetworx.de>
Signed-off-by: Richard Cochran <***@gmail.com>
---
config.c | 2 ++
default.cfg | 2 ++
ptp4l.8 | 14 ++++++++++++++
sk.c | 23 +++++++++++++++++++++++
sk.h | 8 ++++++++
udp.c | 11 +++++++++++
udp6.c | 11 +++++++++++
7 files changed, 71 insertions(+)

diff --git a/config.c b/config.c
index 80fa255..908b538 100644
--- a/config.c
+++ b/config.c
@@ -226,6 +226,8 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("syncReceiptTimeout", 0, 0, UINT8_MAX),
GLOB_ITEM_INT("timeSource", INTERNAL_OSCILLATOR, 0x10, 0xfe),
GLOB_ITEM_ENU("time_stamping", TS_HARDWARE, timestamping_enu),
+ GLOB_ITEM_INT("tos_event", 0, 0, 63),
+ GLOB_ITEM_INT("tos_general", 0, 0, 63),
PORT_ITEM_INT("transportSpecific", 0, 0, 0x0F),
PORT_ITEM_ENU("tsproc_mode", TSPROC_FILTER, tsproc_enu),
GLOB_ITEM_INT("twoStepFlag", 1, 0, 1),
diff --git a/default.cfg b/default.cfg
index 67f5b3a..00b3318 100644
--- a/default.cfg
+++ b/default.cfg
@@ -12,6 +12,8 @@ clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
+tos_event 0
+tos_general 0
#
# Port Data Set
#
diff --git a/ptp4l.8 b/ptp4l.8
index 72baf86..a167e2e 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -448,6 +448,20 @@ is only relevant with IPv6 transport. See RFC 4291. The default is
Specifies the address of the UNIX domain socket for receiving local
management messages. The default is /var/run/ptp4l.
.TP
+.B tos_event
+Defines the Differentiated Services Codepoint (DSCP) to be used for PTP
+event messages. Must be a value between 0 and 63. There are several media
+streaming standards out there that require specific values for this option.
+For example 46 (EF PHB) in AES67 or 48 (CS6 PHB) in RAVENNA. The default
+is 0.
+.TP
+.B tos_general
+Defines the Differentiated Services Codepoint (DSCP) to be used for PTP
+general messages. Must be a value between 0 and 63. There are several media
+streaming standards out there that recommend specific values for this option.
+For example 34 (AF41 PHB) in AES67 or 46 (EF PHB) in RAVENNA. The default
+is 0.
+.TP
.B logging_level
The maximum logging level of messages which should be printed.
The default is 6 (LOG_INFO).
diff --git a/sk.c b/sk.c
index e80f608..ad30f71 100644
--- a/sk.c
+++ b/sk.c
@@ -298,6 +298,29 @@ int sk_receive(int fd, void *buf, int buflen,
return cnt;
}

+int sk_set_priority(int fd, uint8_t dscp)
+{
+ int tos;
+ socklen_t tos_len;
+
+ tos_len = sizeof(tos);
+ if (getsockopt(fd, SOL_IP, IP_TOS, &tos, &tos_len) < 0) {
+ tos = 0;
+ }
+
+ /* clear old DSCP value */
+ tos &= ~0xFC;
+
+ /* set new DSCP value */
+ tos |= dscp<<2;
+ tos_len = sizeof(tos);
+ if (setsockopt(fd, SOL_IP, IP_TOS, &tos, tos_len) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
int sk_timestamping_init(int fd, const char *device, enum timestamp_type type,
enum transport_type transport)
{
diff --git a/sk.h b/sk.h
index f05d1df..31cc88e 100644
--- a/sk.h
+++ b/sk.h
@@ -94,6 +94,14 @@ int sk_receive(int fd, void *buf, int buflen,
struct address *addr, struct hw_timestamp *hwts, int flags);

/**
+ * Set DSCP value for socket.
+ * @param fd An open socket.
+ * @param dscp The desired DSCP code.
+ * @return Zero on success, negative on failure
+ */
+int sk_set_priority(int fd, uint8_t dscp);
+
+/**
* Enable time stamping on a given network interface.
* @param fd An open socket.
* @param device The name of the network interface to configure.
diff --git a/udp.c b/udp.c
index 07277c7..83a665f 100644
--- a/udp.c
+++ b/udp.c
@@ -157,6 +157,7 @@ static int udp_open(struct transport *t, const char *name, struct fdarray *fda,
enum timestamp_type ts_type)
{
struct udp *udp = container_of(t, struct udp, t);
+ uint8_t event_dscp, general_dscp;
int efd, gfd, ttl;

ttl = config_get_int(t->cfg, name, "udp_ttl");
@@ -186,6 +187,16 @@ static int udp_open(struct transport *t, const char *name, struct fdarray *fda,
if (sk_general_init(gfd))
goto no_timestamping;

+ event_dscp = config_get_int(t->cfg, NULL, "tos_event");
+ general_dscp = config_get_int(t->cfg, NULL, "tos_general");
+
+ if (event_dscp && sk_set_priority(efd, event_dscp)) {
+ pr_warning("Failed to set event DSCP priority.");
+ }
+ if (general_dscp && sk_set_priority(gfd, general_dscp)) {
+ pr_warning("Failed to set general DSCP priority.");
+ }
+
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
return 0;
diff --git a/udp6.c b/udp6.c
index 070e762..b185e00 100644
--- a/udp6.c
+++ b/udp6.c
@@ -165,6 +165,7 @@ static int udp6_open(struct transport *t, const char *name, struct fdarray *fda,
enum timestamp_type ts_type)
{
struct udp6 *udp6 = container_of(t, struct udp6, t);
+ uint8_t event_dscp, general_dscp;
int efd, gfd, hop_limit;

hop_limit = config_get_int(t->cfg, name, "udp_ttl");
@@ -196,6 +197,16 @@ static int udp6_open(struct transport *t, const char *name, struct fdarray *fda,
if (sk_general_init(gfd))
goto no_timestamping;

+ event_dscp = config_get_int(t->cfg, NULL, "tos_event");
+ general_dscp = config_get_int(t->cfg, NULL, "tos_general");
+
+ if (event_dscp && sk_set_priority(efd, event_dscp)) {
+ pr_warning("Failed to set event DSCP priority.");
+ }
+ if (general_dscp && sk_set_priority(gfd, general_dscp)) {
+ pr_warning("Failed to set general DSCP priority.");
+ }
+
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
return 0;
--
2.1.4
Jesuiter, Henry (ALC NetworX GmbH)
2016-07-12 11:52:48 UTC
Permalink
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.

[ RC: - Changed sk.c method to operate on a single socket.
- Arranged new sk.c method in alphabetical order. ]

[HJ: - renamed 'tos_*' config options to 'dhcp_*']

Signed-off-by: Henry Jesuiter <***@alcnetworx.de>
Signed-off-by: Richard Cochran <***@gmail.com>
---
config.c | 2 ++
default.cfg | 2 ++
ptp4l.8 | 14 ++++++++++++++
sk.c | 23 +++++++++++++++++++++++
sk.h | 8 ++++++++
udp.c | 11 +++++++++++
udp6.c | 11 +++++++++++
7 files changed, 71 insertions(+)

diff -rwbBu -p a/config.c b/config.c
--- a/config.c 2016-07-12 13:37:59.373539521 +0200
+++ b/config.c 2016-07-12 13:44:52.198468963 +0200
@@ -180,6 +180,8 @@ struct config_item config_tab[] = {
PORT_ITEM_ENU("delay_filter", FILTER_MOVING_MEDIAN, delay_filter_enu),
PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX),
PORT_ITEM_ENU("delay_mechanism", DM_E2E, delay_mech_enu),
+ GLOB_ITEM_INT("dhcp_event", 0, 0, 63),
+ GLOB_ITEM_INT("dhcp_general", 0, 0, 63),
GLOB_ITEM_INT("domainNumber", 0, 0, 127),
PORT_ITEM_INT("egressLatency", 0, INT_MIN, INT_MAX),
PORT_ITEM_INT("fault_badpeernet_interval", 16, INT32_MIN, INT32_MAX),
diff -rwbBu -p a/default.cfg b/default.cfg
--- a/default.cfg 2016-07-12 13:37:59.373539521 +0200
+++ b/default.cfg 2016-07-12 13:42:35.550239675 +0200
@@ -12,6 +12,8 @@ clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
+dhcp_event 0
+dhcp_general 0
#
# Port Data Set
#
diff -rwbBu -p a/ptp4l.8 b/ptp4l.8
--- a/ptp4l.8 2016-07-12 13:37:59.373539521 +0200
+++ b/ptp4l.8 2016-07-12 13:42:48.066263314 +0200
@@ -448,6 +448,20 @@ is only relevant with IPv6 transport. S
Specifies the address of the UNIX domain socket for receiving local
management messages. The default is /var/run/ptp4l.
.TP
+.B dhcp_event
+Defines the Differentiated Services Codepoint (DSCP) to be used for PTP
+event messages. Must be a value between 0 and 63. There are several media
+streaming standards out there that require specific values for this option.
+For example 46 (EF PHB) in AES67 or 48 (CS6 PHB) in RAVENNA. The default
+is 0.
+.TP
+.B dhcp_general
+Defines the Differentiated Services Codepoint (DSCP) to be used for PTP
+general messages. Must be a value between 0 and 63. There are several media
+streaming standards out there that recommend specific values for this option.
+For example 34 (AF41 PHB) in AES67 or 46 (EF PHB) in RAVENNA. The default
+is 0.
+.TP
.B logging_level
The maximum logging level of messages which should be printed.
The default is 6 (LOG_INFO).
diff -rwbBu -p a/sk.c b/sk.c
--- a/sk.c 2016-07-12 13:37:59.373539521 +0200
+++ b/sk.c 2016-07-12 13:41:28.406102486 +0200
@@ -298,6 +298,29 @@ int sk_receive(int fd, void *buf, int bu
return cnt;
}

+int sk_set_priority(int fd, uint8_t dscp)
+{
+ int tos;
+ socklen_t tos_len;
+
+ tos_len = sizeof(tos);
+ if (getsockopt(fd, SOL_IP, IP_TOS, &tos, &tos_len) < 0) {
+ tos = 0;
+ }
+
+ /* clear old DSCP value */
+ tos &= ~0xFC;
+
+ /* set new DSCP value */
+ tos |= dscp<<2;
+ tos_len = sizeof(tos);
+ if (setsockopt(fd, SOL_IP, IP_TOS, &tos, tos_len) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
int sk_timestamping_init(int fd, const char *device, enum timestamp_type type,
enum transport_type transport)
{
diff -rwbBu -p a/sk.h b/sk.h
--- a/sk.h 2016-07-12 13:37:59.373539521 +0200
+++ b/sk.h 2016-07-12 13:41:28.406102486 +0200
@@ -94,6 +94,14 @@ int sk_receive(int fd, void *buf, int bu
struct address *addr, struct hw_timestamp *hwts, int flags);

/**
+ * Set DSCP value for socket.
+ * @param fd An open socket.
+ * @param dscp The desired DSCP code.
+ * @return Zero on success, negative on failure
+ */
+int sk_set_priority(int fd, uint8_t dscp);
+
+/**
* Enable time stamping on a given network interface.
* @param fd An open socket.
* @param device The name of the network interface to configure.
diff -rwbBu -p a/udp6.c b/udp6.c
--- a/udp6.c 2016-07-12 13:37:59.373539521 +0200
+++ b/udp6.c 2016-07-12 13:43:44.778363475 +0200
@@ -165,6 +165,7 @@ static int udp6_open(struct transport *t
enum timestamp_type ts_type)
{
struct udp6 *udp6 = container_of(t, struct udp6, t);
+ uint8_t event_dscp, general_dscp;
int efd, gfd, hop_limit;

hop_limit = config_get_int(t->cfg, name, "udp_ttl");
@@ -196,6 +197,16 @@ static int udp6_open(struct transport *t
if (sk_general_init(gfd))
goto no_timestamping;

+ event_dscp = config_get_int(t->cfg, NULL, "dhcp_event");
+ general_dscp = config_get_int(t->cfg, NULL, "dhcp_general");
+
+ if (event_dscp && sk_set_priority(efd, event_dscp)) {
+ pr_warning("Failed to set event DSCP priority.");
+ }
+ if (general_dscp && sk_set_priority(gfd, general_dscp)) {
+ pr_warning("Failed to set general DSCP priority.");
+ }
+
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
return 0;
diff -rwbBu -p a/udp.c b/udp.c
--- a/udp.c 2016-07-12 13:37:59.373539521 +0200
+++ b/udp.c 2016-07-12 13:43:14.546311464 +0200
@@ -157,6 +157,7 @@ static int udp_open(struct transport *t,
enum timestamp_type ts_type)
{
struct udp *udp = container_of(t, struct udp, t);
+ uint8_t event_dscp, general_dscp;
int efd, gfd, ttl;

ttl = config_get_int(t->cfg, name, "udp_ttl");
@@ -186,6 +187,16 @@ static int udp_open(struct transport *t,
if (sk_general_init(gfd))
goto no_timestamping;

+ event_dscp = config_get_int(t->cfg, NULL, "dhcp_event");
+ general_dscp = config_get_int(t->cfg, NULL, "dhcp_general");
+
+ if (event_dscp && sk_set_priority(efd, event_dscp)) {
+ pr_warning("Failed to set event DSCP priority.");
+ }
+ if (general_dscp && sk_set_priority(gfd, general_dscp)) {
+ pr_warning("Failed to set general DSCP priority.");
+ }
+
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
return 0;
---
Dale Smith
2016-07-12 12:46:44 UTC
Permalink
On Tue, Jul 12, 2016 at 7:52 AM, Jesuiter, Henry (ALC NetworX GmbH) <
***@alcnetworx.de> wrote:

[HJ: - renamed 'tos_*' config options to 'dhcp_*']
+ GLOB_ITEM_INT("dhcp_event", 0, 0, 63),
+ GLOB_ITEM_INT("dhcp_general", 0, 0, 63),
+dhcp_event 0
+dhcp_general 0
+.B dhcp_event
+.B dhcp_general
Shouldn't all these be dscp instead of dhcp?

-Dale
Richard Cochran
2016-07-12 12:49:18 UTC
Permalink
Post by Jesuiter, Henry (ALC NetworX GmbH)
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.
[ RC: - Changed sk.c method to operate on a single socket.
- Arranged new sk.c method in alphabetical order. ]
[HJ: - renamed 'tos_*' config options to 'dhcp_*']
I'm sure you meant "dscp" not "dhcp". No need to resend. I'll fix it
up myself before pushing.

Thanks,
Richard
Richard Cochran
2016-07-12 13:17:56 UTC
Permalink
Post by Jesuiter, Henry (ALC NetworX GmbH)
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.
Applied.

Thanks,
Richard

Miroslav Lichvar
2016-07-12 06:53:39 UTC
Permalink
Post by Jesuiter, Henry (ALC NetworX GmbH)
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.
If the new options set the DSCP value, should they be named tos_*? I
suspect it might create a confusion with the IPv4 TOS field, which
contains bitshifted DSCP. Wouldn't dscp_event and dscp_general be
better?
--
Miroslav Lichvar
Jesuiter, Henry (ALC NetworX GmbH)
2016-07-12 06:59:02 UTC
Permalink
I think you are right. That 'tos_*' naming thing has grown historically and I didn't spend much into the naming afterwards. I'll provide a patch soon to rename that options as according to your suggestion (have to get the current git verison before).

Best regards
Henry Jesuiter

-----Ursprüngliche Nachricht-----
Von: Miroslav Lichvar [mailto:***@redhat.com]
Gesendet: Dienstag, 12. Juli 2016 08:54
An: Jesuiter, Henry (ALC NetworX GmbH) <***@alcnetworx.de>
Cc: Richard Cochran <***@gmail.com>; linuxptp-***@lists.sourceforge.net
Betreff: Re: [Linuxptp-devel] [PATCH] Introduce options to set DSCP values in PTP messages
Post by Jesuiter, Henry (ALC NetworX GmbH)
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.
If the new options set the DSCP value, should they be named tos_*? I
suspect it might create a confusion with the IPv4 TOS field, which
contains bitshifted DSCP. Wouldn't dscp_event and dscp_general be
better?
--
Miroslav Lichvar
Jesuiter, Henry (ALC NetworX GmbH)
2016-07-12 11:11:35 UTC
Permalink
Richard,

I just tried to get the current git development head. It looks like the DHCP-Patch is not committed yet. Would you like if I wait for the commit to rename the config options, or should I change your last patch accordingly?

Best regards
Henry Jesuiter

-----Ursprüngliche Nachricht-----
Von: Miroslav Lichvar [mailto:***@redhat.com]
Gesendet: Dienstag, 12. Juli 2016 08:54
An: Jesuiter, Henry (ALC NetworX GmbH) <***@alcnetworx.de>
Cc: Richard Cochran <***@gmail.com>; linuxptp-***@lists.sourceforge.net
Betreff: Re: [Linuxptp-devel] [PATCH] Introduce options to set DSCP values in PTP messages
Post by Jesuiter, Henry (ALC NetworX GmbH)
In the last years there are several media streaming standards
evolving that are relying on PTP. These standards make requirements
about the DSCP priority of PTP messages. This patch introduces two
new configuration options 'tos_event' and 'tos_general' to address
that issue and to be able to set the DSCP priority separately for
PTP event messages and PTP general messages.
If the new options set the DSCP value, should they be named tos_*? I
suspect it might create a confusion with the IPv4 TOS field, which
contains bitshifted DSCP. Wouldn't dscp_event and dscp_general be
better?
--
Miroslav Lichvar
Richard Cochran
2016-07-12 11:20:43 UTC
Permalink
Post by Jesuiter, Henry (ALC NetworX GmbH)
I just tried to get the current git development head. It looks like
the DHCP-Patch is not committed yet. Would you like if I wait for
the commit to rename the config options, or should I change your
last patch accordingly?
Please take my version of the patch, make your changes, and post the
squashed result.

Thanks!
Richard
Loading...