diff options
author | Florin Coras <fcoras@cisco.com> | 2020-01-21 18:33:23 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-01-23 19:21:57 +0000 |
commit | 68b7e5888cbfc1fafd38971c725ce10268ad3841 (patch) | |
tree | 91dc18e56d813e2dcc6ee95c21eebf41aceb282f /src/vnet/session/session_api.c | |
parent | 87e64c929fa534ebd29b18f38fc6c15fd216e7e4 (diff) |
vcl session: udp session migration notifications
Type: feature
Change-Id: I402549818ba6e078802e914293304174dc6625c2
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_api.c')
-rw-r--r-- | src/vnet/session/session_api.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index 153c528059c..c6eeacfea18 100644 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -470,7 +470,28 @@ mq_send_unlisten_reply (app_worker_t * app_wrk, session_handle_t sh, static void mq_send_session_migrate_cb (session_t * s, session_handle_t new_sh) { - clib_warning ("not supported"); + svm_msg_q_msg_t _msg, *msg = &_msg; + session_migrated_msg_t *mp; + svm_msg_q_t *vpp_evt_q; + app_worker_t *app_wrk; + session_event_t *evt; + svm_msg_q_t *app_mq; + + app_wrk = app_worker_get (s->app_wrk_index); + app_mq = app_wrk->event_queue; + if (mq_try_lock_and_alloc_msg (app_mq, msg)) + return; + + evt = svm_msg_q_msg_data (app_mq, msg); + clib_memset (evt, 0, sizeof (*evt)); + evt->event_type = SESSION_CTRL_EVT_MIGRATED; + mp = (session_migrated_msg_t *) evt->data; + mp->handle = session_handle (s); + mp->new_handle = new_sh; + mp->vpp_thread_index = session_thread_from_handle (new_sh); + vpp_evt_q = session_main_get_vpp_event_queue (mp->vpp_thread_index); + mp->vpp_evt_q = pointer_to_uword (vpp_evt_q); + svm_msg_q_add_and_unlock (app_mq, msg); } static int |