Skip to content

Commit

Permalink
net: fib_rules: Add DSCP mask attribute
Browse files Browse the repository at this point in the history
Add an attribute that allows matching on DSCP with a mask. Matching on
DSCP with a mask is needed in deployments where users encode path
information into certain bits of the DSCP field.

Temporarily set the type of the attribute to 'NLA_REJECT' while support
is being added.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20250220080525.831924-2-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Ido Schimmel authored and Jakub Kicinski committed Feb 22, 2025
1 parent e877009 commit ca4edd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ enum {
FRA_FLOWLABEL_MASK, /* flowlabel mask */
FRA_SPORT_MASK, /* sport mask */
FRA_DPORT_MASK, /* dport mask */
FRA_DSCP_MASK, /* dscp mask */
__FRA_MAX
};

Expand Down
1 change: 1 addition & 0 deletions net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = {
[FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 },
[FRA_SPORT_MASK] = { .type = NLA_U16 },
[FRA_DPORT_MASK] = { .type = NLA_U16 },
[FRA_DSCP_MASK] = { .type = NLA_REJECT },
};

int fib_newrule(struct net *net, struct sk_buff *skb, struct nlmsghdr *nlh,
Expand Down

0 comments on commit ca4edd9

Please sign in to comment.