Zero-copy network transmission with io_uring
Zero-copy network transmission with io_uring
Posted Jan 6, 2022 6:47 UTC (Thu) by NYKevin (subscriber, #129325)In reply to: Zero-copy network transmission with io_uring by farnz
Parent article: Zero-copy network transmission with io_uring
I don't see why you would need to use mutexes. The sample code in https://www.kernel.org/doc/html/v4.15/networking/msg_zero... uses poll(2) to wait for the send to complete, and I tend to assume you could also use select(2) or epoll(2) instead if you find those easier or more familiar (until now, I had never heard of poll). Just write a five-line wrapper function that calls send(2) and then waits on the socket with one of those syscalls, and (as far as I can tell) you should be good to go.
Frankly, the kernel is not a library. If we *really* need to have a wrapper function for this, it ought to live in libc, not in the kernel.
