On Thu, 17 Nov 2022 16:07:32 +1100 David Gibson <david(a)gibson.dropbear.id.au> wrote:In preparation for trying to implement dual stack sockets for UDP, I've been getting my head around how the UDP splicing works. Alas, I'm pretty sure that it's broken if there's not a one-to-one correspondence between init side source ports and ns side destination ports. That will typically be the case, but given its UDP there's no guarantee.I understand the concern below, but I don't understand this part, that is: in which other way is it broken?In addition, UDP servers in the ns will not see the correct port numbers with getpeername(). That's also true of spliced TCP connections (see https://bugs.passt.top/show_bug.cgi?id=39), but it's more likely to matter for UDP (I don't know of any TCP protocols that care about source port number on the server side, but there are some common UDP protocols that have at least port number conventions on both sides).I can think of DHCP and DNS, for which we offer special handling somehow. Still, if the flow is started by the guest or container, replies should really come with a source port matching the destination port used initially. For TCP, I don't see this is as an issue at all.I can expand on the details later, but pasta will do the wrong thing in at least some circumstances for both a single init side socket sendto()ing packets to multiple different ports in the ns/guest and multiple init side sockets send()ing to the same port in the ns/guest. I think I know how to fix it, but it's not a trivial job. So, the question is do I embark on this now, or do I just remove UDP "splicing" entirely for the time being (other than a minimum required to make -U work)? That would unblock dual stack UDP sockets and we can attempt to reoptimize this later.So, I'm not really sure what's broken here, but in any case, UDP "splicing" doesn't offer as much value as the TCP one does, the difference in packet rate is not that big. I don't see a problem if we want to remove it temporarily. The only real concern I have is how easy it would be to add it back after a rework not taking that functionality into account. -- Stefano