summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-10 08:17:03 -0800
committerDave Barach <openvpp@barachs.net>2018-01-11 22:06:14 +0000
commitaf0ff5af0cd471033169e63c6111d23cd801928c (patch)
tree26abdbe9637ec38416ea819bc8d0ad1e0a19dfe1 /src/vnet/l2
parentee7e1f50726490990b593b850857b3877c9a687f (diff)
api: fix handlers that explicitly depend on svm queue
Fixes the remainig apis that explicitly check svm queue length. Change-Id: I6055c7c50050affee3098e162e15fb12c205e5db Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/l2')
-rw-r--r--src/vnet/l2/l2_fib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c
index 66bb8e3f3c7..55cffc8047c 100644
--- a/src/vnet/l2/l2_fib.c
+++ b/src/vnet/l2/l2_fib.c
@@ -962,12 +962,12 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only)
u32 client = lm->client_pid;
u32 cl_idx = lm->client_index;
vl_api_l2_macs_event_t *mp = 0;
- svm_queue_t *q = 0;
+ vl_api_registration_t *reg = 0;
if (client)
{
mp = allocate_mac_evt_buf (client, cl_idx);
- q = vl_api_client_index_to_input_queue (lm->client_index);
+ reg = vl_api_client_index_to_registration (lm->client_index);
}
for (i = 0; i < h->nbuckets; i++)
@@ -1016,15 +1016,15 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only)
if (PREDICT_FALSE (evt_idx >= fm->max_macs_in_event))
{
/* event message full, send it and start a new one */
- if (q && (q->cursize < q->maxsize))
+ if (reg && vl_api_can_send_msg (reg))
{
mp->n_macs = htonl (evt_idx);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
mp = allocate_mac_evt_buf (client, cl_idx);
}
else
{
- if (q)
+ if (reg)
clib_warning ("MAC event to pid %d queue stuffed!"
" %d MAC entries lost", client,
evt_idx);
@@ -1101,14 +1101,14 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only)
/* send any outstanding mac event message else free message buffer */
if (evt_idx)
{
- if (q && (q->cursize < q->maxsize))
+ if (reg && vl_api_can_send_msg (reg))
{
mp->n_macs = htonl (evt_idx);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
else
{
- if (q)
+ if (reg)
clib_warning ("MAC event to pid %d queue stuffed!"
" %d MAC entries lost", client, evt_idx);
vl_msg_api_free (mp);