aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bier/bier_api.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-09 06:39:23 -0800
committerDave Barach <openvpp@barachs.net>2018-01-11 19:46:01 +0000
commit6c4dae27e75fc668f86c9cca0f3f58273b680621 (patch)
tree88c2adee0a2eb2c5e48471da2ef010e46cc270ab /src/vnet/bier/bier_api.c
parentf72212e00282712f5829a7f76a8cb6f486cdae60 (diff)
api: remove transport specific code from handlers
This does not update api client code. In other words, if the client assumes the transport is shmem based, this patch does not change that. Furthermore, code that checks queue size, for tail dropping, is not updated. Done for the following apis: Plugins - acl - gtpu - memif - nat - pppoe VNET - bfd - bier - tapv2 - vhost user - dhcp - flow - geneve - ip - punt - ipsec/ipsec-gre - l2 - l2tp - lisp-cp/one-cp - lisp-gpe - map - mpls - policer - session - span - udp - tap - vxlan/vxlan-gpe - interface VPP - api/api.c OAM - oam_api.c Stats - stats.c Change-Id: I0e33ecefb2bdab0295698c0add948068a5a83345 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/bier/bier_api.c')
-rw-r--r--src/vnet/bier/bier_api.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/vnet/bier/bier_api.c b/src/vnet/bier/bier_api.c
index f4d37321c53..840c33b7a37 100644
--- a/src/vnet/bier/bier_api.c
+++ b/src/vnet/bier/bier_api.c
@@ -106,7 +106,7 @@ vl_api_bier_table_add_del_t_handler (vl_api_bier_table_add_del_t * mp)
}
static void
-send_bier_table_details (svm_queue_t * q,
+send_bier_table_details (vl_api_registration_t * reg,
u32 context,
const bier_table_t *bt)
{
@@ -124,18 +124,18 @@ send_bier_table_details (svm_queue_t * q,
mp->bt_tbl_id.bt_sub_domain = bt->bt_id.bti_sub_domain;
mp->bt_tbl_id.bt_hdr_len_id = bt->bt_id.bti_hdr_len;
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
vl_api_bier_table_dump_t_handler (vl_api_bier_table_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
bier_table_t *bt;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- return;
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
pool_foreach(bt, bier_table_pool,
({
@@ -144,7 +144,7 @@ vl_api_bier_table_dump_t_handler (vl_api_bier_table_dump_t * mp)
*/
if (bier_table_is_main(bt))
{
- send_bier_table_details(q, mp->context, bt);
+ send_bier_table_details(reg, mp->context, bt);
}
}));
}
@@ -252,7 +252,7 @@ done:
typedef struct bier_route_details_walk_t_
{
- svm_queue_t * q;
+ vl_api_registration_t * reg;
u32 context;
} bier_route_details_walk_t;
@@ -296,17 +296,17 @@ send_bier_route_details (const bier_table_t *bt,
fp++;
}
- vl_msg_api_send_shmem (ctx->q, (u8 *) & mp);
+ vl_api_send_msg (ctx->reg, (u8 *) mp);
}
static void
vl_api_bier_route_dump_t_handler (vl_api_bier_route_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- return;
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
bier_table_id_t bti = {
.bti_set = mp->br_tbl_id.bt_set,
@@ -316,7 +316,7 @@ vl_api_bier_route_dump_t_handler (vl_api_bier_route_dump_t * mp)
.bti_ecmp = BIER_ECMP_TABLE_ID_MAIN,
};
bier_route_details_walk_t ctx = {
- .q = q,
+ .reg = reg,
.context = mp->context,
};
bier_table_walk(&bti, send_bier_route_details, &ctx);
@@ -371,7 +371,7 @@ vl_api_bier_imp_del_t_handler (vl_api_bier_imp_del_t * mp)
}
static void
-send_bier_imp_details (svm_queue_t * q,
+send_bier_imp_details (vl_api_registration_t * reg,
u32 context,
const bier_imp_t *bi)
{
@@ -400,22 +400,22 @@ send_bier_imp_details (svm_queue_t * q,
mp->bi_n_bytes = n_bytes;
memcpy(mp->bi_bytes, bi->bi_bits.bits, n_bytes);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
vl_api_bier_imp_dump_t_handler (vl_api_bier_imp_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
bier_imp_t *bi;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- return;
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
pool_foreach(bi, bier_imp_pool,
({
- send_bier_imp_details(q, mp->context, bi);
+ send_bier_imp_details(reg, mp->context, bi);
}));
}
@@ -446,7 +446,7 @@ vl_api_bier_disp_table_add_del_t_handler (vl_api_bier_disp_table_add_del_t * mp)
}
static void
-send_bier_disp_table_details (svm_queue_t * q,
+send_bier_disp_table_details (vl_api_registration_t * reg,
u32 context,
const bier_disp_table_t *bdt)
{
@@ -461,22 +461,22 @@ send_bier_disp_table_details (svm_queue_t * q,
mp->bdt_tbl_id = htonl(bdt->bdt_table_id);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
vl_api_bier_disp_table_dump_t_handler (vl_api_bier_disp_table_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
bier_disp_table_t *bdt;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- return;
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
pool_foreach(bdt, bier_disp_table_pool,
({
- send_bier_disp_table_details(q, mp->context, bdt);
+ send_bier_disp_table_details(reg, mp->context, bdt);
}));
}
@@ -603,7 +603,7 @@ done:
typedef struct bier_disp_entry_details_walk_t_
{
- svm_queue_t * q;
+ vl_api_registration_t * reg;
u32 context;
} bier_disp_entry_details_walk_t;
@@ -653,7 +653,7 @@ send_bier_disp_entry_details (const bier_disp_table_t *bdt,
fp++;
}
- vl_msg_api_send_shmem (ctx->q, (u8 *) & mp);
+ vl_api_send_msg (ctx->reg, (u8 *) mp);
}
}
}
@@ -661,14 +661,14 @@ send_bier_disp_entry_details (const bier_disp_table_t *bdt,
static void
vl_api_bier_disp_entry_dump_t_handler (vl_api_bier_disp_entry_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- return;
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
+ return;
bier_disp_entry_details_walk_t ctx = {
- .q = q,
+ .reg = reg,
.context = mp->context,
};
bier_disp_table_walk(ntohl(mp->bde_tbl_id),