From: David Ahern <dsahern@kernel•org>
To: Guillaume Nault <gnault@redhat•com>,
David Miller <davem@davemloft•net>,
Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>
Cc: netdev@vger•kernel.org, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6•org>
Subject: Re: [PATCH net-next 3/3] ipv4: Initialise ->flowi4_scope properly in ICMP handlers.
Date: Thu, 21 Apr 2022 21:08:39 -0600 [thread overview]
Message-ID: <c1883180-67cd-ebe0-dc3e-49c545bdeb83@kernel.org> (raw)
In-Reply-To: <3aabf0b36042c11bc97343f899563cef2b9288e5.1650470610.git.gnault@redhat.com>
On 4/20/22 5:21 PM, Guillaume Nault wrote:
> All the *_redirect() and *_update_pmtu() functions initialise their
> struct flowi4 variable with either __build_flow_key() or
> build_sk_flow_key(). When sk is provided, these functions use
> RT_CONN_FLAGS() to set ->flowi4_tos and always use RT_SCOPE_UNIVERSE
> for ->flowi4_scope. Then they rely on ip_rt_fix_tos() to adjust the
> scope based on the RTO_ONLINK bit and to mask the tos with
> IPTOS_RT_MASK.
>
> This patch modifies __build_flow_key() and build_sk_flow_key() to
> properly initialise ->flowi4_tos and ->flowi4_scope, so that the
> ICMP redirects and PMTU handlers don't need an extra call to
> ip_rt_fix_tos() before doing a fib lookup. That is, we:
>
> * Drop RT_CONN_FLAGS(): use ip_sock_rt_tos() and ip_sock_rt_scope()
> instead, so that we don't have to rely on ip_rt_fix_tos() to adjust
> the scope anymore.
>
> * Apply IPTOS_RT_MASK to the tos, so that we don't need
> ip_rt_fix_tos() to do it for us.
>
> * Drop the ip_rt_fix_tos() calls that now become useless.
>
> The only remaining ip_rt_fix_tos() caller is ip_route_output_key_hash()
> which needs it as long as external callers still use the RTO_ONLINK
> flag.
>
> Note:
> This patch also drops some useless RT_TOS() calls as IPTOS_RT_MASK is
> a stronger mask.
>
> Signed-off-by: Guillaume Nault <gnault@redhat•com>
> ---
> net/ipv4/route.c | 37 +++++++++++++++++--------------------
> 1 file changed, 17 insertions(+), 20 deletions(-)
>
Reviewed-by: David Ahern <dsahern@kernel•org>
next prev parent reply other threads:[~2022-04-22 3:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 23:21 [PATCH net-next 0/3] ipv4: First steps toward removing RTO_ONLINK Guillaume Nault
2022-04-20 23:21 ` [PATCH net-next 1/3] ipv4: Don't reset ->flowi4_scope in ip_rt_fix_tos() Guillaume Nault
2022-04-22 2:30 ` David Ahern
2022-04-22 10:53 ` Guillaume Nault
2022-04-22 14:40 ` David Ahern
2022-04-25 10:04 ` Guillaume Nault
2022-04-20 23:21 ` [PATCH net-next 2/3] ipv4: Avoid using RTO_ONLINK with ip_route_connect() Guillaume Nault
2022-04-22 2:32 ` David Ahern
2022-04-20 23:21 ` [PATCH net-next 3/3] ipv4: Initialise ->flowi4_scope properly in ICMP handlers Guillaume Nault
2022-04-22 3:08 ` David Ahern [this message]
2022-04-22 3:10 ` [PATCH net-next 0/3] ipv4: First steps toward removing RTO_ONLINK David Ahern
2022-04-22 11:02 ` Guillaume Nault
2022-04-22 12:50 ` 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=c1883180-67cd-ebe0-dc3e-49c545bdeb83@kernel.org \
--to=dsahern@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=gnault@redhat$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=yoshfuji@linux-ipv6$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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