From: Ido Schimmel <idosch@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
<edumazet@google.com>, <horms@kernel.org>,
<donald.hunter@gmail.com>, <dsahern@kernel.org>,
<petrm@nvidia.com>, <gnault@redhat.com>,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 1/6] net: fib_rules: Add DSCP mask attribute
Date: Thu, 20 Feb 2025 10:05:20 +0200 [thread overview]
Message-ID: <20250220080525.831924-2-idosch@nvidia.com> (raw)
In-Reply-To: <20250220080525.831924-1-idosch@nvidia.com>
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>
---
include/uapi/linux/fib_rules.h | 1 +
net/core/fib_rules.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/include/uapi/linux/fib_rules.h b/include/uapi/linux/fib_rules.h
index 95ec01b15c65..2df6e4035d50 100644
--- a/include/uapi/linux/fib_rules.h
+++ b/include/uapi/linux/fib_rules.h
@@ -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
};
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 5ddd34cbe7f6..00e6fe79ecba 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -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,
--
2.48.1
next prev parent reply other threads:[~2025-02-20 8:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 8:05 [PATCH net-next 0/6] net: fib_rules: Add DSCP mask support Ido Schimmel
2025-02-20 8:05 ` Ido Schimmel [this message]
2025-02-20 8:05 ` [PATCH net-next 2/6] ipv4: fib_rules: Add DSCP mask matching Ido Schimmel
2025-02-20 8:05 ` [PATCH net-next 3/6] ipv6: " Ido Schimmel
2025-02-20 8:05 ` [PATCH net-next 4/6] net: fib_rules: Enable DSCP mask usage Ido Schimmel
2025-02-20 8:05 ` [PATCH net-next 5/6] netlink: specs: Add FIB rule DSCP mask attribute Ido Schimmel
2025-02-20 8:05 ` [PATCH net-next 6/6] selftests: fib_rule_tests: Add DSCP mask match tests Ido Schimmel
2025-02-21 15:29 ` [PATCH net-next 0/6] net: fib_rules: Add DSCP mask support Guillaume Nault
2025-02-22 0:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250220080525.831924-2-idosch@nvidia.com \
--to=idosch@nvidia.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gnault@redhat.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).