netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <dsahern@kernel.org>, <gnault@redhat.com>,
	"Ido Schimmel" <idosch@nvidia.com>
Subject: [PATCH net-next 4/6] net: fib_rules: Enable DSCP selector usage
Date: Wed, 11 Sep 2024 12:37:46 +0300	[thread overview]
Message-ID: <20240911093748.3662015-5-idosch@nvidia.com> (raw)
In-Reply-To: <20240911093748.3662015-1-idosch@nvidia.com>

Now that both IPv4 and IPv6 support the new DSCP selector, enable user
space to configure FIB rules that make use of it by changing the policy
of the new DSCP attribute so that it accepts values in the range of [0,
63].

Use NLA_U8 rather than NLA_UINT as the field is of fixed size.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 net/core/fib_rules.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index df41c05f7234..154a2681f55c 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -11,6 +11,7 @@
 #include <linux/list.h>
 #include <linux/module.h>
 #include <net/net_namespace.h>
+#include <net/inet_dscp.h>
 #include <net/sock.h>
 #include <net/fib_rules.h>
 #include <net/ip_tunnels.h>
@@ -767,7 +768,7 @@ static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = {
 	[FRA_IP_PROTO]  = { .type = NLA_U8 },
 	[FRA_SPORT_RANGE] = { .len = sizeof(struct fib_rule_port_range) },
 	[FRA_DPORT_RANGE] = { .len = sizeof(struct fib_rule_port_range) },
-	[FRA_DSCP]	= { .type = NLA_REJECT },
+	[FRA_DSCP]	= NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2),
 };
 
 int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,
-- 
2.46.0


  parent reply	other threads:[~2024-09-11  9:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  9:37 [PATCH net-next 0/6] net: fib_rules: Add DSCP selector support Ido Schimmel
2024-09-11  9:37 ` [PATCH net-next 1/6] net: fib_rules: Add DSCP selector attribute Ido Schimmel
2024-09-13 12:03   ` Guillaume Nault
2024-09-11  9:37 ` [PATCH net-next 2/6] ipv4: fib_rules: Add DSCP selector support Ido Schimmel
2024-09-13 12:10   ` Guillaume Nault
2024-09-11  9:37 ` [PATCH net-next 3/6] ipv6: " Ido Schimmel
2024-09-13 12:21   ` Guillaume Nault
2024-09-11  9:37 ` Ido Schimmel [this message]
2024-09-13 12:26   ` [PATCH net-next 4/6] net: fib_rules: Enable DSCP selector usage Guillaume Nault
2024-09-11  9:37 ` [PATCH net-next 5/6] selftests: fib_rule_tests: Add DSCP selector match tests Ido Schimmel
2024-09-13 12:52   ` Guillaume Nault
2024-09-11  9:37 ` [PATCH net-next 6/6] selftests: fib_rule_tests: Add DSCP selector connect tests Ido Schimmel
2024-09-13 12:58   ` Guillaume Nault
2024-09-13 13:08 ` [PATCH net-next 0/6] net: fib_rules: Add DSCP selector support Guillaume Nault
2024-09-30 13:45   ` Ido Schimmel
2024-09-30 18:18     ` David Ahern
2024-10-01 20:08     ` Guillaume Nault
2024-09-13 14:31 ` David Ahern
2024-09-14  4: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=20240911093748.3662015-5-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gnault@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).