summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Varlese <marco.varlese@suse.com>2018-02-06 09:01:39 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-06 12:33:32 +0000
commitf47276f6fcf75197fb237b7742e45638fc750b8e (patch)
treed6152f233d521c8fc608bef1f3e3679623eed5ad
parentbbd41cd5da7b8db76a5faed22c061358c147f191 (diff)
SCTP: missing spinlock init when multiple threads
When the number of threads results being more than 1, the spinlock structure requires to be initialized otherwise subsequent calls to the "lock" API (clib_spinlock_lock_if_init) would result in a void operation. Change-Id: Ia268c4687252e41962bb3f1217f0a849d8c40385 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
-rw-r--r--src/vnet/sctp/sctp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c
index bd62c3213e9..f8cd21c63ec 100644
--- a/src/vnet/sctp/sctp.c
+++ b/src/vnet/sctp/sctp.c
@@ -598,7 +598,7 @@ format_sctp_listener_session (u8 * s, va_list * args)
}
void
-sctp_timer_init_handler (u32 conn_index, u32 timer_id)
+sctp_expired_timers_cb (u32 conn_index, u32 timer_id)
{
sctp_connection_t *sctp_conn;
@@ -629,7 +629,7 @@ sctp_timer_init_handler (u32 conn_index, u32 timer_id)
/* *INDENT OFF* */
static sctp_timer_expiration_handler
* sctp_timer_expiration_handlers[SCTP_N_TIMERS] = {
- sctp_timer_init_handler
+ sctp_expired_timers_cb
};
/* *INDENT ON* */
@@ -646,6 +646,8 @@ sctp_expired_timers_dispatch (u32 * expired_timers)
connection_index = expired_timers[i] & 0x0FFFFFFF;
timer_id = expired_timers[i] >> 28;
+ SCTP_DBG ("Expired timer ID: %u", timer_id);
+
/* Handle expiration */
(*sctp_timer_expiration_handlers[timer_id]) (connection_index,
timer_id);
@@ -734,6 +736,7 @@ sctp_main_enable (vlib_main_t * vm)
if (num_threads > 1)
{
+ clib_spinlock_init (&tm->half_open_lock);
}
vec_validate (tm->tx_frames[0], num_threads - 1);