aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/hs_apps/proxy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/proxy.c b/src/plugins/hs_apps/proxy.c
index ad5b292c56d..a520110dce8 100644
--- a/src/plugins/hs_apps/proxy.c
+++ b/src/plugins/hs_apps/proxy.c
@@ -271,8 +271,16 @@ proxy_tx_callback (session_t * proxy_s)
session_handle_t handle;
proxy_session_t *ps;
session_t *ao_s;
+ u32 min_free;
uword *p;
+ min_free = clib_min (proxy_s->tx_fifo->nitems >> 3, 128 << 10);
+ if (svm_fifo_max_enqueue (proxy_s->tx_fifo) < min_free)
+ {
+ svm_fifo_add_want_deq_ntf (proxy_s->tx_fifo, SVM_FIFO_WANT_DEQ_NOTIF);
+ return 0;
+ }
+
clib_spinlock_lock_if_init (&pm->sessions_lock);
handle = session_handle (proxy_s);
@@ -414,8 +422,16 @@ active_open_tx_callback (session_t * ao_s)
session_handle_t handle;
proxy_session_t *ps;
session_t *proxy_s;
+ u32 min_free;
uword *p;
+ min_free = clib_min (ao_s->tx_fifo->nitems >> 3, 128 << 10);
+ if (svm_fifo_max_enqueue (ao_s->tx_fifo) < min_free)
+ {
+ svm_fifo_add_want_deq_ntf (ao_s->tx_fifo, SVM_FIFO_WANT_DEQ_NOTIF);
+ return 0;
+ }
+
clib_spinlock_lock_if_init (&pm->sessions_lock);
handle = session_handle (ao_s);