diff options
author | Florin Coras <fcoras@cisco.com> | 2020-12-11 13:58:12 -0800 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2020-12-29 12:11:07 -0800 |
commit | b462418890240b2e38dbf522f9dd0196b79e0fa8 (patch) | |
tree | 3ae26a22edb23da8d40f2c2b54eb96b056bca565 /src/vnet/session/session.c | |
parent | 04943b4c42db300d0d895644f32da79a6d411c51 (diff) |
svm: allow mq attachments at random offsets
Type: feature
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r-- | src/vnet/session/session.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 259e212e1a3..9a4d29bdf29 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -1508,7 +1508,6 @@ session_vpp_event_queues_allocate (session_main_t * smm) fifo_segment_t *eqs = &smm->evt_qs_segment; uword eqs_size = 64 << 20; pid_t vpp_pid = getpid (); - void *base; int i; if (smm->configured_event_queue_length) @@ -1531,6 +1530,9 @@ session_vpp_event_queues_allocate (session_main_t * smm) fifo_segment_init (eqs); + /* Special fifo segment that's filled only with mqs */ + eqs->h->n_mqs = vec_len (smm->wrk); + for (i = 0; i < vec_len (smm->wrk); i++) { svm_msg_q_cfg_t _cfg, *cfg = &_cfg; @@ -1544,8 +1546,7 @@ session_vpp_event_queues_allocate (session_main_t * smm) cfg->q_nitems = evt_q_length; cfg->ring_cfgs = rc; - base = fifo_segment_alloc (eqs, svm_msg_q_size_to_alloc (cfg)); - smm->wrk[i].vpp_event_queue = svm_msg_q_init (base, cfg); + smm->wrk[i].vpp_event_queue = fifo_segment_msg_q_alloc (eqs, i, cfg); if (svm_msg_q_alloc_consumer_eventfd (smm->wrk[i].vpp_event_queue)) clib_warning ("eventfd returned"); |