diff options
author | Florin Coras <fcoras@cisco.com> | 2018-06-10 14:41:23 -0700 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.de> | 2018-06-11 14:08:20 +0000 |
commit | 40903ac34f89d9e2ad775e98b7bcec5b7feb0207 (patch) | |
tree | 550a152e6a9359248ec50ffbeb0063b564bbcb48 /src/vnet/session | |
parent | d723161e038d00e59766aa67a6a0dcc350227e4b (diff) |
udp: fix for multiple workers and add test
Since the main thread is not used for session polling anymore, when vpp
is started with multiple wokers, allocate connections on the first. Also
add a simple udp make test.
Change-Id: Id869f5d89e0fced51048f0384fa86a5022258b7c
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session.c | 3 | ||||
-rw-r--r-- | src/vnet/session/transport.c | 6 | ||||
-rw-r--r-- | src/vnet/session/transport.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index ee02526c190..cfba31ec406 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -142,7 +142,8 @@ session_alloc_for_connection (transport_connection_t * tc) stream_session_t *s; u32 thread_index = tc->thread_index; - ASSERT (thread_index == vlib_get_thread_index ()); + ASSERT (thread_index == vlib_get_thread_index () + || transport_protocol_is_cl (tc->proto)); s = session_alloc (thread_index); s->session_type = session_type_from_proto_and_ip (tc->proto, tc->is_ip4); diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c index b3d42d0f7da..a401190e426 100644 --- a/src/vnet/session/transport.c +++ b/src/vnet/session/transport.c @@ -207,6 +207,12 @@ transport_protocol_tx_fn_type (transport_proto_t tp) return tp_vfts[tp].tx_type; } +u8 +transport_protocol_is_cl (transport_proto_t tp) +{ + return (tp_vfts[tp].service_type == TRANSPORT_SERVICE_CL); +} + #define PORT_MASK ((1 << 16)- 1) void diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h index 8340fd859ac..e29f3ca9557 100644 --- a/src/vnet/session/transport.h +++ b/src/vnet/session/transport.h @@ -131,6 +131,7 @@ int transport_alloc_local_endpoint (u8 proto, transport_endpoint_t * rmt, ip46_address_t * lcl_addr, u16 * lcl_port); void transport_endpoint_cleanup (u8 proto, ip46_address_t * lcl_ip, u16 port); +u8 transport_protocol_is_cl (transport_proto_t tp); void transport_init (void); #endif /* VNET_VNET_URI_TRANSPORT_H_ */ |