Documentation
¶
Index ¶
- Constants
- func IOURingEnter(fd uint, toSubmit uint32, minComplete uint32, flags uint32, ...) (int, error)
- func IOURingRegister(fd int, opcode uint8, args unsafe.Pointer, nrArgs uint32) error
- func IOURingSetup(entries uint, params *IOURingParams) (int, error)
- type CQRingOffset
- type IOURingFilesUpdate
- type IOURingParams
- type IOUringCQE
- type IOUringSQE
- func (sqe *IOUringSQE) PrepAccept(fd int, addr unsafe.Pointer, addrlen int64, flags uint8)
- func (sqe *IOUringSQE) PrepConnect(fd int, addr unsafe.Pointer, addrlen int64)
- func (sqe *IOUringSQE) PrepPollAdd(fd int, pollMask uint)
- func (sqe *IOUringSQE) PrepPollFsync(fd int, fsyncFlags uint)
- func (sqe *IOUringSQE) PrepPollNop(fd int)
- func (sqe *IOUringSQE) PrepPollRemove(fd int, userData unsafe.Pointer)
- func (sqe *IOUringSQE) PrepRead(fd int, b []byte, offset int64)
- func (sqe *IOUringSQE) PrepReadFixed(fd int, buf unsafe.Pointer, nbytes uint32, offset int64)
- func (sqe *IOUringSQE) PrepReadv(fd int, iovecs []syscall.Iovec, n uint32, offset int64)
- func (sqe *IOUringSQE) PrepRecv(fd int, bs []byte, l int, flags uint8)
- func (sqe *IOUringSQE) PrepSend(fd int, bs []byte, l int, flags uint8)
- func (sqe *IOUringSQE) PrepWrite(fd int, b []byte, offset int64)
- func (sqe *IOUringSQE) PrepWriteFixed(fd int, buf unsafe.Pointer, nbytes uint32, offset int64)
- func (sqe *IOUringSQE) PrepWritev(fd int, iovecs []syscall.Iovec, n uint32, offset int64)
- func (sqe *IOUringSQE) SetData(data uint64)
- func (sqe *IOUringSQE) SetFlags(flags uint8)
- type SQRingOffset
Constants ¶
const ( IORING_ENTER_FLAGS_GETEVENTS uint32 = 1 << iota IORING_ENTER_FLAGS_SQ_WAKEUP IORING_ENTER_FLAGS_SQ_WAIT )
IOUringEnter flags
const ( IORING_REGISTER_BUFFERS uint8 = iota IORING_UNREGISTER_BUFFERS IORING_REGISTER_FILES IORING_UNREGISTER_FILES IORING_REGISTER_EVENTFD IORING_UNREGISTER_EVENTFD IORING_REGISTER_FILES_UPDATE IORING_REGISTER_EVENTFD_ASYNC IORING_REGISTER_PROBE IORING_REGISTER_PERSONALITY IORING_UNREGISTER_PERSONALITY IORING_REGISTER_RESTRICTIONS IORING_REGISTER_ENABLE_RINGS )
const ( IOURING_SETUP = 425 IOURING_ENTER = 426 IOURING_REGISTER = 427 )
const ( IORING_SETUP_IOPOLL uint32 = 1 << iota IORING_SETUP_SQPOLL IORING_SETUP_SQ_AFF IORING_SETUP_CQSIZE IORING_SETUP_CLAMP IORING_SETUP_ATTACH_WQ IORING_SETUP_R_DISABLED )
io_uring_setup flags
const ( IORING_FEAT_SINGLE_MMAP uint32 = 1 << iota IORING_FEAT_NODROP IORING_FEAT_SUBMIT_STABLE IORING_FEAT_RW_CUR_POS IORING_FEAT_CUR_PERSONALITY IORING_FEAT_FAST_POLL IORING_FEAT_POLL_32BITS IORING_FEAT_SQPOLL_NONFIXED IORING_FEAT_EXT_ARG IORING_FEAT_NATIVE_WORKERS IORING_FEAT_RSRC_TAGS )
io_uring_params->features flags
const ( // use fixed fileset IOSQE_FLAGS_FIXED_FILE uint8 = 1 << iota // issue after inflight IO IOSQE_FLAGS_IO_DRAIN // links next sqe IOSQE_FLAGS_IO_LINK // like LINK, but stronger IOSQE_FLAGS_IO_HARDLINK // always go async IOSQE_FLAGS_ASYNC // select buffer from sqe->buf_group IOSQE_FLAGS_BUFFER_SELECT )
sqe->flags
const ( IORING_OP_NOP uint8 = iota IORING_OP_READV IORING_OP_WRITEV IORING_OP_FSYNC IORING_OP_READ_FIXED IORING_OP_WRITE_FIXED IORING_OP_POLL_ADD IORING_OP_POLL_REMOVE IORING_OP_SYNC_FILE_RANGE IORING_OP_SENDMSG IORING_OP_RECVMSG IORING_OP_TIMEOUT IORING_OP_TIMEOUT_REMOVE IORING_OP_ACCEPT IORING_OP_ASYNC_CANCEL IORING_OP_LINK_TIMEOUT IORING_OP_CONNECT IORING_OP_FALLOCATE IORING_OP_OPENAT IORING_OP_CLOSE IORING_OP_FILES_UPDATE IORING_OP_STATX IORING_OP_READ IORING_OP_WRITE IORING_OP_FADVISE IORING_OP_MADVISE IORING_OP_SEND IORING_OP_RECV IORING_OP_OPENAT2 IORING_OP_EPOLL_CTL IORING_OP_SPLICE IORING_OP_PROVIDE_BUFFERS IORING_OP_REMOVE_BUFFERS IORING_OP_TEE IORING_OP_SHUTDOWN IORING_OP_RENAMEAT IORING_OP_UNLINKAT IORING_OP_LAST )
sqe->opcode
const ( IORING_SQ_NEED_WAKEUP uint32 = 1 << iota IORING_SQ_CQ_OVERFLOW )
const ( IORING_TIMEOUT_ABS uint32 = 1 << iota IORING_TIMEOUT_UPDATE )
sqe->timeout_flags
const ( IORING_POLL_ADD_MULTI uint32 = 1 << iota IORING_POLL_UPDATE_EVENTS IORING_POLL_UPDATE_USER_DATA )
* POLL_ADD flags. Note that since sqe->poll_events is the flag space, the * command flags for POLL_ADD are stored in sqe->len. * * IORING_POLL_ADD_MULTI Multishot poll. Sets IORING_CQE_F_MORE if * the poll handler will continue to report * CQEs on behalf of the same SQE. * * IORING_POLL_UPDATE Update existing poll request, matching * sqe->addr as the old user_data field.
const ( IORING_CQE_F_BUFFER uint32 = 1 << iota IORING_CQE_F_MORE )
* cqe->flags * * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID * IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries
const ( IORING_OFF_SQ_RING uint64 = 0 IORING_OFF_CQ_RING uint64 = 0x8000000 IORING_OFF_SQES uint64 = 0x10000000 )
* Magic offsets for the application to mmap the data it needs
const IORING_CQE_BUFFER_SHIFT = 16
const (
IORING_FSYNC_DATASYNC uint32 = 1 << iota
)
sqe->fsync_flags
const (
SPLICE_F_FD_IN_FIXED uint32 = 1 << 31
)
* sqe->splice_flags * extends splice(2) flags
Variables ¶
This section is empty.
Functions ¶
func IOURingEnter ¶
func IOURingEnter(fd uint, toSubmit uint32, minComplete uint32, flags uint32, sigset *unix.Sigset_t) (int, error)
int io_uring_enter(int fd, unsigned int to_submit, unsigned int min_complete, unsigned int flags, sigset_t *sig)
func IOURingRegister ¶
int io_uring_register(int fd, unsigned int opcode, void *arg, unsigned int nr_args)
func IOURingSetup ¶
func IOURingSetup(entries uint, params *IOURingParams) (int, error)
int io_uring_setup(unsigned int entries, struct io_uring_params *p) IOURingSetup ...
Types ¶
type CQRingOffset ¶
type CQRingOffset struct { Head uint32 Tail uint32 RingMask uint32 RingEntries uint32 Overflow uint32 Cqes uint32 Flags uint32 Resv1 uint32 Resv2 uint64 }
CQRingOffset ...
type IOURingFilesUpdate ¶
type IOURingParams ¶
type IOURingParams struct { SQEntries uint32 CQEntries uint32 Flags uint32 SQThreadCPU uint32 SQThreadIdle uint32 Features uint32 WQFd uint32 Resv [3]uint32 SQOffset SQRingOffset CQOffset CQRingOffset }
IOURingParams ...
type IOUringCQE ¶
IOUringCQE ...
type IOUringSQE ¶
type IOUringSQE struct {
// contains filtered or unexported fields
}
IOUringSQE ...
func (*IOUringSQE) PrepAccept ¶
PrepAccept ...
func (*IOUringSQE) PrepConnect ¶
func (sqe *IOUringSQE) PrepConnect(fd int, addr unsafe.Pointer, addrlen int64)
PrepConnect ...
func (*IOUringSQE) PrepPollAdd ¶
func (sqe *IOUringSQE) PrepPollAdd(fd int, pollMask uint)
PrepPollAdd ...
func (*IOUringSQE) PrepPollFsync ¶
func (sqe *IOUringSQE) PrepPollFsync(fd int, fsyncFlags uint)
PrepPollFsync ...
func (*IOUringSQE) PrepPollRemove ¶
func (sqe *IOUringSQE) PrepPollRemove(fd int, userData unsafe.Pointer)
PrepPollRemove ...
func (*IOUringSQE) PrepRead ¶
func (sqe *IOUringSQE) PrepRead(fd int, b []byte, offset int64)
PrepRead ...
func (*IOUringSQE) PrepReadFixed ¶
PrepReadFixed ...
func (*IOUringSQE) PrepRecv ¶
func (sqe *IOUringSQE) PrepRecv(fd int, bs []byte, l int, flags uint8)
PrepRecv ...
func (*IOUringSQE) PrepSend ¶
func (sqe *IOUringSQE) PrepSend(fd int, bs []byte, l int, flags uint8)
PrepSend ...
func (*IOUringSQE) PrepWrite ¶
func (sqe *IOUringSQE) PrepWrite(fd int, b []byte, offset int64)
PrepWrite ...
func (*IOUringSQE) PrepWriteFixed ¶
PrepWriteFixed ...
func (*IOUringSQE) PrepWritev ¶
PrepWritev ...