From: Gur Stavi <gur.stavi@huawei.com>
To: <lulie@linux.alibaba.com>
Cc: <antony.antony@secunet.com>, <davem@davemloft.net>,
<dsahern@kernel.org>, <dust.li@linux.alibaba.com>,
<edumazet@google.com>, <fred.cc@alibaba-inc.com>,
<jakub@cloudflare.com>, <kuba@kernel.org>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<pabeni@redhat.com>, <steffen.klassert@secunet.com>,
<willemdebruijn.kernel@gmail.com>,
<yubing.qiuyubing@alibaba-inc.com>
Subject: [RFC PATCHv2 net-next 1/3] net/udp: Add a new struct for hash2 slot
Date: Tue, 24 Sep 2024 15:51:01 +0300 [thread overview]
Message-ID: <20240924125101.1688823-1-gur.stavi@huawei.com> (raw)
In-Reply-To: <20240924110414.52618-2-lulie@linux.alibaba.com>
> @@ -224,13 +224,12 @@ struct sock *__udp6_lib_lookup(const struct net *net,
> struct sk_buff *skb)
> {
> unsigned short hnum = ntohs(dport);
> - unsigned int hash2, slot2;
> struct udp_hslot *hslot2;
> struct sock *result, *sk;
> + unsigned int hash2;
>
> hash2 = ipv6_portaddr_hash(net, daddr, hnum);
> - slot2 = hash2 & udptable->mask;
> - hslot2 = &udptable->hash2[slot2];
> + hslot2 = udp_hashslot2(udptable, hash2);
>
Why not minimize the code change by using udptable->hash2[slot2].hslot?
Especially since later you do it in __udp6_lib_mcast_deliver.
I think that many developers would find usage of C primitives more
readable.
next prev parent reply other threads:[~2024-09-24 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 11:04 [RFC PATCHv2 net-next 0/3] udp: Add 4-tuple hash for connected sockets Philo Lu
2024-09-24 11:04 ` [RFC PATCHv2 net-next 1/3] net/udp: Add a new struct for hash2 slot Philo Lu
2024-09-24 12:30 ` Gur Stavi
2024-09-25 2:43 ` Philo Lu
2024-09-24 12:51 ` Gur Stavi [this message]
2024-09-25 2:57 ` Philo Lu
2024-09-24 11:04 ` [RFC PATCHv2 net-next 2/3] net/udp: Add 4-tuple hash list basis Philo Lu
2024-09-24 11:04 ` [RFC PATCHv2 net-next 3/3] ipv4/udp: Add 4-tuple hash for connected socket Philo Lu
2024-09-24 12:31 ` Gur Stavi
2024-09-25 3:16 ` Philo Lu
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=20240924125101.1688823-1-gur.stavi@huawei.com \
--to=gur.stavi@huawei.com \
--cc=antony.antony@secunet.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@google.com \
--cc=fred.cc@alibaba-inc.com \
--cc=jakub@cloudflare.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lulie@linux.alibaba.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=yubing.qiuyubing@alibaba-inc.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
all inboxes | Powered by JetHome®