* [PATCH net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion.
@ 2024-11-06 21:37 Guillaume Nault
2024-11-07 9:57 ` Ido Schimmel
2024-11-08 4:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Guillaume Nault @ 2024-11-06 21:37 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Simon Horman, David Ahern, Pablo Neira Ayuso,
Jozsef Kadlecsik, Roopa Prabhu, Nikolay Aleksandrov,
netfilter-devel, coreteam, bridge, Ido Schimmel
Convert the "tos" parameter of ip_route_output() to dscp_t. This way
we'll have a dscp_t value directly available when .flowi4_tos will
eventually be converted to dscp_t.
All ip_route_output() callers but one set this "tos" parameter to 0 and
therefore don't need to be adapted to the new prototype.
Only br_nf_pre_routing_finish() needs conversion. It can just use
ip4h_dscp() to get the DSCP field from the IPv4 header.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
include/net/route.h | 6 +++---
net/bridge/br_netfilter_hooks.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net/route.h b/include/net/route.h
index 586e59f7ed8a..0a690adfdff5 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -156,12 +156,12 @@ static inline struct rtable *ip_route_output_key(struct net *net, struct flowi4
* structure is only partially set, it may bypass some fib-rules.
*/
static inline struct rtable *ip_route_output(struct net *net, __be32 daddr,
- __be32 saddr, u8 tos, int oif,
- __u8 scope)
+ __be32 saddr, dscp_t dscp,
+ int oif, __u8 scope)
{
struct flowi4 fl4 = {
.flowi4_oif = oif,
- .flowi4_tos = tos,
+ .flowi4_tos = inet_dscp_to_dsfield(dscp),
.flowi4_scope = scope,
.daddr = daddr,
.saddr = saddr,
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index 17a5f5923d61..7f2f40cef5fe 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -406,7 +406,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_
goto free_skb;
rt = ip_route_output(net, iph->daddr, 0,
- iph->tos & INET_DSCP_MASK, 0,
+ ip4h_dscp(iph), 0,
RT_SCOPE_UNIVERSE);
if (!IS_ERR(rt)) {
/* - Bridged-and-DNAT'ed traffic doesn't
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion.
2024-11-06 21:37 [PATCH net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion Guillaume Nault
@ 2024-11-07 9:57 ` Ido Schimmel
2024-11-08 4:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2024-11-07 9:57 UTC (permalink / raw)
To: Guillaume Nault
Cc: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet, netdev,
Simon Horman, David Ahern, Pablo Neira Ayuso, Jozsef Kadlecsik,
Roopa Prabhu, Nikolay Aleksandrov, netfilter-devel, coreteam,
bridge
On Wed, Nov 06, 2024 at 10:37:32PM +0100, Guillaume Nault wrote:
> Convert the "tos" parameter of ip_route_output() to dscp_t. This way
> we'll have a dscp_t value directly available when .flowi4_tos will
> eventually be converted to dscp_t.
>
> All ip_route_output() callers but one set this "tos" parameter to 0 and
> therefore don't need to be adapted to the new prototype.
>
> Only br_nf_pre_routing_finish() needs conversion. It can just use
> ip4h_dscp() to get the DSCP field from the IPv4 header.
>
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion.
2024-11-06 21:37 [PATCH net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion Guillaume Nault
2024-11-07 9:57 ` Ido Schimmel
@ 2024-11-08 4:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-08 4:50 UTC (permalink / raw)
To: Guillaume Nault
Cc: davem, kuba, pabeni, edumazet, netdev, horms, dsahern, pablo,
kadlec, roopa, razor, netfilter-devel, coreteam, bridge, idosch
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 6 Nov 2024 22:37:32 +0100 you wrote:
> Convert the "tos" parameter of ip_route_output() to dscp_t. This way
> we'll have a dscp_t value directly available when .flowi4_tos will
> eventually be converted to dscp_t.
>
> All ip_route_output() callers but one set this "tos" parameter to 0 and
> therefore don't need to be adapted to the new prototype.
>
> [...]
Here is the summary with links:
- [net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion.
https://git.kernel.org/netdev/net-next/c/48171c65f611
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-08 4:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-06 21:37 [PATCH net-next] ipv4: Prepare ip_route_output() to future .flowi4_tos conversion Guillaume Nault
2024-11-07 9:57 ` Ido Schimmel
2024-11-08 4:50 ` patchwork-bot+netdevbpf
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).