From: Paolo Abeni <pabeni@redhat.com>
To: David Laight <David.Laight@ACULAB.COM>,
"'willemdebruijn.kernel@gmail.com'"
<willemdebruijn.kernel@gmail.com>,
"'davem@davemloft.net'" <davem@davemloft.net>,
"'dsahern@kernel.org'" <dsahern@kernel.org>,
'Eric Dumazet' <edumazet@google.com>,
"'kuba@kernel.org'" <kuba@kernel.org>,
"'netdev@vger.kernel.org'" <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/2] Move hash calculation inside udp4_lib_lookup2()
Date: Wed, 26 Jul 2023 15:44:29 +0200 [thread overview]
Message-ID: <fce08e76da7e3882319ae935c38e9e2eccf2dcae.camel@redhat.com> (raw)
In-Reply-To: <5eb8631d430248999116ce8ced13e4b2@AcuMS.aculab.com>
On Wed, 2023-07-26 at 12:05 +0000, David Laight wrote:
> Pass the udptable address into udp4_lib_lookup2() instead of the hash slot.
>
> While ipv4_portaddr_hash(net, IP_ADDR_ANY, 0) is constant for each net
> (the port is an xor) the value isn't saved.
> Since the hash function doesn't get simplified when passed zero the hash
Are you sure? could you please objdump and compare the binary code
generated before and after the patch? In theory all the callers up to
__jhash_final() included should be inlined, and the compiler should be
able to optimze at least rol32(0, <n>).
Cheers,
Paolo
next prev parent reply other threads:[~2023-07-26 13:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 11:51 [PATCH 0/2] udp: rescan hash2 list if chains crossed David Laight
2023-07-26 12:05 ` [PATCH 1/2] Move hash calculation inside udp4_lib_lookup2() David Laight
2023-07-26 13:44 ` Paolo Abeni [this message]
2023-07-26 14:02 ` David Laight
2023-07-26 14:03 ` Eric Dumazet
2023-07-26 14:06 ` David Laight
2023-07-26 15:42 ` David Laight
2023-07-26 12:05 ` [PATCH 2/2] Rescan the hash2 list if the hash chains have got cross-linked David Laight
2023-07-26 13:36 ` Paolo Abeni
2023-07-26 13:37 ` Eric Dumazet
2023-07-26 14:13 ` David Laight
2023-07-26 14:21 ` Eric Dumazet
2023-07-26 14:39 ` David Laight
2023-07-26 14:48 ` Eric Dumazet
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=fce08e76da7e3882319ae935c38e9e2eccf2dcae.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=David.Laight@ACULAB.COM \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.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).