netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion.
@ 2025-01-16 13:10 Guillaume Nault
  2025-01-16 13:51 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guillaume Nault @ 2025-01-16 13:10 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
  Cc: netdev, Simon Horman, dccp, Ido Schimmel

Use inet_sk_dscp() to get the socket DSCP value as dscp_t, instead of
ip_sock_rt_tos() which returns a __u8. This will ease the conversion
of fl4->flowi4_tos to dscp_t, which now just becomes a matter of
dropping the inet_dscp_to_dsfield() call.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
v2: Remove useless parenthesis (Eric).
    Slightly reword the commit message for clarity.

 net/dccp/ipv4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 5926159a6f20..be515ba821e2 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -15,6 +15,7 @@
 
 #include <net/icmp.h>
 #include <net/inet_common.h>
+#include <net/inet_dscp.h>
 #include <net/inet_hashtables.h>
 #include <net/inet_sock.h>
 #include <net/protocol.h>
@@ -473,7 +474,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
 		.flowi4_oif = inet_iif(skb),
 		.daddr = iph->saddr,
 		.saddr = iph->daddr,
-		.flowi4_tos = ip_sock_rt_tos(sk),
+		.flowi4_tos = inet_dscp_to_dsfield(inet_sk_dscp(inet_sk(sk))),
 		.flowi4_scope = ip_sock_rt_scope(sk),
 		.flowi4_proto = sk->sk_protocol,
 		.fl4_sport = dccp_hdr(skb)->dccph_dport,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion.
  2025-01-16 13:10 [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion Guillaume Nault
@ 2025-01-16 13:51 ` Eric Dumazet
  2025-01-16 14:43 ` Ido Schimmel
  2025-01-18  3:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2025-01-16 13:51 UTC (permalink / raw)
  To: Guillaume Nault
  Cc: David Miller, Jakub Kicinski, Paolo Abeni, netdev, Simon Horman,
	dccp, Ido Schimmel

On Thu, Jan 16, 2025 at 2:10 PM Guillaume Nault <gnault@redhat.com> wrote:
>
> Use inet_sk_dscp() to get the socket DSCP value as dscp_t, instead of
> ip_sock_rt_tos() which returns a __u8. This will ease the conversion
> of fl4->flowi4_tos to dscp_t, which now just becomes a matter of
> dropping the inet_dscp_to_dsfield() call.
>
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
> ---

Reviewed-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion.
  2025-01-16 13:10 [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion Guillaume Nault
  2025-01-16 13:51 ` Eric Dumazet
@ 2025-01-16 14:43 ` Ido Schimmel
  2025-01-18  3:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2025-01-16 14:43 UTC (permalink / raw)
  To: Guillaume Nault
  Cc: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet, netdev,
	Simon Horman, dccp

On Thu, Jan 16, 2025 at 02:10:16PM +0100, Guillaume Nault wrote:
> Use inet_sk_dscp() to get the socket DSCP value as dscp_t, instead of
> ip_sock_rt_tos() which returns a __u8. This will ease the conversion
> of fl4->flowi4_tos to dscp_t, which now just becomes a matter of
> dropping the inet_dscp_to_dsfield() call.
> 
> Signed-off-by: Guillaume Nault <gnault@redhat.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion.
  2025-01-16 13:10 [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion Guillaume Nault
  2025-01-16 13:51 ` Eric Dumazet
  2025-01-16 14:43 ` Ido Schimmel
@ 2025-01-18  3:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-18  3:50 UTC (permalink / raw)
  To: Guillaume Nault
  Cc: davem, kuba, pabeni, edumazet, netdev, horms, dccp, idosch

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 16 Jan 2025 14:10:16 +0100 you wrote:
> Use inet_sk_dscp() to get the socket DSCP value as dscp_t, instead of
> ip_sock_rt_tos() which returns a __u8. This will ease the conversion
> of fl4->flowi4_tos to dscp_t, which now just becomes a matter of
> dropping the inet_dscp_to_dsfield() call.
> 
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion.
    https://git.kernel.org/netdev/net-next/c/02673d58adfa

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] 4+ messages in thread

end of thread, other threads:[~2025-01-18  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 13:10 [PATCH net-next v2] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion Guillaume Nault
2025-01-16 13:51 ` Eric Dumazet
2025-01-16 14:43 ` Ido Schimmel
2025-01-18  3: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).