Introduce an option to ignore the transport specific field.
Up until now the transportSpecific field has been treated according to 802.1AS, namely as a field that must match exactly on receive. However, 1588 mandates ignoring this field for some transports, and there is equipment in the wild that does in fact set the reserved bits. This patch adds an option to ignore the field on receive completely. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Reported-by: Petr Kulhavy <brain@jikos.cz>master
parent
4b957cf566
commit
99fd084253
1
config.c
1
config.c
|
@ -192,6 +192,7 @@ struct config_item config_tab[] = {
|
||||||
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
||||||
GLOB_ITEM_INT("gmCapable", 1, 0, 1),
|
GLOB_ITEM_INT("gmCapable", 1, 0, 1),
|
||||||
PORT_ITEM_INT("hybrid_e2e", 0, 0, 1),
|
PORT_ITEM_INT("hybrid_e2e", 0, 0, 1),
|
||||||
|
PORT_ITEM_INT("ignore_transport_specific", 0, 0, 1),
|
||||||
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
||||||
GLOB_ITEM_INT("initial_delay", 0, 0, INT_MAX),
|
GLOB_ITEM_INT("initial_delay", 0, 0, INT_MAX),
|
||||||
GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
|
GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
|
||||||
|
|
5
port.c
5
port.c
|
@ -125,6 +125,7 @@ struct port {
|
||||||
int follow_up_info;
|
int follow_up_info;
|
||||||
int freq_est_interval;
|
int freq_est_interval;
|
||||||
int hybrid_e2e;
|
int hybrid_e2e;
|
||||||
|
int match_transport_specific;
|
||||||
int min_neighbor_prop_delay;
|
int min_neighbor_prop_delay;
|
||||||
int path_trace_enabled;
|
int path_trace_enabled;
|
||||||
int rx_timestamp_offset;
|
int rx_timestamp_offset;
|
||||||
|
@ -641,7 +642,8 @@ static int port_ignore(struct port *p, struct ptp_message *m)
|
||||||
if (path_trace_ignore(p, m)) {
|
if (path_trace_ignore(p, m)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (msg_transport_specific(m) != p->transportSpecific) {
|
if (p->match_transport_specific &&
|
||||||
|
msg_transport_specific(m) != p->transportSpecific) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (pid_eq(&m->header.sourcePortIdentity, &p->portIdentity)) {
|
if (pid_eq(&m->header.sourcePortIdentity, &p->portIdentity)) {
|
||||||
|
@ -1489,6 +1491,7 @@ static int port_initialize(struct port *p)
|
||||||
p->syncReceiptTimeout = config_get_int(cfg, p->name, "syncReceiptTimeout");
|
p->syncReceiptTimeout = config_get_int(cfg, p->name, "syncReceiptTimeout");
|
||||||
p->transportSpecific = config_get_int(cfg, p->name, "transportSpecific");
|
p->transportSpecific = config_get_int(cfg, p->name, "transportSpecific");
|
||||||
p->transportSpecific <<= 4;
|
p->transportSpecific <<= 4;
|
||||||
|
p->match_transport_specific = !config_get_int(cfg, p->name, "ignore_transport_specific");
|
||||||
p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval");
|
p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval");
|
||||||
p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval");
|
p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval");
|
||||||
p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh");
|
p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh");
|
||||||
|
|
8
ptp4l.8
8
ptp4l.8
|
@ -176,6 +176,14 @@ The default is 0 or disabled.
|
||||||
The transport specific field. Must be in the range 0 to 255.
|
The transport specific field. Must be in the range 0 to 255.
|
||||||
The default is 0.
|
The default is 0.
|
||||||
.TP
|
.TP
|
||||||
|
.B ignore_transport_specific
|
||||||
|
By default, incoming messages are dropped if their transportSpecific
|
||||||
|
field does not match the configured value. However, many of
|
||||||
|
transports specified in the 1588 standard mandate ignoring this field.
|
||||||
|
Moreover, some equipment is known to set the reserved bits.
|
||||||
|
Configuring this option as 1 causes this field to be ignored
|
||||||
|
completely on receive. The default is 0.
|
||||||
|
.TP
|
||||||
.B path_trace_enabled
|
.B path_trace_enabled
|
||||||
Enable the mechanism used to trace the route of the Announce messages.
|
Enable the mechanism used to trace the route of the Announce messages.
|
||||||
The default is 0 (disabled).
|
The default is 0 (disabled).
|
||||||
|
|
Loading…
Reference in New Issue