From 4c553c5a5b40c21ba67bd82455e79678b204cd07 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 27 Dec 2018 14:26:11 +0100 Subject: Filter refactoring: dropped the recursion from the interpreter This is a major change of how the filters are interpreted. If everything works how it should, it should not affect you unless you are hacking the filters themselves. Anyway, this change should make a huge improvement in the filter performance as previous benchmarks showed that our major problem lies in the recursion itself. There are also some changes in nest and protocols, related mostly to spreading const declarations throughout the whole BIRD and also to refactored dynamic attribute definitions. The need of these came up during the whole work and it is too difficult to split out these not-so-related changes. --- proto/static/config.Y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'proto/static/config.Y') diff --git a/proto/static/config.Y b/proto/static/config.Y index d7a02961..56caef24 100644 --- a/proto/static/config.Y +++ b/proto/static/config.Y @@ -14,7 +14,7 @@ CF_DEFINES #define STATIC_CFG ((struct static_config *) this_proto) static struct static_route *this_srt, *this_snh; -static struct f_inst **this_srt_last_cmd; +static struct f_inst *this_srt_cmds, **this_srt_last_cmd; static struct static_route * static_nexthop_new(void) @@ -39,6 +39,8 @@ static_route_finish(void) { if (net_type_match(this_srt->net, NB_DEST) == !this_srt->dest) cf_error("Unexpected or missing nexthop/type"); + + this_srt->cmds = f_postfixify(this_srt_cmds); } CF_DECLS @@ -108,7 +110,8 @@ stat_route0: ROUTE net_any { this_srt = cfg_allocz(sizeof(struct static_route)); add_tail(&STATIC_CFG->routes, &this_srt->n); this_srt->net = $2; - this_srt_last_cmd = &(this_srt->cmds); + this_srt_cmds = NULL; + this_srt_last_cmd = &this_srt_cmds; this_srt->mp_next = NULL; this_snh = NULL; } -- cgit v1.2.3