mbox series

[net-next,0/6] net: fib_rules: Add DSCP mask support

Message ID 20250220080525.831924-1-idosch@nvidia.com (mailing list archive)
Headers show
Series net: fib_rules: Add DSCP mask support | expand

Message

Ido Schimmel Feb. 20, 2025, 8:05 a.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
field and use this information to route packets accordingly.

Redirecting traffic to a routing table based on specific bits in the
DSCP field is not currently possible. Only exact match is currently
supported by FIB rules.

This patchset extends FIB rules to match on the DSCP field with an
optional mask.

Patches #1-#5 gradually extend FIB rules to match on the DSCP field with
an optional mask.

Patch #6 adds test cases for the new functionality.

iproute2 support can be found here [1].

[1] https://github.com/idosch/iproute2/tree/submit/fib_rule_mask_v1

Ido Schimmel (6):
  net: fib_rules: Add DSCP mask attribute
  ipv4: fib_rules: Add DSCP mask matching
  ipv6: fib_rules: Add DSCP mask matching
  net: fib_rules: Enable DSCP mask usage
  netlink: specs: Add FIB rule DSCP mask attribute
  selftests: fib_rule_tests: Add DSCP mask match tests

 Documentation/netlink/specs/rt_rule.yaml      |  5 ++
 include/uapi/linux/fib_rules.h                |  1 +
 net/core/fib_rules.c                          |  1 +
 net/ipv4/fib_rules.c                          | 47 +++++++++++++++++--
 net/ipv6/fib6_rules.c                         | 45 +++++++++++++++++-
 tools/testing/selftests/net/fib_rule_tests.sh | 38 +++++++++++++++
 6 files changed, 132 insertions(+), 5 deletions(-)

Comments

Guillaume Nault Feb. 21, 2025, 3:29 p.m. UTC | #1
On Thu, Feb 20, 2025 at 10:05:19AM +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
> field and use this information to route packets accordingly.
> 
> Redirecting traffic to a routing table based on specific bits in the
> DSCP field is not currently possible. Only exact match is currently
> supported by FIB rules.
> 
> This patchset extends FIB rules to match on the DSCP field with an
> optional mask.
> 

Reviewed-by: Guillaume Nault <gnault@redhat.com>
patchwork-bot+netdevbpf@kernel.org Feb. 22, 2025, 12:30 a.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 20 Feb 2025 10:05:19 +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
> field and use this information to route packets accordingly.
> 
> Redirecting traffic to a routing table based on specific bits in the
> DSCP field is not currently possible. Only exact match is currently
> supported by FIB rules.
> 
> [...]

Here is the summary with links:
  - [net-next,1/6] net: fib_rules: Add DSCP mask attribute
    https://git.kernel.org/netdev/net-next/c/ca4edd969a94
  - [net-next,2/6] ipv4: fib_rules: Add DSCP mask matching
    https://git.kernel.org/netdev/net-next/c/2ae00699b357
  - [net-next,3/6] ipv6: fib_rules: Add DSCP mask matching
    https://git.kernel.org/netdev/net-next/c/c29165c272b8
  - [net-next,4/6] net: fib_rules: Enable DSCP mask usage
    https://git.kernel.org/netdev/net-next/c/ea8af1affdc0
  - [net-next,5/6] netlink: specs: Add FIB rule DSCP mask attribute
    https://git.kernel.org/netdev/net-next/c/0df1328eaf04
  - [net-next,6/6] selftests: fib_rule_tests: Add DSCP mask match tests
    https://git.kernel.org/netdev/net-next/c/e818d1d1a6ee

You are awesome, thank you!