Re: [PATCH v8 net-next 3/4] ipv4/udp: Add 4-tuple hash for connected socket

From: Philo Lu
Date: Tue Nov 12 2024 - 20:50:33 EST




On 2024/11/12 22:58, Paolo Abeni wrote:
On 11/8/24 06:48, Philo Lu wrote:
[...]
Signed-off-by: Philo Lu <lulie@xxxxxxxxxxxxxxxxx>
Signed-off-by: Cambda Zhu <cambda@xxxxxxxxxxxxxxxxx>
Signed-off-by: Fred Chen <fred.cc@xxxxxxxxxxxxxxx>
Signed-off-by: Yubing Qiu <yubing.qiuyubing@xxxxxxxxxxxxxxx>

[...]
@@ -2937,7 +3128,7 @@ struct proto udp_prot = {
.owner = THIS_MODULE,
.close = udp_lib_close,
.pre_connect = udp_pre_connect,
- .connect = ip4_datagram_connect,
+ .connect = udp_connect,
.disconnect = udp_disconnect,
.ioctl = udp_ioctl,
.init = udp_init_sock,

2 minor notes, possibly not needing a repost:

- The SoB chain looks strange, do you mean co-developed-by actually?

Yes, we're all involved in the development. I think it could be indicated by SoBs (and all of us agree with this). Please let me know if I'm wrong :)

Or strictly as [1], it should be:

Co-developed-by: Cambda Zhu <cambda@xxxxxxxxxxxxxxxxx>
Signed-off-by: Cambda Zhu <cambda@xxxxxxxxxxxxxxxxx>
Co-developed-by: Fred Chen <fred.cc@xxxxxxxxxxxxxxx>
Signed-off-by: Fred Chen <fred.cc@xxxxxxxxxxxxxxx>
Co-developed-by: Yubing Qiu <yubing.qiuyubing@xxxxxxxxxxxxxxx>
Signed-off-by: Yubing Qiu <yubing.qiuyubing@xxxxxxxxxxxxxxx>
Signed-off-by: Philo Lu <lulie@xxxxxxxxxxxxxxxxx>

[1]
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by

- udplite is not touched. AFAICS should not be a problem - just the
feature will not be available for udplite.

Agreed. Theoretically, the feature relies on udp4_hash4/udp6_hash4 when connecting, and all other functions including lookup/unhash/rehash always check "hashed4" firstly, and do nothing if it's false (which is the case for udplite).

AFAICT, the effects to udplite include:
- Additional memory consumption in udp_sock and udptable
- Control path: udp_hashed4 checking when unhash/rehash
- Data path: udp_has_hash4 checking when lookup
(like unconnected sks in udp)

I'm wondering if syzbot could
prove me wrong about "not being a problem" (usually it's able to do that;)

/P


Thanks.
--
Philo