[PATCH 0/3] udp: Further preliminaries towards using connected sockets on both sides
Some additional small cleanups David Gibson (3): udp: Remove redundant udp_at_sidx() call in udp_tap_handler() udp: Simplify updates to UDP flow timestamp udp: Correct some seccomp filter annotations udp.c | 23 +++++++++-------------- udp_vu.c | 9 +-------- udp_vu.h | 3 +-- 3 files changed, 11 insertions(+), 24 deletions(-) -- 2.49.0
We've already have a pointer to the UDP flow in variable uflow, we can just
re-use it.
Signed-off-by: David Gibson
Since UDP has no built in knowledge of connections, the only way we
know when we're done with a UDP flow is a timeout with no activity.
To keep track of this struct udp_flow includes a timestamp to record
the last time we saw traffic on the flow.
For data from listening sockets and from tap, this is done implicitly via
udp_flow_from_{sock,tap}() but for reply sockets it's done explicitly.
However, that logic is duplicated between the vhost-user and "buf" paths.
Make it common in udp_reply_sock_handler() instead.
Technically this is a behavioural change: previously if we got an EPOLLIN
event, but there wasn't actually any data we wouldn't update the timestamp,
now we will. This should be harmless: if there's an EPOLLIN we expect
there to be data, and even if there isn't the worst we can do is mildly
delay the cleanup of a stale flow.
Signed-off-by: David Gibson
Both udp_buf_listen_sock_data() and udp_buf_reply_sock_data() have comments
stating they use recvmmsg(). That's not correct, they only do so via
udp_sock_recv() which lists recvmmsg() itself.
In contrast udp_splice_send() and udp_tap_handler() both directly use
sendmmsg(), but only the latter lists it. Add it to the former as well.
Signed-off-by: David Gibson
On Tue, 1 Apr 2025 19:57:07 +1100
David Gibson
Some additional small cleanups
David Gibson (3): udp: Remove redundant udp_at_sidx() call in udp_tap_handler() udp: Simplify updates to UDP flow timestamp udp: Correct some seccomp filter annotations
Applied. -- Stefano
On Wed, Apr 02, 2025 at 03:44:17PM +0200, Stefano Brivio wrote:
On Tue, 1 Apr 2025 19:57:07 +1100 David Gibson
wrote: Some additional small cleanups
David Gibson (3): udp: Remove redundant udp_at_sidx() call in udp_tap_handler() udp: Simplify updates to UDP flow timestamp udp: Correct some seccomp filter annotations
Applied.
Did you forget to push? I'm not seeing these in the tree. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson
On Thu, 3 Apr 2025 11:02:10 +1100
David Gibson
On Wed, Apr 02, 2025 at 03:44:17PM +0200, Stefano Brivio wrote:
On Tue, 1 Apr 2025 19:57:07 +1100 David Gibson
wrote: Some additional small cleanups
David Gibson (3): udp: Remove redundant udp_at_sidx() call in udp_tap_handler() udp: Simplify updates to UDP flow timestamp udp: Correct some seccomp filter annotations
Applied.
Did you forget to push? I'm not seeing these in the tree.
Oops, sorry, yes. Pushed now. -- Stefano
participants (2)
-
David Gibson
-
Stefano Brivio