[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLy5cuVU6Pbb4hU7otefEn1ufRswJUo5JZ-LC8aGVUCSg@mail.gmail.com>
Date: Tue, 28 Nov 2023 16:06:10 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 2/8] tcp: Cache sock_net(sk) in cookie_v[46]_check().
On Sat, Nov 25, 2023 at 2:17 AM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> sock_net(sk) is used repeatedly in cookie_v[46]_check().
> Let's cache it in a variable.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> Reviewed-by: Simon Horman <horms@...nel.org>
Reviewed-by: Eric Dumazet <edumazert@...gle.com>
Note that because of register pressure, chances are high that compiler
will use a slot in the stack
to store 'net' pointer, which will not be faster than using sk->sk_net
No big deal, I agree this makes the code a bit more concise.
Powered by blists - more mailing lists