From dfa9e65785441a982ce275d50fe3f8c1fec4abbe Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 31 Mar 2018 08:30:00 -0700 Subject: [PATCH] fd: Introduce a unicast service timer. This patch adds a new timer to be used by the server side unicast negotiation logic. Signed-off-by: Richard Cochran --- e2e_tc.c | 1 + fd.h | 3 ++- p2p_tc.c | 1 + port.c | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/e2e_tc.c b/e2e_tc.c index 3c75fe0..6aaf572 100644 --- a/e2e_tc.c +++ b/e2e_tc.c @@ -117,6 +117,7 @@ enum fsm_event e2e_event(struct port *p, int fd_index) case FD_MANNO_TIMER: case FD_SYNC_TX_TIMER: case FD_UNICAST_REQ_TIMER: + case FD_UNICAST_SRV_TIMER: pr_err("unexpected timer expiration"); return EV_NONE; diff --git a/fd.h b/fd.h index 215a963..16420d7 100644 --- a/fd.h +++ b/fd.h @@ -20,7 +20,7 @@ #ifndef HAVE_FD_H #define HAVE_FD_H -#define N_TIMER_FDS 7 +#define N_TIMER_FDS 8 /* * The order matters here. The DELAY timer must appear before the @@ -38,6 +38,7 @@ enum { FD_MANNO_TIMER, FD_SYNC_TX_TIMER, FD_UNICAST_REQ_TIMER, + FD_UNICAST_SRV_TIMER, FD_RTNL, N_POLLFD, }; diff --git a/p2p_tc.c b/p2p_tc.c index 2562b72..acf9e51 100644 --- a/p2p_tc.c +++ b/p2p_tc.c @@ -120,6 +120,7 @@ enum fsm_event p2p_event(struct port *p, int fd_index) case FD_MANNO_TIMER: case FD_SYNC_TX_TIMER: case FD_UNICAST_REQ_TIMER: + case FD_UNICAST_SRV_TIMER: pr_err("unexpected timer expiration"); return EV_NONE; diff --git a/port.c b/port.c index 4c4e32d..8b12c3b 100644 --- a/port.c +++ b/port.c @@ -2474,6 +2474,10 @@ static enum fsm_event bc_event(struct port *p, int fd_index) port_set_sync_tx_tmo(p); return port_tx_sync(p, NULL) ? EV_FAULT_DETECTED : EV_NONE; + case FD_UNICAST_SRV_TIMER: + pr_debug("port %hu: unicast service timeout", portnum(p)); + return EV_NONE; + case FD_UNICAST_REQ_TIMER: pr_debug("port %hu: unicast request timeout", portnum(p)); return unicast_client_timer(p) ? EV_FAULT_DETECTED : EV_NONE;