Skip to content

Conversation

@maxime-leroy
Copy link
Collaborator

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.

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]>
Copy link
Collaborator Author

@maxime-leroy maxime-leroy left a 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 ?

Copy link
Collaborator

@rjarry rjarry left a 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]>
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]>
@rjarry rjarry merged commit 3736aeb into DPDK:main Jun 25, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants