summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_worker.c
diff options
context:
space:
mode:
authorRyujiro Shibuya <ryujiro.shibuya@owmobility.com>2020-01-22 12:11:42 +0000
committerDave Barach <openvpp@barachs.net>2020-02-25 19:18:49 +0000
commitd8f48e2166747b529aa23762ac314dd686590c89 (patch)
treeebd94006c2eb6be5db9c0f1fec5ff7f984aeb38a /src/vnet/session/application_worker.c
parent234fe894d80a6ebc7e457bc86f2eea80d5ef01ea (diff)
session: basic fifo-tuning-logic
- Allowing application to register custom fifo-tuning-logic. - Adding an example custom fifo-tuning-logic in hs_app/proxy. Type: feature Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2aca14d1f23d5c3c9debb7f4c46aca3a15a8d1b9
Diffstat (limited to 'src/vnet/session/application_worker.c')
-rw-r--r--src/vnet/session/application_worker.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c
index 0b67d2922bf..1793998f1e0 100644
--- a/src/vnet/session/application_worker.c
+++ b/src/vnet/session/application_worker.c
@@ -275,11 +275,16 @@ app_worker_init_accepted (session_t * s)
app_worker_t *app_wrk;
segment_manager_t *sm;
session_t *listener;
+ application_t *app;
listener = listen_session_get_from_handle (s->listener_handle);
app_wrk = application_listener_select_worker (listener);
s->app_wrk_index = app_wrk->wrk_index;
+ app = application_get (app_wrk->app_index);
+ if (app->cb_fns.fifo_tuning_callback)
+ s->flags |= SESSION_F_CUSTOM_FIFO_TUNING;
+
sm = app_worker_get_listen_segment_manager (app_wrk, listener);
if (app_worker_alloc_session_fifos (sm, s))
return -1;
@@ -307,6 +312,10 @@ app_worker_init_connected (app_worker_t * app_wrk, session_t * s)
if (app_worker_alloc_session_fifos (sm, s))
return -1;
}
+
+ if (app->cb_fns.fifo_tuning_callback)
+ s->flags |= SESSION_F_CUSTOM_FIFO_TUNING;
+
return 0;
}
@@ -433,6 +442,15 @@ app_worker_connect_session (app_worker_t * app, session_endpoint_t * sep,
}
int
+app_worker_session_fifo_tuning (app_worker_t * app_wrk, session_t * s,
+ svm_fifo_t * f,
+ session_ft_action_t act, u32 len)
+{
+ application_t *app = application_get (app_wrk->app_index);
+ return app->cb_fns.fifo_tuning_callback (s, f, act, len);
+}
+
+int
app_worker_alloc_connects_segment_manager (app_worker_t * app_wrk)
{
segment_manager_t *sm;