BPF List
 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>, <gnault@redhat.com>, <dsahern@kernel.org>,
	<fw@strlen.de>, <martin.lau@linux.dev>, <daniel@iogearbox.net>,
	<john.fastabend@gmail.com>, <ast@kernel.org>,
	<pablo@netfilter.org>, <kadlec@netfilter.org>,
	<willemdebruijn.kernel@gmail.com>, <bpf@vger.kernel.org>,
	<netfilter-devel@vger.kernel.org>, <coreteam@netfilter.org>,
	Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 02/12] ipv4: Unmask upper DSCP bits in NETLINK_FIB_LOOKUP family
Date: Wed, 21 Aug 2024 15:52:41 +0300	[thread overview]
Message-ID: <20240821125251.1571445-3-idosch@nvidia.com> (raw)
In-Reply-To: <20240821125251.1571445-1-idosch@nvidia.com>

The NETLINK_FIB_LOOKUP netlink family can be used to perform a FIB
lookup according to user provided parameters and communicate the result
back to user space.

Unmask the upper DSCP bits of the user-provided DS field before invoking
the IPv4 FIB lookup API so that in the future the lookup could be
performed according to the full DSCP value.

No functional changes intended since the upper DSCP bits are masked when
comparing against the TOS selectors in FIB rules and routes.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 net/ipv4/fib_frontend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index da540ddb7af6..8b740f575da1 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1343,7 +1343,7 @@ static void nl_fib_lookup(struct net *net, struct fib_result_nl *frn)
 	struct flowi4           fl4 = {
 		.flowi4_mark = frn->fl_mark,
 		.daddr = frn->fl_addr,
-		.flowi4_tos = frn->fl_tos & IPTOS_RT_MASK,
+		.flowi4_tos = frn->fl_tos & INET_DSCP_MASK,
 		.flowi4_scope = frn->fl_scope,
 	};
 	struct fib_table *tb;
-- 
2.46.0


  parent reply	other threads:[~2024-08-21 12:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 12:52 [PATCH net-next 00/12] Unmask upper DSCP bits - part 1 Ido Schimmel
2024-08-21 12:52 ` [PATCH net-next 01/12] bpf: Unmask upper DSCP bits in bpf_fib_lookup() helper Ido Schimmel
2024-08-21 14:35   ` Guillaume Nault
2024-08-21 12:52 ` Ido Schimmel [this message]
2024-08-21 14:37   ` [PATCH net-next 02/12] ipv4: Unmask upper DSCP bits in NETLINK_FIB_LOOKUP family Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 03/12] ipv4: Unmask upper DSCP bits when constructing the Record Route option Ido Schimmel
2024-08-21 14:46   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 04/12] netfilter: rpfilter: Unmask upper DSCP bits Ido Schimmel
2024-08-21 14:50   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 05/12] netfilter: nft_fib: " Ido Schimmel
2024-08-21 14:53   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 06/12] ipv4: ipmr: Unmask upper DSCP bits in ipmr_rt_fib_lookup() Ido Schimmel
2024-08-21 15:05   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 07/12] ipv4: Unmask upper DSCP bits in fib_compute_spec_dst() Ido Schimmel
2024-08-21 15:06   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 08/12] ipv4: Unmask upper DSCP bits in input route lookup Ido Schimmel
2024-08-21 16:28   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 09/12] ipv4: Unmask upper DSCP bits in RTM_GETROUTE " Ido Schimmel
2024-08-21 16:30   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 10/12] ipv4: icmp: Pass full DS field to ip_route_input() Ido Schimmel
2024-08-21 16:44   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 11/12] ipv4: udp: Unmask upper DSCP bits during early demux Ido Schimmel
2024-08-21 16:46   ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 12/12] ipv4: Unmask upper DSCP bits when using hints Ido Schimmel
2024-08-21 16:50   ` Guillaume Nault
2024-08-21 14:48 ` [PATCH net-next 00/12] Unmask upper DSCP bits - part 1 Florian Westphal
2024-08-21 17:00 ` David Ahern
2024-08-23  0:10 ` 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=20240821125251.1571445-3-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=coreteam@netfilter.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=gnault@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=willemdebruijn.kernel@gmail.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