Skip to content

Commit

Permalink
Merge branch 'huge.2'
Browse files Browse the repository at this point in the history
* huge.2:
  setup: unify queue exit path
  setup: add support for io_uring_queue_init_mem()
  setup: add support for IORING_SETUP_NO_MMAP
  setup: split cq/sq entry count into helper
  setup: split writing cq/sq offsets into helper
  io_uring.h: update to kernel huge page version
  • Loading branch information
axboe committed Jun 9, 2023
2 parents 22ca6f0 + d504997 commit d39530a
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 83 deletions.
3 changes: 3 additions & 0 deletions src/include/liburing.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ IOURINGINLINE int io_uring_opcode_supported(const struct io_uring_probe *p,
return (p->ops[op].flags & IO_URING_OP_SUPPORTED) != 0;
}

int io_uring_queue_init_mem(unsigned entries, struct io_uring *ring,
struct io_uring_params *p,
void *buf, size_t buf_size);
int io_uring_queue_init_params(unsigned entries, struct io_uring *ring,
struct io_uring_params *p);
int io_uring_queue_init(unsigned entries, struct io_uring *ring,
Expand Down
9 changes: 7 additions & 2 deletions src/include/liburing/io_uring.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ enum {
*/
#define IORING_SETUP_DEFER_TASKRUN (1U << 13)

/*
* Application provides ring memory
*/
#define IORING_SETUP_NO_MMAP (1U << 14)

enum io_uring_op {
IORING_OP_NOP,
IORING_OP_READV,
Expand Down Expand Up @@ -406,7 +411,7 @@ struct io_sqring_offsets {
__u32 dropped;
__u32 array;
__u32 resv1;
__u64 resv2;
__u64 user_addr;
};

/*
Expand All @@ -425,7 +430,7 @@ struct io_cqring_offsets {
__u32 cqes;
__u32 flags;
__u32 resv1;
__u64 resv2;
__u64 user_addr;
};

/*
Expand Down
1 change: 1 addition & 0 deletions src/int_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
enum {
INT_FLAG_REG_RING = 1,
INT_FLAG_REG_REG_RING = 2,
INT_FLAG_APP_MEM = 4,
};

#endif
6 changes: 6 additions & 0 deletions src/liburing-ffi.map
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ LIBURING_2.4 {
io_uring_prep_msg_ring_fd;
io_uring_prep_msg_ring_fd_alloc;
io_uring_prep_sendto;
io_uring_queue_init_mem;
local:
*;
};

LIBURING_2.5 {
global:
io_uring_queue_init_mem;
} LIBURING_2.4;
6 changes: 6 additions & 0 deletions src/liburing.map
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ LIBURING_2.4 {
io_uring_register_restrictions;
io_uring_setup_buf_ring;
io_uring_free_buf_ring;
io_uring_queue_init_mem;
} LIBURING_2.3;

LIBURING_2.5 {
global:
io_uring_queue_init_mem;
} LIBURING_2.4;
Loading

0 comments on commit d39530a

Please sign in to comment.