liburing icon indicating copy to clipboard operation
liburing copied to clipboard

io_uring_prep_setsockopt

Open sharpobject opened this issue 2 years ago • 4 comments

Hello,

It would be useful to be able to call setsockopt asynchronously because TCP_QUICKACK has to be set repeatedly during the life of a connection (what the heck!)

sharpobject avatar Dec 30 '22 04:12 sharpobject

This brings up a deeper question - I've been wondering, would it be worth while (or even possible) to have a "permanent quickack" setting in the kernel?

the need to set quickack constantly in situations where it is configured seems so heavy handed

JonKohler avatar Dec 30 '22 13:12 JonKohler

It would not be hard to add getsockopt/setsockopt support now, since we have the fops->uring_cmd() passthrough available. It's just used for nvme passthrough right now, but plumbing it up for sockets would be trivial. There are a few basic examples at the top of this branch:

https://git.kernel.dk/cgit/linux-block/log/?h=io_uring-fops.v7

I'll take a look at this when I get back from break.

axboe avatar Dec 30 '22 16:12 axboe

This brings up a deeper question - I've been wondering, would it be worth while (or even possible) to have a "permanent quickack" setting in the kernel?

Yes, absolutely. If we had that, it would still be useful to be able to do all our connection setup via io_uring though.

sharpobject avatar Jan 01 '23 02:01 sharpobject

Another usecase for io_uring_prep_setsockopt is IP[V6]_PKTINFO option that allows setting interface and address through which messages will be sent. This option is extremely useful for high performance udp servers that listen on wildcard address(dns server is example).

illiliti avatar Mar 09 '23 20:03 illiliti