[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240924125101.1688823-1-gur.stavi@huawei.com>
Date: Tue, 24 Sep 2024 15:51:01 +0300
From: Gur Stavi <gur.stavi@...wei.com>
To: <lulie@...ux.alibaba.com>
CC: <antony.antony@...unet.com>, <davem@...emloft.net>, <dsahern@...nel.org>,
<dust.li@...ux.alibaba.com>, <edumazet@...gle.com>,
<fred.cc@...baba-inc.com>, <jakub@...udflare.com>, <kuba@...nel.org>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>, <steffen.klassert@...unet.com>,
<willemdebruijn.kernel@...il.com>, <yubing.qiuyubing@...baba-inc.com>
Subject: [RFC PATCHv2 net-next 1/3] net/udp: Add a new struct for hash2 slot
> @@ -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.
Powered by blists - more mailing lists