From: Guillaume Nault <gnault@redhat.com>
To: Eric Dumazet <edumazet@google.com>
Cc: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
dccp@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion.
Date: Tue, 14 Jan 2025 23:32:33 +0100 [thread overview]
Message-ID: <Z4bmAVVyf4Z9VyRc@debian> (raw)
In-Reply-To: <CANn89iJQus-pqLta39df06DJLES8KgytN5iaVz9xv_HAz3F6Vw@mail.gmail.com>
On Tue, Jan 14, 2025 at 06:43:15PM +0100, Eric Dumazet wrote:
> On Tue, Jan 14, 2025 at 4:46 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, as it will just require to drop the
> > inet_dscp_to_dsfield() call.
> >
> > Signed-off-by: Guillaume Nault <gnault@redhat.com>
> > ---
> > 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..9e64dbd38cd7 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)))),
>
> You probably can replace ((X)) with (X) ?
> ->
> .flowi4_tos = inet_dscp_to_dsfield(inet_sk_dscp(inet_sk(sk))),
Indeed, I'll change that in v2.
> > .flowi4_scope = ip_sock_rt_scope(sk),
> > .flowi4_proto = sk->sk_protocol,
> > .fl4_sport = dccp_hdr(skb)->dccph_dport,
> > --
> > 2.39.2
> >
>
prev parent reply other threads:[~2025-01-14 22:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 15:46 [PATCH net-next] dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion Guillaume Nault
2025-01-14 17:43 ` Eric Dumazet
2025-01-14 22:32 ` Guillaume Nault [this message]
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=Z4bmAVVyf4Z9VyRc@debian \
--to=gnault@redhat.com \
--cc=davem@davemloft.net \
--cc=dccp@vger.kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.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).