cli_msg(-1006, " Routes: %u imported, %u exported, %u preferred",
in_routes, out_routes, SRI(pref));
- cli_msg(-1006, " Route change stats: received rejected filtered ignored RX limit IN limit accepted");
+ cli_msg(-1006, " Route change stats: received rejected filtered ignored RX limit limit accepted");
cli_msg(-1006, " Import updates: %10u %10u %10u %10u %10u %10u %10u",
SCI(updates_received), SCI(updates_invalid),
SCI(updates_filtered), SRI(updates_ignored),
SCI(updates_limited_rx), SCI(updates_limited_in),
SRI(updates_accepted));
- cli_msg(-1006, " Import withdraws: %10u %10u --- %10u --- %10u",
+ cli_msg(-1006, " Import withdraws: %10u %10u --- %10u --- --- %10u",
SCI(withdraws_received), SCI(withdraws_invalid),
SRI(withdraws_ignored), SRI(withdraws_accepted));
- cli_msg(-1006, " Export updates: %10u %10u %10u --- %10u %10u",
- SRE(updates_received), SCE(updates_rejected),
- SCE(updates_filtered), SCE(updates_limited), SCE(updates_accepted));
- cli_msg(-1006, " Export withdraws: %10u --- --- --- ---%10u",
- SRE(withdraws_received), SCE(withdraws_accepted));
+ cli_msg(-1006, " Export updates: %10u %10u %10u %10u --- %10u %10u",
+ SRE(updates_received), SCE(updates_rejected), SCE(updates_filtered),
+ SCE(updates_ignored), SCE(updates_limited), SCE(updates_accepted));
+ cli_msg(-1006, " Export withdraws: %10u --- --- %10u --- --- %10u",
+ SRE(withdraws_received), SCE(withdraws_ignored), SCE(withdraws_accepted));
#undef SRI
#undef SRE
struct channel_export_stats {
/* Export - from core to protocol */
+ u32 updates_ignored; /* Number of route updates ignored (squashed) by channel */
u32 updates_rejected; /* Number of route updates rejected by protocol */
u32 updates_filtered; /* Number of route updates rejected by filters */
u32 updates_accepted; /* Number of route updates accepted and exported */
u32 updates_limited; /* Number of route updates exceeding the out_limit */
+ u32 withdraws_ignored; /* Number of route withdraws ignored (squashed) by channel */
u32 withdraws_accepted; /* Number of route withdraws accepted and processed */
} export_stats;
{
/* Feeding more */
rtex_trace(r, D_ROUTES, "Feeding %N", feed->ni->addr);
+ r->stats.updates_received += feed->count_routes;
EXPORT_FOUND(RT_EXPORT_FEED);
}
else if (rt_export_get_state(r) == TES_DOWN)
ASSERT_DIE(feed && (feed != &rt_feed_index_out_of_range));
+ r->stats.updates_received += feed->count_routes;
EXPORT_FOUND(RT_EXPORT_FEED);
}
/* OK, now this actually is an update, thank you for your patience */
rtex_trace(r, D_ROUTES, "Updating %N, seq %lu", n, update->seq);
+ if (update->new)
+ r->stats.updates_received++;
+ else
+ r->stats.withdraws_received++;
+
EXPORT_FOUND(RT_EXPORT_UPDATE);
}
if (!old && new)
if (CHANNEL_LIMIT_PUSH(c, OUT))
{
- stats->updates_rejected++;
+ stats->updates_limited++;
channel_rte_trace_out(D_FILTERS, c, new, "rejected [limit]");
return;
}
{
const rte *trte = new ?: old;
+ /* Have we exported the old route? */
+ if (old && !bmap_test(&c->export_accepted_map, old->id))
+ old = NULL;
+
/* Ignore invalid routes */
if (!rte_is_valid(new))
new = NULL;
if (!new && !old)
{
channel_rte_trace_out(D_ROUTES, c, trte, "idempotent withdraw (filtered on import)");
+ c->export_stats.withdraws_ignored++;
return;
}
if (!np && !old)
{
channel_rte_trace_out(D_ROUTES, c, trte, "idempotent withdraw (filtered on export)");
+ /* No stats update, done in export_filter() */
return;
}
*/
if ((rpe->it.old == new) && (new || src && (src == rpe->it.new->src)))
{
+ /* Fix the stats: the old item is squashed (ignored) */
+ if (new)
+ c->export_stats.updates_ignored++;
+ else
+ c->export_stats.withdraws_ignored++;
+
+ /* Fix the stats: the new update is received */
+ if (rpe->it.new)
+ c->out_req.stats.updates_received++;
+ else
+ c->out_req.stats.withdraws_received++;
+
new = rpe->it.new;
rt_export_processed(&c->out_req, rpe->it.seq);
}
bug("Withdrawn route never seen before");
}
else if (!new && !old)
+ {
channel_rte_trace_out(D_ROUTES, c, u->update->new, "idempotent withdraw (squash)");
+ c->export_stats.withdraws_ignored++;
+ }
else
rt_notify_basic(c, new, old);
if (new && !old)
if (CHANNEL_LIMIT_PUSH(c, RX))
+ {
+ c->import_stats.updates_limited_rx++;
return 0;
+ }
if (!new && old)
CHANNEL_LIMIT_POP(c, RX);
if (c->in_keep & RIK_REJECTED)
new->flags |= REF_FILTERED;
else
+ {
+ c->import_stats.updates_limited_in++;
verdict = 0;
+ }
if (!new_in && old_in)
CHANNEL_LIMIT_POP(c, IN);