summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-11-02 18:14:17 -0400
committerFlorin Coras <fcoras@cisco.com>2017-11-02 18:39:18 -0400
commit29ca16f582d7ca3613a01b91cf209776183ccdae (patch)
treea3971b9e226e46f457e170389bb52c8bc78cc77d /src/vnet/udp/udp.c
parent774169bd95e1bbe3e27e602acbba88650db44972 (diff)
session/udp: init rw locks
Change-Id: I68152d7338ce0d7805e50ccf9e9046de02cfd206 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/udp/udp.c')
-rw-r--r--src/vnet/udp/udp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c
index c12e837a74a..70091655211 100644
--- a/src/vnet/udp/udp.c
+++ b/src/vnet/udp/udp.c
@@ -334,6 +334,7 @@ udp_init (vlib_main_t * vm)
u32 num_threads;
clib_error_t *error = 0;
ip_protocol_info_t *pi;
+ int i;
if ((error = vlib_call_init_function (vm, ip_main_init)))
return error;
@@ -367,6 +368,13 @@ udp_init (vlib_main_t * vm)
vec_validate (um->connection_peekers, num_threads - 1);
vec_validate (um->peekers_readers_locks, num_threads - 1);
vec_validate (um->peekers_write_locks, num_threads - 1);
+
+ if (num_threads > 1)
+ for (i = 0; i < num_threads; i++)
+ {
+ clib_spinlock_init (&um->peekers_readers_locks[i]);
+ clib_spinlock_init (&um->peekers_write_locks[i]);
+ }
return error;
}