Commit graph

3831 commits

Author SHA1 Message Date
Ondrej Zajicek (work)
875cc073b0 Nest: Update handling of temporary attributes
The temporary atttributes are no longer removed by ea_do_prune(), but
they are undefined by store_tmp_attrs() protocol hooks. This fixes
several bugs where temporary attributes were removed when they should
not or not removed when they should be. The flag EAF_TEMP is no longer
needed and was removed.

Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use
helper functions and to handle unset attributes properly.

Also fix some related bugs like improper handling of empty eattr list.
2019-03-14 17:31:40 +01:00
Ondrej Zajicek (work)
9aa77fcceb OSPF: Improved handling of tmpattrs
Keep track of whether OSPF tmpattrs are actually defined for given route
(using flags in rte->pflags). That makes them behave more like real
eattrs so a protocol can define just a subset of them or they can be
undefined by filters.

Do not set ospf_metric2 for other than type 2 external OSPF routes and do
not set ospf_tag for non-external OSPF routes. That also fixes a bug
where internal/inter-area route propagated from one OSPF instance to
another is initiated with infinity ospf_metric2.

Thanks to Yaroslav Dronskii for the bugreport.
2019-03-06 18:28:00 +01:00
Maria Matejka
e1ac6f1e30 Faster filters: documentation on what is happening there 2019-03-06 15:01:39 +01:00
Maria Matejka
a68442e056 Fixed link time optimizer check for FreeBSD 2019-02-27 14:40:05 +01:00
Ondrej Zajicek (work)
b9deced219 NEWS and version update 2019-02-26 18:21:39 +01:00
Maria Matejka
f249d0b84c Filters: comparison of functions and filters caching 2019-02-26 16:44:24 +01:00
Maria Matejka
0d12aa4836 Build: No link time optimization when debug is enabled 2019-02-26 16:11:40 +01:00
Maria Matejka
2915e711f7 Custom number parser to speed up config parsing
The glibc's generic parser is slow due to its versatility. Specialized
parsers for base-10 and base-16 are much faster and we don't use other
bases.
2019-02-25 23:28:36 +01:00
Maria Matejka
99911873a1 Conf: Lexer parses quoted strings in a more descriptive way 2019-02-25 17:22:59 +01:00
Maria Matejka
7c36eb3e8b Conf: Switch for faster (and slightly bigger) lexer 2019-02-22 12:43:43 +01:00
Maria Matejka
412614c700 Conf: Switch for faster (and slightly bigger) lexer 2019-02-22 12:41:51 +01:00
Ondrej Zajicek (work)
93af78d2d2 Nest: Do not compare rte.flags during rte_update()
Route flags are mosty internal state of rtable, they are not significant
to whether a route has changed. With the old code, all routes received as
a part of enhanced route refresh are always re-announced to other peers
due to change in REF_STALE.
2019-02-22 02:16:39 +01:00
Maria Matejka
ad702bae0c Enabled link time optimization. 2019-02-20 22:30:55 +01:00
Maria Matejka
d1039926f5 Filter: Interpreter merged into the common m4 generator.
The config-time partial evaluation of constant expressions in filters is nearby.
2019-02-20 22:30:55 +01:00
Maria Matejka
32793ab685 Filter: Fixed bugs in FI_CALL and FI_SWITCH 2019-02-20 22:30:55 +01:00
Maria Matejka
d348a916f5 Test: Added -d flag to die directly after first error. 2019-02-20 22:30:55 +01:00
Maria Matejka
d4bf74816f GDB: Added more pretty printers for filters 2019-02-20 22:30:55 +01:00
Maria Matejka
ea4f55e3dc Filter: More cleanup -- customized structures also in struct f_line_item 2019-02-20 22:30:55 +01:00
Maria Matejka
0b39b1cbb7 Conf: Symbol implementation converted from void pointers to union
... and consted some declarations.
2019-02-20 22:30:55 +01:00
Maria Matejka
132529ce89 Filter: merged filter compare functions into common M4 file 2019-02-20 22:30:55 +01:00
Maria Matejka
dd4d409551 Filter: Merged postfixify routine 2019-02-20 22:30:54 +01:00
Maria Matejka
de12cd18fb Filter: Merged filter line item dumpers into common generated source 2019-02-20 22:30:54 +01:00
Maria Matejka
b256f24145 Filter: auto-generating enum-to-string 2019-02-20 22:30:54 +01:00
Maria Matejka
041608129a Filter generator: workaround for M4 claiming all the put-around code be on one line 2019-02-20 22:30:54 +01:00
Maria Matejka
5289304519 Filter data manipulation functions separated to their file 2019-02-20 22:30:54 +01:00
Maria Matejka
87bd7cd7b0 Filter: split the constructors to a separate file 2019-02-20 22:30:54 +01:00
Maria Matejka
75206f266f Conf: Fixed makefiles 2019-02-20 22:30:54 +01:00
Maria Matejka
4f082dfa89 Filter: merged filter instruction constructors, counting line size on instruction construct 2019-02-20 22:30:54 +01:00
Maria Matejka
0a793ebc60 Test: Fixed annoying warnings (and possible obscure bugs). 2019-02-20 22:30:54 +01:00
Maria Matejka
8bdb05edb2 Filters: split the large filter.h file to smaller files.
This should be revised, there are still ugly things in the filter API.
2019-02-20 22:30:54 +01:00
Maria Matejka
c1e97169cd Filter: M4 convertors polished a bit. 2019-02-20 22:30:54 +01:00
Maria Matejka
c0e958e022 Filter + Config: Fix bugs, tests and split symbols by type 2019-02-20 22:30:54 +01:00
Maria Matejka
713658798d GDB pretty printers: f_inst and f_val. 2019-02-20 22:30:54 +01:00
Maria Matejka
9b46748d5b Filter: refactoring of instruction constructors 2019-02-20 22:30:54 +01:00
Maria Matejka
4c553c5a5b 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.
2019-02-20 22:30:54 +01:00
Maria Matejka
967b88d938 Filter refactoring: The instructions are converted to the switch body by M4 2019-02-20 22:30:54 +01:00
Maria Matejka
8436040735 Filter refactoring: Drop the roa check specific f_inst 2019-02-20 22:30:54 +01:00
Maria Matejka
ca2ee91a80 Filter refactoring: The constant f_val is simply included inside the instruction
With 32 bits, size of the args is 12 bytes, the f_val is 20 bytes.
With 64 bits, size of the args is 24 bytes, the f_val the same.

