io_uring: add register/unregister napi function
This adds an api to register and unregister the napi for io-uring. If the arg value is specified when unregistering, the current napi setting for the busy poll timeout is copied into the user structure. If this is not required, NULL can be passed as the arg value. Signed-off-by: Stefan Roesch <shr@devkernel.io> Acked-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230608163839.2891748-7-shr@devkernel.io Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
ff183d427d
commit
ef1186c1a8
@@ -571,6 +571,10 @@ enum {
|
||||
/* return status information for a buffer group */
|
||||
IORING_REGISTER_PBUF_STATUS = 26,
|
||||
|
||||
/* set/clear busy poll settings */
|
||||
IORING_REGISTER_NAPI = 27,
|
||||
IORING_UNREGISTER_NAPI = 28,
|
||||
|
||||
/* this goes last */
|
||||
IORING_REGISTER_LAST,
|
||||
|
||||
@@ -704,6 +708,14 @@ struct io_uring_buf_status {
|
||||
__u32 resv[8];
|
||||
};
|
||||
|
||||
/* argument for IORING_(UN)REGISTER_NAPI */
|
||||
struct io_uring_napi {
|
||||
__u32 busy_poll_to;
|
||||
__u8 prefer_busy_poll;
|
||||
__u8 pad[3];
|
||||
__u64 resv;
|
||||
};
|
||||
|
||||
/*
|
||||
* io_uring_restriction->opcode values
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user