aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-12-10 18:52:40 -0800
committerFlorin Coras <florin.coras@gmail.com>2020-12-29 21:04:39 +0000
commit14f066e95100cfdcd5f0531e35ba84b7b859a00a (patch)
tree53118cd229784f7a38bc5a4d06f2f3591d43c996 /src/vnet/session
parentb462418890240b2e38dbf522f9dd0196b79e0fa8 (diff)
svm vcl: allow random offsets for fifo segments in apps
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1658a9c19d8eae4c9a42c0a111d4ad343b8eb8a4
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session_api.c20
-rw-r--r--src/vnet/session/session_node.c4
2 files changed, 12 insertions, 12 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 4602a783e60..2073a15af64 100644
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -148,8 +148,8 @@ mq_send_session_accepted_cb (session_t * s)
mp = (session_accepted_msg_t *) evt->data;
clib_memset (mp, 0, sizeof (*mp));
mp->context = app->app_index;
- mp->server_rx_fifo = pointer_to_uword (s->rx_fifo->shr);
- mp->server_tx_fifo = pointer_to_uword (s->tx_fifo->shr);
+ mp->server_rx_fifo = fifo_segment_fifo_offset (s->rx_fifo);
+ mp->server_tx_fifo = fifo_segment_fifo_offset (s->tx_fifo);
mp->segment_handle = session_segment_handle (s);
mp->flags = s->flags;
@@ -313,8 +313,8 @@ mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context,
session_get_endpoint (s, &mp->lcl, 1 /* is_lcl */ );
- mp->server_rx_fifo = pointer_to_uword (s->rx_fifo->shr);
- mp->server_tx_fifo = pointer_to_uword (s->tx_fifo->shr);
+ mp->server_rx_fifo = fifo_segment_fifo_offset (s->rx_fifo);
+ mp->server_tx_fifo = fifo_segment_fifo_offset (s->tx_fifo);
mp->segment_handle = session_segment_handle (s);
}
else
@@ -328,12 +328,12 @@ mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context,
mp->lcl.is_ip4 = cct->c_is_ip4;
mp->vpp_event_queue_address =
fifo_segment_msg_q_offset (eq_seg, s->thread_index);
- mp->server_rx_fifo = pointer_to_uword (s->rx_fifo->shr);
- mp->server_tx_fifo = pointer_to_uword (s->tx_fifo->shr);
+ mp->server_rx_fifo = fifo_segment_fifo_offset (s->rx_fifo);
+ mp->server_tx_fifo = fifo_segment_fifo_offset (s->tx_fifo);
mp->segment_handle = session_segment_handle (s);
ss = ct_session_get_peer (s);
- mp->ct_rx_fifo = pointer_to_uword (ss->tx_fifo->shr);
- mp->ct_tx_fifo = pointer_to_uword (ss->rx_fifo->shr);
+ mp->ct_rx_fifo = fifo_segment_fifo_offset (ss->tx_fifo);
+ mp->ct_tx_fifo = fifo_segment_fifo_offset (ss->rx_fifo);
mp->ct_segment_handle = session_segment_handle (ss);
}
@@ -395,8 +395,8 @@ mq_send_session_bound_cb (u32 app_wrk_index, u32 api_context,
if (session_transport_service_type (ls) == TRANSPORT_SERVICE_CL)
{
- mp->rx_fifo = pointer_to_uword (ls->rx_fifo->shr);
- mp->tx_fifo = pointer_to_uword (ls->tx_fifo->shr);
+ mp->rx_fifo = fifo_segment_fifo_offset (ls->rx_fifo);
+ mp->tx_fifo = fifo_segment_fifo_offset (ls->tx_fifo);
mp->segment_handle = session_segment_handle (ls);
}
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 49e4e5a6b10..37df0c450f8 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -472,8 +472,8 @@ session_mq_worker_update_handler (void *data)
evt->event_type = SESSION_CTRL_EVT_WORKER_UPDATE_REPLY;
rmp = (session_worker_update_reply_msg_t *) evt->data;
rmp->handle = mp->handle;
- rmp->rx_fifo = pointer_to_uword (s->rx_fifo->shr);
- rmp->tx_fifo = pointer_to_uword (s->tx_fifo->shr);
+ rmp->rx_fifo = fifo_segment_fifo_offset (s->rx_fifo);
+ rmp->tx_fifo = fifo_segment_fifo_offset (s->tx_fifo);
rmp->segment_handle = session_segment_handle (s);
svm_msg_q_add_and_unlock (app_wrk->event_queue, msg);