Maria Matejka
cf07d8ad79
Replaced boilerplate eattr allocation by ea_set_attr()
2022-05-04 15:38:40 +02:00
Maria Matejka
1d309c4ce6
Enforcing certain data structure explicit paddings.
...
Implicit paddings have undefined values in C. We want the eattr blocks
to be comparable by memcmp and eattrs settable directly by structrure
literals. This check ensures that all paddings in eattr and bval are
explicit and therefore zeroed in all literals.
2022-05-04 15:37:41 +02:00
Maria Matejka
c1194ab7ed
Protocols use EA_LITERAL_* to set attributes
2022-05-04 15:37:41 +02:00
Maria Matejka
ef4313e166
Local route attributes are always allocated from tmp_linpool
2022-05-04 15:37:41 +02:00
Maria Matejka
f2f3163f6c
Filters always allocate from tmp_linpool
2022-05-04 15:37:41 +02:00
Maria Matejka
de86040b2c
Attribute list normalization cleanup
2022-05-04 15:37:41 +02:00
Maria Matejka
0b871c1704
Moved filter value union to lib
2022-05-04 15:37:41 +02:00
Maria Matejka
3fb70b26fa
Complex route attributes are data structures, shall be in lib also
2022-05-04 15:37:41 +02:00
Maria Matejka
ef6a903e6f
Splitting route data structures out to lib
2022-05-04 15:37:41 +02:00
Maria Matejka
0e1e632f70
FIB is a data structure generic enough to be in lib
2022-05-04 15:37:41 +02:00
Maria Matejka
58f59d5d9d
Filters: removing adata_empty() duplicating lp_alloc_adata()
2022-05-04 15:37:41 +02:00
Maria Matejka
0d0f6554a5
Unified attribute and filter types
...
This commit removes the EAF_TYPE_* namespace completely and also for
route attributes, filter-based types T_* are used. This simplifies
fetching and setting route attributes from filters.
Also, there is now union bval which serves as an universal value holder
instead of private unions held separately by eattr and filter code.
2022-05-04 15:37:41 +02:00
Maria Matejka
80272d4b64
Opaque types are named opaque also in filters
2022-05-04 15:37:41 +02:00
Maria Matejka
22f95d9889
Special attribute types for enums
2022-05-04 15:37:41 +02:00
Maria Matejka
e261b32511
Dropping EAF_VAR_LENGTH as the attribute data is either embedded or adata
2022-05-04 15:37:41 +02:00
Maria Matejka
bc17fee1bf
Filter: Bitfield eattrs reading / writing moved to filter code
...
Before this change, fetch-update-write and bitmasking was hardcoded in
attribute access code cased by the attribute type. Several filter
instructions are used to do it instead.
As this is certainly going to be a little bit slower than before, the
switch block in attribute access code should be completely removed in
near future, helping with both performance and code cleanliness.
The user interface should have stayed intact.
2022-05-04 15:37:41 +02:00
Maria Matejka
d4bcef0e0b
Filter operations: bitwise AND and OR
2022-05-04 15:37:41 +02:00
Maria Matejka
cd9550b244
Implicit ROA check converted to explicit filter instruction sequence
2022-05-04 15:37:41 +02:00
Alexander Zubkov
5299fb9db0
Fixed spurious undef of route attributes
2022-05-04 15:37:23 +02:00
Maria Matejka
98fd158e28
RIP: fixed the EA_RIP_FROM attribute
...
The interface pointer was improperly converted to u32 and back. Fixing
this by explicitly allocating an adata structure for it. It's not so
memory efficient, we'll optimize this later.
2022-04-13 17:05:12 +02:00
Maria Matejka
d39ef961d1
BGP uses lp_save / lp_restore instead of linpool flushing
...
It is too cryptic to flush tmp_linpool in these cases and we don't want
anybody in the future to break this code by adding an allocation
somewhere which should persist over that flush.
Saving and restoring linpool state is safer.
2022-04-06 18:14:08 +02:00
Maria Matejka
7e86ff2076
All linpools use pages to allocate regular blocks
2022-04-06 18:14:08 +02:00
Maria Matejka
dabd7bccb3
BGP: Fixed LLGR depreferencing in bgp_rte_mergable
2022-04-06 18:14:08 +02:00
Maria Matejka
4a23ede2b0
Protocols have their own explicit init routines
2022-04-06 18:14:08 +02:00
Maria Matejka
0f68515263
Unsetting route attributes without messing with type system
2022-04-06 18:14:08 +02:00
Maria Matejka
63cf5d5d8c
Eattr flags (originated and fresh) get their own struct fields
2022-04-06 18:14:08 +02:00
Maria Matejka
af8568a870
Minor fix: f_val literals should always have named struct fields
2022-04-06 18:14:08 +02:00
Maria Matejka
170b20701c
Converted Slab allocator to typed lists
2022-04-06 18:14:08 +02:00
Maria Matejka
ebd807c0b8
Slab allocator can free the blocks without knowing the parent structure
2022-04-06 18:14:08 +02:00
Maria Matejka
3a6eda995e
Typed lists for easier walking and stronger type checking
2022-04-06 18:14:08 +02:00
Maria Matejka
c53f547a0b
Printf variant with a result allocated inside a pool / linpool
2022-03-15 11:21:46 +01:00
Maria Matejka
3c42f7af6a
Slab memory allocator unit test
2022-03-14 17:37:56 +01:00
Maria Matejka
4e60b3ee72
Fixed a static assert in page allocator
2022-03-09 13:28:03 +01:00
Maria Matejka
9b6db9f9b8
Merge remote-tracking branch 'origin/master' into haugesund
2022-03-09 11:51:00 +01:00
Maria Matejka
19e727a248
Merge commit '60880b539b8886f76961125d89a265c6e1112b7a' into haugesund
2022-03-09 11:29:56 +01:00
Maria Matejka
8a4bc4fdbf
BGP Flowspec validation: Removed in-route optimization for multithreading compatibility
2022-03-09 11:27:34 +01:00
Maria Matejka
24773af9e0
Merge commit 'e42eedb9' into haugesund
2022-03-09 11:02:55 +01:00
Maria Matejka
83d9920f90
Merge commit '5cff1d5f' into haugesund
...
Conflicts:
proto/bgp/attrs.c
proto/pipe/pipe.c
2022-03-09 10:56:06 +01:00
Maria Matejka
ff47cd80dd
Merge commit 'd5a32563' into haugesund
2022-03-09 10:50:38 +01:00
Maria Matejka
9e60a1fbc3
Fixed resource initialization in unit tests
2022-03-09 10:30:42 +01:00
Maria Matejka
b90c9b164f
Linpools with pages fixed to the final page allocator version
2022-03-09 10:30:42 +01:00
Maria Matejka
eeec9ddbf2
Merge commit '0c59f7ff' into haugesund
2022-03-09 09:13:55 +01:00
Maria Matejka
0c59f7ff01
Revert "Bound allocated pages to resource pools with page caches to avoid unnecessary syscalls"
...
This reverts commit 7f0e598208
.
2022-03-09 09:13:31 +01:00
Maria Matejka
c20506dc07
Revert "fixup! Bound allocated pages to resource pools with page caches to avoid unnecessary syscalls"
...
This reverts commit bea582cbb5
.
2022-03-09 09:13:21 +01:00
Maria Matejka
1c7df2c240
Revert "Multipage allocation"
...
This reverts commit 6cd3771378
.
2022-03-09 09:13:20 +01:00
Maria Matejka
1740ff57e8
Revert "fixup! Multipage allocation"
...
This reverts commit a54f75f454
.
2022-03-09 09:13:18 +01:00
Maria Matejka
c78247f9b9
Single-threaded version of sark-branch memory page management
2022-03-09 09:10:44 +01:00
Maria Matejka
06ece3265e
Replacing BGP temporary linpools by the common temporary linpool
2022-03-02 12:13:49 +01:00
Maria Matejka
d814a8cb93
Replaced custom linpools in tests for the common tmp_linpool
2022-03-02 12:13:49 +01:00
Maria Matejka
48bf1322aa
Introducing an universal temporary linpool flushed after every task
2022-03-02 12:13:49 +01:00