From f50bac1bb25b02d7f086627c4c0a0709ee0f61d5 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Fri, 6 Dec 2019 05:53:17 +0000 Subject: vppinfra: bihash walk cb typedef and continue/stop controls Type: feature Change-Id: I28f7a658be3f3beec9ea32635b60d1d3a10d9b06 Signed-off-by: Neale Ranns --- src/plugins/gbp/gbp_endpoint.c | 10 ++++++---- src/plugins/pppoe/pppoe.c | 4 +++- src/plugins/unittest/bihash_test.c | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/gbp/gbp_endpoint.c b/src/plugins/gbp/gbp_endpoint.c index bef67770fd9..c6cab3fbfb8 100644 --- a/src/plugins/gbp/gbp_endpoint.c +++ b/src/plugins/gbp/gbp_endpoint.c @@ -1268,8 +1268,8 @@ gbp_endpoint_show_one (index_t gei, void *ctx) return (WALK_CONTINUE); } -static void -gbp_endpoint_walk_ip_itf (const clib_bihash_kv_24_8_t * kvp, void *arg) +static int +gbp_endpoint_walk_ip_itf (clib_bihash_kv_24_8_t * kvp, void *arg) { ip46_address_t ip; vlib_main_t *vm; @@ -1283,10 +1283,11 @@ gbp_endpoint_walk_ip_itf (const clib_bihash_kv_24_8_t * kvp, void *arg) format_ip46_address, &ip, IP46_TYPE_ANY, format_vnet_sw_if_index_name, vnet_get_main (), sw_if_index, kvp->value); + return (BIHASH_WALK_CONTINUE); } -static void -gbp_endpoint_walk_mac_itf (const clib_bihash_kv_16_8_t * kvp, void *arg) +static int +gbp_endpoint_walk_mac_itf (clib_bihash_kv_16_8_t * kvp, void *arg) { mac_address_t mac; vlib_main_t *vm; @@ -1300,6 +1301,7 @@ gbp_endpoint_walk_mac_itf (const clib_bihash_kv_16_8_t * kvp, void *arg) format_mac_address_t, &mac, format_vnet_sw_if_index_name, vnet_get_main (), sw_if_index, kvp->value); + return (BIHASH_WALK_CONTINUE); } static clib_error_t * diff --git a/src/plugins/pppoe/pppoe.c b/src/plugins/pppoe/pppoe.c index 1f8a7288aeb..46faa1f33eb 100644 --- a/src/plugins/pppoe/pppoe.c +++ b/src/plugins/pppoe/pppoe.c @@ -628,7 +628,7 @@ typedef struct pppoe_show_walk_ctx_t_ u32 total_entries; } pppoe_show_walk_ctx_t; -static void +static int pppoe_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg) { pppoe_show_walk_ctx_t *ctx = arg; @@ -656,6 +656,8 @@ pppoe_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg) result.fields.session_index == ~0 ? -1 : result.fields.session_index); ctx->total_entries++; + + return (BIHASH_WALK_CONTINUE); } /** Display the contents of the PPPoE Fib. */ diff --git a/src/plugins/unittest/bihash_test.c b/src/plugins/unittest/bihash_test.c index 2dbc6b1b002..03524033884 100644 --- a/src/plugins/unittest/bihash_test.c +++ b/src/plugins/unittest/bihash_test.c @@ -244,11 +244,12 @@ test_bihash_threads (bihash_test_main_t * tm) /* * Callback to blow up spectacularly if anything remains in the table */ -static void +static int count_items (BVT (clib_bihash_kv) * kvp, void *notused) { _clib_error (CLIB_ERROR_ABORT, 0, 0, "bihash test FAILED, items left in table!"); + return (BIHASH_WALK_CONTINUE); } static clib_error_t * -- cgit 1.2.3-korg