Skip to content

Commit 98b11de

Browse files
committed
zebra: Modify show zebra dplane providers to give more data
The show zebra dplane provider command was ommitting the input and output queues to the dplane itself. It would be nice to have this insight as well. New output: r1# show zebra dplane providers dataplane Incoming Queue from Zebra: 100 Zebra dataplane providers: Kernel (1): in: 6, q: 0, q_max: 3, out: 6, q: 14, q_max: 3 dplane_fpm_nl (2): in: 6, q: 10, q_max: 3, out: 6, q: 0, q_max: 3 dataplane Outgoing Queue to Zebra: 43 r1# Signed-off-by: Donald Sharp <sharpd@nvidia.com>
1 parent 8926ac1 commit 98b11de

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

zebra/rib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ extern int rib_add_gr_run(afi_t afi, vrf_id_t vrf_id, uint8_t proto,
631631
uint8_t instance, time_t restart_time);
632632

633633
extern void zebra_vty_init(void);
634+
extern uint32_t zebra_rib_dplane_results_count(void);
634635

635636
extern pid_t pid;
636637

zebra/zebra_dplane.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6127,12 +6127,14 @@ int dplane_show_provs_helper(struct vty *vty, bool detailed)
61276127
struct zebra_dplane_provider *prov;
61286128
uint64_t in, in_q, in_max, out, out_q, out_max;
61296129

6130-
vty_out(vty, "Zebra dataplane providers:\n");
6131-
61326130
DPLANE_LOCK();
61336131
prov = dplane_prov_list_first(&zdplane_info.dg_providers);
6132+
in = dplane_ctx_queue_count(&zdplane_info.dg_update_list);
61346133
DPLANE_UNLOCK();
61356134

6135+
vty_out(vty, "dataplane Incoming Queue from Zebra: %" PRIu64 "\n", in);
6136+
vty_out(vty, "Zebra dataplane providers:\n");
6137+
61366138
/* Show counters, useful info from each registered provider */
61376139
while (prov) {
61386140
dplane_provider_lock(prov);
@@ -6151,13 +6153,19 @@ int dplane_show_provs_helper(struct vty *vty, bool detailed)
61516153
out_max = atomic_load_explicit(&prov->dp_out_max,
61526154
memory_order_relaxed);
61536155

6154-
vty_out(vty, "%s (%u): in: %"PRIu64", q: %"PRIu64", q_max: %"PRIu64", out: %"PRIu64", q: %"PRIu64", q_max: %"PRIu64"\n",
6155-
prov->dp_name, prov->dp_id, in, in_q, in_max,
6156-
out, out_q, out_max);
6156+
vty_out(vty,
6157+
" %s (%u): in: %" PRIu64 ", q: %" PRIu64
6158+
", q_max: %" PRIu64 ", out: %" PRIu64 ", q: %" PRIu64
6159+
", q_max: %" PRIu64 "\n",
6160+
prov->dp_name, prov->dp_id, in, in_q, in_max, out,
6161+
out_q, out_max);
61576162

61586163
prov = dplane_prov_list_next(&zdplane_info.dg_providers, prov);
61596164
}
61606165

6166+
out = zebra_rib_dplane_results_count();
6167+
vty_out(vty, "dataplane Outgoing Queue to Zebra: %" PRIu64 "\n", out);
6168+
61616169
return CMD_SUCCESS;
61626170
}
61636171

zebra/zebra_rib.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5108,6 +5108,17 @@ static int rib_dplane_results(struct dplane_ctx_list_head *ctxlist)
51085108
return 0;
51095109
}
51105110

5111+
uint32_t zebra_rib_dplane_results_count(void)
5112+
{
5113+
uint32_t count;
5114+
5115+
frr_with_mutex (&dplane_mutex) {
5116+
count = dplane_ctx_queue_count(&rib_dplane_q);
5117+
}
5118+
5119+
return count;
5120+
}
5121+
51115122
/*
51125123
* Ensure there are no empty slots in the route_info array.
51135124
* Every route type in zebra should be present there.

0 commit comments

Comments
 (0)