mbox series

[net-next,0/9] net: fib_rules: Add flow label selector support

Message ID 20241216171201.274644-1-idosch@nvidia.com (mailing list archive)
Headers show
Series net: fib_rules: Add flow label selector support | expand

Message

Ido Schimmel Dec. 16, 2024, 5:11 p.m. UTC
In some deployments users would like to encode path information into
certain bits of the IPv6 flow label, the UDP source port and the DSCP
and use this information to route packets accordingly.

Redirecting traffic to a routing table based on the flow label is not
currently possible with Linux as FIB rules cannot match on it despite
the flow label being available in the IPv6 flow key.

This patchset extends FIB rules to match on the flow label with a mask.
Future patches will add mask attributes to L4 ports and DSCP matches.

Patches #1-#5 gradually extend FIB rules to match on the flow label.

Patches #6-#7 allow user space to specify a flow label in route get
requests. This is useful for both debugging and testing.

Patch #8 adjusts the fib6_table_lookup tracepoint to print the flow
label to the trace buffer for better observability.

Patch #9 extends the FIB rule selftest with flow label test cases while
utilizing the route get functionality from patch #6.

Ido Schimmel (9):
  net: fib_rules: Add flow label selector attributes
  ipv4: fib_rules: Reject flow label attributes
  ipv6: fib_rules: Add flow label support
  net: fib_rules: Enable flow label selector usage
  netlink: specs: Add FIB rule flow label attributes
  ipv6: Add flow label to route get requests
  netlink: specs: Add route flow label attribute
  tracing: ipv6: Add flow label to fib6_table_lookup tracepoint
  selftests: fib_rule_tests: Add flow label selector match tests

 Documentation/netlink/specs/rt_route.yaml     |  7 +++
 Documentation/netlink/specs/rt_rule.yaml      | 12 ++++
 include/trace/events/fib6.h                   |  8 ++-
 include/uapi/linux/fib_rules.h                |  2 +
 include/uapi/linux/rtnetlink.h                |  1 +
 net/core/fib_rules.c                          |  2 +
 net/ipv4/fib_rules.c                          |  6 ++
 net/ipv6/fib6_rules.c                         | 57 ++++++++++++++++++-
 net/ipv6/route.c                              | 20 ++++++-
 tools/testing/selftests/net/fib_rule_tests.sh | 31 ++++++++++
 10 files changed, 140 insertions(+), 6 deletions(-)

Comments

Ido Schimmel Dec. 16, 2024, 5:16 p.m. UTC | #1
On Mon, Dec 16, 2024 at 07:11:52PM +0200, Ido Schimmel wrote:
> In some deployments users would like to encode path information into
> certain bits of the IPv6 flow label, the UDP source port and the DSCP
> and use this information to route packets accordingly.
> 
> Redirecting traffic to a routing table based on the flow label is not
> currently possible with Linux as FIB rules cannot match on it despite
> the flow label being available in the IPv6 flow key.
> 
> This patchset extends FIB rules to match on the flow label with a mask.
> Future patches will add mask attributes to L4 ports and DSCP matches.
> 
> Patches #1-#5 gradually extend FIB rules to match on the flow label.
> 
> Patches #6-#7 allow user space to specify a flow label in route get
> requests. This is useful for both debugging and testing.
> 
> Patch #8 adjusts the fib6_table_lookup tracepoint to print the flow
> label to the trace buffer for better observability.
> 
> Patch #9 extends the FIB rule selftest with flow label test cases while
> utilizing the route get functionality from patch #6.

Forgot to mention, iproute2 patches can be found here:
https://github.com/idosch/iproute2/tree/submit/flowlabel_rule_v1
Guillaume Nault Dec. 17, 2024, 2 p.m. UTC | #2
On Mon, Dec 16, 2024 at 07:11:52PM +0200, Ido Schimmel wrote:
> In some deployments users would like to encode path information into
> certain bits of the IPv6 flow label, the UDP source port and the DSCP
> and use this information to route packets accordingly.
> 
> Redirecting traffic to a routing table based on the flow label is not
> currently possible with Linux as FIB rules cannot match on it despite
> the flow label being available in the IPv6 flow key.
> 
> This patchset extends FIB rules to match on the flow label with a mask.
> Future patches will add mask attributes to L4 ports and DSCP matches.

For the whole series:

Reviewed-by: Guillaume Nault <gnault@redhat.com>
patchwork-bot+netdevbpf@kernel.org Dec. 19, 2024, 3:10 p.m. UTC | #3
Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 16 Dec 2024 19:11:52 +0200 you wrote:
> In some deployments users would like to encode path information into
> certain bits of the IPv6 flow label, the UDP source port and the DSCP
> and use this information to route packets accordingly.
> 
> Redirecting traffic to a routing table based on the flow label is not
> currently possible with Linux as FIB rules cannot match on it despite
> the flow label being available in the IPv6 flow key.
> 
> [...]

Here is the summary with links:
  - [net-next,1/9] net: fib_rules: Add flow label selector attributes
    https://git.kernel.org/netdev/net-next/c/d1d761b3012e
  - [net-next,2/9] ipv4: fib_rules: Reject flow label attributes
    https://git.kernel.org/netdev/net-next/c/f0c898d8c279
  - [net-next,3/9] ipv6: fib_rules: Add flow label support
    https://git.kernel.org/netdev/net-next/c/9aa77531a131
  - [net-next,4/9] net: fib_rules: Enable flow label selector usage
    https://git.kernel.org/netdev/net-next/c/4c25f3f05194
  - [net-next,5/9] netlink: specs: Add FIB rule flow label attributes
    https://git.kernel.org/netdev/net-next/c/c72004aac60a
  - [net-next,6/9] ipv6: Add flow label to route get requests
    https://git.kernel.org/netdev/net-next/c/ba4138032ae3
  - [net-next,7/9] netlink: specs: Add route flow label attribute
    https://git.kernel.org/netdev/net-next/c/d26b8267d9e0
  - [net-next,8/9] tracing: ipv6: Add flow label to fib6_table_lookup tracepoint
    https://git.kernel.org/netdev/net-next/c/002bf68a3b3e
  - [net-next,9/9] selftests: fib_rule_tests: Add flow label selector match tests
    https://git.kernel.org/netdev/net-next/c/5760711e198d

You are awesome, thank you!