summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp_input.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-12-02 21:14:56 -0800
committerDave Barach <openvpp@barachs.net>2021-02-26 21:58:12 +0000
commit30fdf39628c095ed4a5d607079c1b18294050c56 (patch)
tree36f2c9a87fe9565f974437339e6a85c18cefd598 /src/vnet/udp/udp_input.c
parent4f0ac7e833fffe8fec659037efe0928d1bba0677 (diff)
udp: avoid locking connected udp sessions on rx
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I52aa2322980b51cfc0b282fb37d7f63d30777dee
Diffstat (limited to 'src/vnet/udp/udp_input.c')
-rw-r--r--src/vnet/udp/udp_input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c
index 523ab029bd4..c76c1b796bd 100644
--- a/src/vnet/udp/udp_input.c
+++ b/src/vnet/udp/udp_input.c
@@ -134,7 +134,8 @@ udp_connection_enqueue (udp_connection_t * uc0, session_t * s0,
{
int wrote0;
- clib_spinlock_lock (&uc0->rx_lock);
+ if (!(uc0->flags & UDP_CONN_F_CONNECTED))
+ clib_spinlock_lock (&uc0->rx_lock);
if (svm_fifo_max_enqueue_prod (s0->rx_fifo)
< hdr0->data_length + sizeof (session_dgram_hdr_t))
@@ -163,7 +164,8 @@ udp_connection_enqueue (udp_connection_t * uc0, session_t * s0,
unlock_rx_lock:
- clib_spinlock_unlock (&uc0->rx_lock);
+ if (!(uc0->flags & UDP_CONN_F_CONNECTED))
+ clib_spinlock_unlock (&uc0->rx_lock);
}
always_inline session_t *