aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-04 17:48:20 +0000
committerDave Barach <openvpp@barachs.net>2020-02-06 19:45:33 +0000
commitb71ef86c7429e81921997e54a526bf666a2e4089 (patch)
tree69273e392ff7c0f9116894514d7d2d1bae09bae4 /src
parent8dc954a4e7931c07051ce22f8446d6e5dfb9ce7d (diff)
hsa: proxy wnd update only if enough space is available
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2874d3afbf4cc89209b605c35ca4a5bc5b6868b3
Diffstat (limited to 'src')
-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);