This is not so nice on 32 bits, anyway the f_inst itself is
24 vs. 32 bytes and the overall size of filters must be 32k of
instructions to get to one megabyte of RAM eaten by f_inst.

Therefore it seems to be improbable for common user to get into
problems with this change.
2019-02-20 22:30:54 +01:00
Maria Matejka
7f0ac73724 Filter refactoring: Changed arguments from separate unions to an array 2019-02-20 22:30:54 +01:00
Maria Matejka
224b77d4f7 Filter refactoring: Converted condition to three-args instruction 2019-02-20 22:30:54 +01:00
Maria Matejka
8e8b1fe48c Filter refactoring: Some instructions eat up excessively much space. 2019-02-20 22:30:54 +01:00
Maria Matejka
c577493908 Filter refactoring: Expanded the short instructions with common code.
This will make the further changes more straightforward.
2019-02-20 22:30:54 +01:00
Maria Matejka
a8740d6c09 Filter refactoring: indentation fix 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
fc8df41ec6 Filter refactoring: The values are now saved on a custom stack.
This shall help with performance.
2019-02-20 22:30:54 +01:00
Jan Maria Matejka
7afa143886 Filter refactoring: Passing the resulting struct f_val as a pointer.
This also drops the multiplexing of errors with the f_val itself
together with the T_RETURN f_val type flag.
2019-02-20 22:30:54 +01:00
Jan Maria Matejka
f62a369fb4 Filter refactoring: Moved filter instruction definition to a separate file 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
25566c6810 Filter refactoring: Moved the bitfield bit position formula to route.h 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
aca8263926 Filter refactoring: Moved the interpret macros inside the block 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
02dcbf343d Configure: Don't check for implicit fallthrough unless when debugging. 2019-02-20 22:30:53 +01:00
Jan Maria Matejka
a946317fab Filter: Converted static global variables to a filter_state struct.
The static filter state was messy and blocked the planned parallel
execution of filters. Anyway, this will be also slower as the state
structure must be passed almost everywhere with us.
2019-02-20 22:30:53 +01:00