From: Guillaume Nault <gnault@redhat.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Harald Welte <laforge@gnumonks.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
osmocom-net-gprs@lists.osmocom.org
Subject: Re: [PATCH net-next] gtp: Prepare ip4_route_output_gtp() to .flowi4_tos conversion.
Date: Wed, 15 Jan 2025 11:59:08 +0100 [thread overview]
Message-ID: <Z4eU/DLLTCcdtUXJ@debian> (raw)
In-Reply-To: <Z4d7FqLVGI4oUh3s@shredder>
On Wed, Jan 15, 2025 at 11:08:38AM +0200, Ido Schimmel wrote:
> On Tue, Jan 14, 2025 at 05:12:12PM +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, as it will just require to drop the
> > inet_dscp_to_dsfield() call.
> >
> > Signed-off-by: Guillaume Nault <gnault@redhat.com>
> > ---
> > drivers/net/gtp.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> > index 89a996ad8cd0..03d886014f5a 100644
> > --- a/drivers/net/gtp.c
> > +++ b/drivers/net/gtp.c
> > @@ -23,6 +23,8 @@
> >
> > #include <net/net_namespace.h>
> > #include <net/protocol.h>
> > +#include <net/inet_dscp.h>
> > +#include <net/inet_sock.h>
> > #include <net/ip.h>
> > #include <net/ipv6.h>
> > #include <net/udp.h>
> > @@ -350,7 +352,7 @@ static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4,
> > fl4->flowi4_oif = sk->sk_bound_dev_if;
> > fl4->daddr = daddr;
> > fl4->saddr = saddr;
> > - fl4->flowi4_tos = ip_sock_rt_tos(sk);
> > + fl4->flowi4_tos = inet_dscp_to_dsfield(inet_sk_dscp(inet_sk((sk))));
>
> There seems to be an unnecessary pair of parenthesis here like in the
> other patch. I assume you will take care of that in v2?
Yes, I'll send a v2 tomorrow for both the gtp and dccp patches.
> > fl4->flowi4_scope = ip_sock_rt_scope(sk);
> > fl4->flowi4_proto = sk->sk_protocol;
> >
> > --
> > 2.39.2
> >
>
prev parent reply other threads:[~2025-01-15 10:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 16:12 [PATCH net-next] gtp: Prepare ip4_route_output_gtp() to .flowi4_tos conversion Guillaume Nault
2025-01-15 9:08 ` Ido Schimmel
2025-01-15 10:59 ` 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=Z4eU/DLLTCcdtUXJ@debian \
--to=gnault@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=laforge@gnumonks.org \
--cc=netdev@vger.kernel.org \
--cc=osmocom-net-gprs@lists.osmocom.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
/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).