From: Kuniyuki Iwashima <kuniyu@amazon.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>,
<horms@kernel.org>, <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>, <kuniyu@amazon.com>
Subject: Re: [PATCH v6 net-next 4/4] ipv6/udp: Add 4-tuple hash for connected socket
Date: Fri, 1 Nov 2024 09:48:40 -0700 [thread overview]
Message-ID: <20241101164840.73324-1-kuniyu@amazon.com> (raw)
In-Reply-To: <33862f10-726d-49d3-8f86-ccef1f6792e7@linux.alibaba.com>
From: Philo Lu <lulie@linux.alibaba.com>
Date: Fri, 1 Nov 2024 19:40:19 +0800
> On 2024/10/31 20:45, Philo Lu wrote:
> > Implement ipv6 udp hash4 like that in ipv4. The major difference is that
> > the hash value should be calculated with udp6_ehashfn(). Besides,
> > ipv4-mapped ipv6 address is handled before hash() and rehash().
> >
> > Core procedures of hash/unhash/rehash are same as ipv4, and udpv4 and
> > udpv6 share the same udptable, so some functions in ipv4 hash4 can also
> > be shared.
> >
> > Signed-off-by: Philo Lu <lulie@linux.alibaba.com>
> > Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>
> > Signed-off-by: Fred Chen <fred.cc@alibaba-inc.com>
> > Signed-off-by: Yubing Qiu <yubing.qiuyubing@alibaba-inc.com>
> > ---
> > net/ipv6/udp.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 94 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> > index 1ea99d704e31..64f13f258fca 100644
> > --- a/net/ipv6/udp.c
> > +++ b/net/ipv6/udp.c
> > @@ -110,8 +110,17 @@ void udp_v6_rehash(struct sock *sk)
> > u16 new_hash = ipv6_portaddr_hash(sock_net(sk),
> > &sk->sk_v6_rcv_saddr,
> > inet_sk(sk)->inet_num);
> > + u16 new_hash4;
> >
> > - udp_lib_rehash(sk, new_hash, 0); /* 4-tuple hash not implemented */
> > + if (ipv6_addr_v4mapped(&sk->sk_v6_rcv_saddr)) {
> > + new_hash4 = udp_ehashfn(sock_net(sk), sk->sk_rcv_saddr, sk->sk_num,
> > + sk->sk_daddr, sk->sk_dport);
>
> Just found udp_ehashfn() used here results in an build error of
> undefined function.
>
> I think the `ipv6_addr_v4mapped(&sk->sk_v6_rcv_saddr)` branch can be
> moved into udp_lib_rehash() to fix the issue. So in the worst case, we
> need to calculate the newhash4 twice in ipv6 hash4 rehash, one in
> udp_v6_rehash() and the other in udp_lib_rehash().
You can simply export udp_ehashfn().
next prev parent reply other threads:[~2024-11-01 16:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 12:45 [PATCH v6 net-next 0/4] udp: Add 4-tuple hash for connected sockets Philo Lu
2024-10-31 12:45 ` [PATCH v6 net-next 1/4] net/udp: Add a new struct for hash2 slot Philo Lu
2024-10-31 12:45 ` [PATCH v6 net-next 2/4] net/udp: Add 4-tuple hash list basis Philo Lu
2024-10-31 12:45 ` [PATCH v6 net-next 3/4] ipv4/udp: Add 4-tuple hash for connected socket Philo Lu
2024-10-31 12:45 ` [PATCH v6 net-next 4/4] ipv6/udp: " Philo Lu
2024-11-01 11:40 ` Philo Lu
2024-11-01 16:48 ` Kuniyuki Iwashima [this message]
2024-11-01 16:47 ` kernel test robot
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=20241101164840.73324-1-kuniyu@amazon.com \
--to=kuniyu@amazon.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=horms@kernel.org \
--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