-
Notifications
You must be signed in to change notification settings - Fork 23
Srv6 policy fixes #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Srv6 policy fixes #241
Conversation
413a28e to
9930bd2
Compare
Rename leftover uses of "policy" to "route" in SRv6 CLI and control path. This reflects the transition from SRv6 policies to routes. Fixes: 7ebb371 ("srv6: remove policy logic from dataplane") Signed-off-by: Maxime Leroy <[email protected]>
Invert the check in nexthop_type_ops_register(): abort only if ops->free is NULL. Fixes: a013272 ("nexthop: introduce type operations") Signed-off-by: Maxime Leroy <[email protected]>
rte_calloc is used, not rte_zmalloc. Fixes: a188078 ("infra: replace port with interface abstraction") Signed-off-by: Maxime Leroy <[email protected]>
Move inner_ip{4,6}, segments, and k to block scope.
Use uint8_t for proto and reduc.
Drop unused or redundant initializations.
Signed-off-by: Maxime Leroy <[email protected]>
Remove old commented-out code in srv6_encap_data_release() that was left over from the transition away from the SRv6 encap hash table. This should have been cleaned up when the hash was removed during the initial import into the grout tree. Fixes: 7ebb371 ("srv6: remove policy logic from dataplane") Signed-off-by: Maxime Leroy <[email protected]>
Check _d, not d, after calloc to avoid crash on allocation failure. Fixes: 7ebb371 ("srv6: remove policy logic from dataplane") Signed-off-by: Maxime Leroy <[email protected]>
api_out expects a positive errno value. Return EEXIST, not -EEXIST. Fixes: 7ebb371 ("srv6: remove policy logic from dataplane") Signed-off-by: Maxime Leroy <[email protected]>
Correct the logic in srv6_route_del(): we must delete the nexthop only if its encap data exists. If not, return ENOENT. Previously, the test was inverted and returned EEXIST even when nothing was present. Fixes: 7ebb371 ("srv6: remove policy logic from dataplane") Signed-off-by: Maxime Leroy <[email protected]>
9930bd2 to
f3036e6
Compare
maxime-leroy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About srv6_priv.h not sure, in which folder it should be. There is any common folder for grout modules ?
rjarry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I just wonder if you should squash the last two commits.
The encap segment-list no longer needs its own hash table. We can reuse the existing nexthop private-data facility, allocating the variable-length `struct srv6_encap_data` once per SRv6 nexthop and freeing it via the nexthop-type `free` callback. Signed-off-by: Maxime Leroy <[email protected]>
This ensures memory is allocated from hugepages and aligned to the cache line size (128 bytes on ARM), reducing TLB misses and improving dataplane performance. While rte_malloc adds more overhead (~2 cache lines per allocation), the number of SRv6 routes is limited (e.g., 5000 routes → ~1.2 MiB on ARM), which is acceptable. Signed-off-by: Maxime Leroy <[email protected]>
f3036e6 to
8dc1cb2
Compare
Use a file organisation similar to ip or ip6 modules. Signed-off-by: Maxime Leroy <[email protected]>
Split cli.c into two files. Each file configure a specific object (i.e. localsid and srv6 route). Signed-off-by: Maxime Leroy <[email protected]>
Align with Grout’s <feature>_output naming (cf. ipip_output): rename srv6_headend.c to srv6_output.c, update the node symbol, process function, and registration strings. Signed-off-by: Maxime Leroy <[email protected]>
Align nexhop type name to the new name of the srv6 node. Signed-off-by: Maxime Leroy <[email protected]>
Grout style use C++ comment, let's fix it. Signed-off-by: Maxime Leroy <[email protected]>
8dc1cb2 to
d37dc1c
Compare
several fixes because srv6 rework has been pushed too fast.
use nexthop_type_ops_register to remove hash table to store segment lists of nexthop.