aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/segment_manager.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-06-09 14:55:24 -0700
committerDave Barach <openvpp@barachs.net>2021-06-17 14:29:47 +0000
commitda78c5abc8a862d33ebd9b0e89ae781f1ea37532 (patch)
tree2b95a20f36e4852ca15f2dc2ce7d80af131f798f /src/vnet/session/segment_manager.c
parent975fde82b11307180b3df7dc9b5b1b496f207a08 (diff)
session: optimize ct fifo segment allocations
Allocate per app pair segments with space for more than one fifo. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib96fe12b899cb14ff20c0be607814011e2c3fc6a
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r--src/vnet/session/segment_manager.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 103f89ecfa8..a7ce989e8e3 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -498,8 +498,8 @@ sm_free_w_index_helper (void *arg)
segment_manager_free (sm);
}
-static void
-segment_manager_free_safe (segment_manager_t * sm)
+void
+segment_manager_free_safe (segment_manager_t *sm)
{
if (!vlib_thread_is_main_w_barrier ())
{
@@ -738,16 +738,16 @@ segment_manager_alloc_session_fifos (segment_manager_t * sm,
segment_manager_segment_reader_lock (sm);
- /* *INDENT-OFF* */
pool_foreach (cur, sm->segments) {
- free_bytes = fifo_segment_available_bytes (cur);
- if (free_bytes > max_free_bytes)
- {
- max_free_bytes = free_bytes;
- fs = cur;
- }
+ if (fifo_segment_flags (cur) & FIFO_SEGMENT_F_CUSTOM_USE)
+ continue;
+ free_bytes = fifo_segment_available_bytes (cur);
+ if (free_bytes > max_free_bytes)
+ {
+ max_free_bytes = free_bytes;
+ fs = cur;
+ }
}
- /* *INDENT-ON* */
if (fs)
{