Skip to content

Conversation

@maxime-leroy
Copy link
Collaborator

@maxime-leroy maxime-leroy commented Jun 16, 2025

Simplified code, and fixes some issues

Simplify the SRv6 smoke test by removing unused IP(6) addresses:
- fd00:101::*/192.168.62.* are not involved in SRv6 forwarding
- client uses only IPv4, public netns only needs 192.168.60.1

Keeps the test minimal and focused.

Signed-off-by: Maxime Leroy <[email protected]>
Align the SRv6 test with other smoke tests by using a loop to create
namespaces, move interfaces into these ones and bring them up.

Signed-off-by: Maxime Leroy <[email protected]>
@maxime-leroy maxime-leroy marked this pull request as draft June 16, 2025 21:06
@maxime-leroy maxime-leroy force-pushed the srv6_local_fixes branch 2 times, most recently from 0a0c1a2 to 0d08260 Compare June 17, 2025 07:27
@maxime-leroy maxime-leroy force-pushed the srv6_local_fixes branch 6 times, most recently from 7706aad to 9ad6445 Compare June 20, 2025 07:54
Avoid using uninitialized ext_len if the call fails.

Fixes: 7d88a14 ("srv6: add srv6 module")
Signed-off-by: Maxime Leroy <[email protected]>
Add static decap_outer() that pulls the outer IPv6 header plus every
extension header and, when the IPv6 header hasn’t yet been
removed (ext_len != 0).
Drop the duplicate loops from decap/encap paths.

Signed-off-by: Maxime Leroy <[email protected]>
Add  ip6_input_register_nexthop_type method same that
ip6_output_register_nexthop_type but for input.

Signed-off-by: Maxime Leroy <[email protected]>
ip6_input_local_add_proto() used to redirect EVERY packet whose
Next-Header was 4 (IPv4-in-IPv6), 41 (IPv6-in-IPv6) or 43 (Routing) to
the SRv6 node. That broke ordinary IPv6 tunnels, which is not supported
today by grout.

Introduce GR_NH_SR6_LOCAL nexthop:
  - ip6_input sends a packet to the SRv6 local node *only* when the
    FIB lookup returns this nexthop type.
  - Drop the three protocol hooks and delete the now-redundant
    sr6_local_srh node.
  - Update control plane to set GR_NH_SR6_LOCAL on srv6 nexthop.

Signed-off-by: Maxime Leroy <[email protected]>
Move the Segment Routing (SR) header and IPv6 header pointers into the
ip6_info structure.

By embedding these pointers in ip6_info, the code becomes cleaner and
more consistent.

Signed-off-by: Maxime Leroy <[email protected]>
Add an union field allowing modules to store private addresses attached
to nexthop objects. This will be used for srv6 local.

Signed-off-by: Maxime Leroy <[email protected]>
Signed-off-by: Robin Jarry <[email protected]>
Store `struct srv6_localsid_data` in `nh->priv` instead of a separate
rte_hash. Control-plane code now fills the structure at add-time, and
the datapath fetches it directly from the nexthop, removing one hash
lookup per packet.

Signed-off-by: Maxime Leroy <[email protected]>
RFC 8986 defines three SRv6 flavours that decide how much of the outer
header stack is removed:

- PSP  Penultimate Segment Pop  -> penultimate node removes the SRH only
- USP  Ultimate Segment Pop     -> last node removes the SRH only
- USD  Ultimate Segment Decap   -> last node removes SRH and outer IPv6

The old code treated USP like USD: decap_outer() always stripped the
outer IPv6 before rebuilding a fresh header, violating the USP rule.

The following changes has been made:
- decap_srv6(): removes only the SRH.
- process_behav_end(): calls decap_srv6() for PSP (SL=1) and USP (SL=0).
- End.DT* and USD paths remain in process_behav_decap().

Fixes: 7d88a14 ("srv6: add srv6 module")
Signed-off-by: Maxime Leroy <[email protected]>
This patch introduces a pointer in the ip6_info structure (p_proto)
to track the location of the next_header field that points to the SRH.

This allows correctly updating the field regardless of whether it resides
in the base header or in an intermediate extension header (e.g.,
Destination Options).

Fixes: 7d88a14 ("srv6: add srv6 module")
Signed-off-by: Maxime Leroy <[email protected]>
Use dest4.prefixlen instead of dest6.prefixlen when showing IPv4 entries.

Fixes: 7d88a14 ("srv6: add srv6 module")
Signed-off-by: Maxime Leroy <[email protected]>
This api is not used by cli. Let's removed this dead code.

Signed-off-by: Maxime Leroy <[email protected]>
SRv6 policy (e.g. color-based selection) is a control-plane concept per
RFC 9256.

It should not be implemented in the dataplane, which only executes the
selected SID list and behavior. If needed, color-to-policy resolution
should be handled by FRR or another control plane component.

ECMP across multiple SRv6 paths should be implemented generically at the
nexthop level, not as SRv6-specific logic.

To do that, sr policy and steer are merged together to sr route.

Signed-off-by: Maxime Leroy <[email protected]>
@maxime-leroy maxime-leroy marked this pull request as ready for review June 20, 2025 13:19
@maxime-leroy maxime-leroy changed the title Srv6 local fixes Srv6 improvements and fixes Jun 20, 2025
@rjarry rjarry merged commit 7ebb371 into DPDK:main Jun 20, 2025
8 of 9 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