Add inhibit_announce config option.
This option will accomplish 2 things. On the master, it will stop the announce messages being sent (by disabling FD_MANNO_TIMER timer). On slave, it will not configure announce message timeouts (by disabling FD_ANNOUNCE_TIMEOUT timer). This config option is needed for the Automotive profile as part of skipping the Best Master Clock Algorithm (BMCA). Signed-off-by: Vedang Patel <vedang.patel@intel.com>master
parent
83be05256b
commit
1cbeec80cd
1
config.c
1
config.c
|
@ -242,6 +242,7 @@ struct config_item config_tab[] = {
|
||||||
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("ignore_transport_specific", 0, 0, 1),
|
||||||
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
||||||
|
PORT_ITEM_INT("inhibit_announce", 0, 0, 1),
|
||||||
PORT_ITEM_INT("inhibit_multicast_service", 0, 0, 1),
|
PORT_ITEM_INT("inhibit_multicast_service", 0, 0, 1),
|
||||||
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),
|
||||||
|
|
|
@ -34,6 +34,7 @@ masterOnly 0
|
||||||
G.8275.portDS.localPriority 128
|
G.8275.portDS.localPriority 128
|
||||||
asCapable auto
|
asCapable auto
|
||||||
BMCA ptp
|
BMCA ptp
|
||||||
|
inhibit_announce 0
|
||||||
#
|
#
|
||||||
# Run time options
|
# Run time options
|
||||||
#
|
#
|
||||||
|
|
15
port.c
15
port.c
|
@ -1592,6 +1592,7 @@ int port_initialize(struct port *p)
|
||||||
p->logMinDelayReqInterval = config_get_int(cfg, p->name, "logMinDelayReqInterval");
|
p->logMinDelayReqInterval = config_get_int(cfg, p->name, "logMinDelayReqInterval");
|
||||||
p->peerMeanPathDelay = 0;
|
p->peerMeanPathDelay = 0;
|
||||||
p->logAnnounceInterval = config_get_int(cfg, p->name, "logAnnounceInterval");
|
p->logAnnounceInterval = config_get_int(cfg, p->name, "logAnnounceInterval");
|
||||||
|
p->inhibit_announce = config_get_int(cfg, p->name, "inhibit_announce");
|
||||||
p->announceReceiptTimeout = config_get_int(cfg, p->name, "announceReceiptTimeout");
|
p->announceReceiptTimeout = config_get_int(cfg, p->name, "announceReceiptTimeout");
|
||||||
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");
|
||||||
|
@ -2310,7 +2311,9 @@ static void port_e2e_transition(struct port *p, enum port_state next)
|
||||||
break;
|
break;
|
||||||
case PS_MASTER:
|
case PS_MASTER:
|
||||||
case PS_GRAND_MASTER:
|
case PS_GRAND_MASTER:
|
||||||
|
if (!p->inhibit_announce) {
|
||||||
set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
|
set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
|
||||||
|
}
|
||||||
port_set_sync_tx_tmo(p);
|
port_set_sync_tx_tmo(p);
|
||||||
break;
|
break;
|
||||||
case PS_PASSIVE:
|
case PS_PASSIVE:
|
||||||
|
@ -2353,7 +2356,9 @@ static void port_p2p_transition(struct port *p, enum port_state next)
|
||||||
break;
|
break;
|
||||||
case PS_MASTER:
|
case PS_MASTER:
|
||||||
case PS_GRAND_MASTER:
|
case PS_GRAND_MASTER:
|
||||||
|
if (!p->inhibit_announce) {
|
||||||
set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
|
set_tmo_log(p->fda.fd[FD_MANNO_TIMER], 1, -10); /*~1ms*/
|
||||||
|
}
|
||||||
port_set_sync_tx_tmo(p);
|
port_set_sync_tx_tmo(p);
|
||||||
break;
|
break;
|
||||||
case PS_PASSIVE:
|
case PS_PASSIVE:
|
||||||
|
@ -2474,9 +2479,9 @@ static enum fsm_event bc_event(struct port *p, int fd_index)
|
||||||
case FD_SYNC_RX_TIMER:
|
case FD_SYNC_RX_TIMER:
|
||||||
pr_debug("port %hu: %s timeout", portnum(p),
|
pr_debug("port %hu: %s timeout", portnum(p),
|
||||||
fd_index == FD_SYNC_RX_TIMER ? "rx sync" : "announce");
|
fd_index == FD_SYNC_RX_TIMER ? "rx sync" : "announce");
|
||||||
if (p->best)
|
if (p->best) {
|
||||||
fc_clear(p->best);
|
fc_clear(p->best);
|
||||||
port_set_announce_tmo(p);
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear out the event returned by poll(). It is only cleared
|
* Clear out the event returned by poll(). It is only cleared
|
||||||
|
@ -2487,6 +2492,12 @@ static enum fsm_event bc_event(struct port *p, int fd_index)
|
||||||
port_clr_tmo(p->fda.fd[FD_SYNC_RX_TIMER]);
|
port_clr_tmo(p->fda.fd[FD_SYNC_RX_TIMER]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p->inhibit_announce) {
|
||||||
|
port_clr_tmo(p->fda.fd[FD_ANNOUNCE_TIMER]);
|
||||||
|
} else {
|
||||||
|
port_set_announce_tmo(p);
|
||||||
|
}
|
||||||
|
|
||||||
delay_req_prune(p);
|
delay_req_prune(p);
|
||||||
if (clock_slave_only(p->clock) && p->delayMechanism != DM_P2P &&
|
if (clock_slave_only(p->clock) && p->delayMechanism != DM_P2P &&
|
||||||
port_renew_transport(p)) {
|
port_renew_transport(p)) {
|
||||||
|
|
|
@ -98,6 +98,7 @@ struct port {
|
||||||
enum port_state (*state_machine)(enum port_state state,
|
enum port_state (*state_machine)(enum port_state state,
|
||||||
enum fsm_event event, int mdiff);
|
enum fsm_event event, int mdiff);
|
||||||
int bmca;
|
int bmca;
|
||||||
|
int inhibit_announce;
|
||||||
/* portDS */
|
/* portDS */
|
||||||
struct PortIdentity portIdentity;
|
struct PortIdentity portIdentity;
|
||||||
enum port_state state; /*portState*/
|
enum port_state state; /*portState*/
|
||||||
|
|
8
ptp4l.8
8
ptp4l.8
|
@ -701,6 +701,14 @@ assume the slave role. masterOnly (which is a per-port config option) can then
|
||||||
be used to set individual ports to take master role. BMCA is used in the
|
be used to set individual ports to take master role. BMCA is used in the
|
||||||
Automotive profile to speed up the start time for grand master and slaves. The
|
Automotive profile to speed up the start time for grand master and slaves. The
|
||||||
default value is 'ptp' which runs the BMCA related state machines.
|
default value is 'ptp' which runs the BMCA related state machines.
|
||||||
|
.TP
|
||||||
|
.B inhibit_announce
|
||||||
|
This will disable the timer for announce messages (i.e. FD_MANNO_TIMER) and
|
||||||
|
also the announce message timeout timer (i.e. FD_ANNOUNCE_TIMER). This is used
|
||||||
|
by the Automotive profile as part of switching over to a static BMCA. if this
|
||||||
|
option is enabled, ignore_source_id has to be enabled in the slave because it
|
||||||
|
has no way to identify master identity in Sync and Follow_Up messages. The
|
||||||
|
default is 0 (disabled).
|
||||||
|
|
||||||
.SH UNICAST DISCOVERY OPTIONS
|
.SH UNICAST DISCOVERY OPTIONS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue