Skip to content

pawelgaczynski/giouring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

giouring - about the project

giouring is a Go port of the liburing library. It is written entirely in Go. No cgo.

Almost all functions and structures from liburing was implemented.

The giouring API is very similar to the liburing API, so anyone familiar with liburing will find it easier when writing code. Significant changes include:

  • Method and structure names have been aligned with the naming conventions of the Go language.
  • The prefix io_uring has been removed from method and structure names. After importing the package, methods and types will be preceded by the library name: giouring.
  • SQE and CQE types have been given full names: SubmissionQueueEntry and CompletionQueueEvent.
  • Additionally, if a method primarily pertains to a specific structure, for example, all methods prefixed with io_uring_prep that are related to the SubmissionQueueEntry structure (in liburing: io_uring_sqe), the pointer that was passed in C as a method argument has been moved to the method receiver.

Important notice

  • giouring was tested on kernel version 6.2.0-27-generic. Keep in mind that when running unit tests on older kernel versions, some tests may fail because the older kernel may not support some functionality. This will be fixed in the future.
  • Test coverage is currently low, but it will be systematically expanded.

Documentation

Go Reference

(back to top)

Used by

(back to top)

Prerequisites

Gain requires Go 1.20+

(back to top)

Implemented structs

liburing name Golang liburing port name Notes Implemented
io_uring_sq SubmissionQueue ✔️
io_uring_cq CompletionQueue ✔️
io_uring Ring ✔️
io_uring_sqe SubmissionQueueEntry ✔️
io_uring_cqe CompletionQueueEvent ✔️
io_sqring_offsets SQRingOffsets ✔️
io_cqring_offsets CQRingOffsets ✔️
io_uring_params Params ✔️
io_uring_files_update FilesUpdate ✔️
io_uring_rsrc_register RsrcRegister ✔️
io_uring_rsrc_update RsrcUpdate ✔️
io_uring_rsrc_update2 RsrcUpdate2 ✔️
io_uring_probe_op ProbeOp ✔️
io_uring_probe Probe ✔️
io_uring_restriction Restriction ✔️
io_uring_buf BufAndRing ✔️
io_uring_buf_ring BufAndRing ✔️
io_uring_buf_reg BufReg ✔️
io_uring_getevents_arg GetEventsArg ✔️
io_uring_sync_cancel_reg SyncCancelReg ✔️
io_uring_file_index_range FileIndexRange ✔️
io_uring_recvmsg_out RecvmsgOut ✔️

(back to top)

Implemented methods

liburing name Receiver type Golang liburing port name Notes Implemented
IO_URING_CHECK_VERSION
IO_URING_VERSION_MAJOR
IO_URING_VERSION_MINOR
io_uring_buf_ring_add BufAndRing BufRingAdd ✔️
io_uring_buf_ring_advance BufAndRing BufRingAdvance ✔️
io_uring_buf_ring_cq_advance Ring BufRingCQAdvance ✔️
io_uring_buf_ring_init BufAndRing BufRingInit ✔️
io_uring_buf_ring_mask BufRingMask ✔️
io_uring_check_version CheckVersion ✔️
io_uring_close_ring_fd Ring CloseRingFd ✔️
io_uring_cq_advance Ring CQAdvance ✔️
io_uring_cq_has_overflow Ring CQHasOverflow ✔️
io_uring_cq_ready Ring CQReady ✔️
io_uring_cqe_get_data CompletionQueueEvent GetData ✔️
io_uring_cqe_get_data64 CompletionQueueEvent GetData64 ✔️
io_uring_cqe_seen Ring CQESeen ✔️
io_uring_enter Ring Enter ✔️
io_uring_enter2 Ring Enter2 ✔️
io_uring_for_each_cqe Ring ForEachCQE ✔️
io_uring_free_buf_ring Ring FreeBufRing ✔️
io_uring_free_probe ❗unnecessary ✖️
io_uring_get_events Ring GetEvents ✔️
io_uring_get_probe GetProbe ✔️
io_uring_get_probe_ring Ring GetProbeRing ✔️
io_uring_get_sqe Ring GetSQE ✔️
io_uring_major_version MajorVersion ✔️
io_uring_minor_version MinorVersion ✔️
io_uring_opcode_supported Probe IsSupported ✔️
io_uring_peek_cqe Ring PeekCQE ✔️
io_uring_prep_accept SubmissionQueueEntry PrepareAccept ✔️
io_uring_prep_accept_direct SubmissionQueueEntry PrepareAcceptDirect ✔️
io_uring_prep_cancel SubmissionQueueEntry PrepareCancel ✔️
io_uring_prep_cancel64 SubmissionQueueEntry PrepareCancel64 ✔️
io_uring_prep_close SubmissionQueueEntry PrepareClose ✔️
io_uring_prep_close_direct SubmissionQueueEntry PrepareCloseDirect ✔️
io_uring_prep_connect SubmissionQueueEntry PrepareConnect ✔️
io_uring_prep_fadvise SubmissionQueueEntry PrepareFadvise ✔️
io_uring_prep_fallocate SubmissionQueueEntry PrepareFallocate ✔️
io_uring_prep_fgetxattr SubmissionQueueEntry PrepareFgetxattr ✔️
io_uring_prep_files_update SubmissionQueueEntry PrepareFilesUpdate ✔️
io_uring_prep_fsetxattr SubmissionQueueEntry PrepareFsetxattr ✔️
io_uring_prep_fsync SubmissionQueueEntry PrepareFsync ✔️
io_uring_prep_getxattr SubmissionQueueEntry PrepareGetxattr ✔️
io_uring_prep_link SubmissionQueueEntry PrepareLink ✔️
io_uring_prep_link_timeout SubmissionQueueEntry PrepareLinkTimeout ✔️
io_uring_prep_linkat SubmissionQueueEntry PrepareLinkat ✔️
io_uring_prep_madvise SubmissionQueueEntry PrepareMadvise ✔️
io_uring_prep_mkdir SubmissionQueueEntry PrepareMkdir ✔️
io_uring_prep_mkdirat SubmissionQueueEntry PrepareMkdirat ✔️
io_uring_prep_msg_ring SubmissionQueueEntry PrepareMsgRing ✔️
io_uring_prep_msg_ring_cqe_flags SubmissionQueueEntry PrepareMsgRingCqeFlags ✔️
io_uring_prep_msg_ring_fd SubmissionQueueEntry PrepareMsgRingFd ✔️
io_uring_prep_msg_ring_fd_alloc SubmissionQueueEntry PrepareMsgRingFdAlloc ✔️
io_uring_prep_multishot_accept SubmissionQueueEntry PrepareMultishotAccept ✔️
io_uring_prep_multishot_accept_direct SubmissionQueueEntry PrepareMultishotAcceptDirect ✔️
io_uring_prep_nop SubmissionQueueEntry PrepareNop ✔️
io_uring_prep_openat SubmissionQueueEntry PrepareOpenat ✔️
io_uring_prep_openat2 SubmissionQueueEntry PrepareOpenat2 ✔️
io_uring_prep_openat2_direct SubmissionQueueEntry PrepareOpenat2Direct ✔️
io_uring_prep_openat_direct SubmissionQueueEntry PrepareOpenatDirect ✔️
io_uring_prep_poll_add SubmissionQueueEntry PreparePollAdd ✔️
io_uring_prep_poll_multishot SubmissionQueueEntry PreparePollMultishot ✔️
io_uring_prep_poll_remove SubmissionQueueEntry PreparePollRemove ✔️
io_uring_prep_poll_update SubmissionQueueEntry PreparePollUpdate ✔️
io_uring_prep_provide_buffers SubmissionQueueEntry PrepareProvideBuffers ✔️
io_uring_prep_read SubmissionQueueEntry PrepareRead ✔️
io_uring_prep_read_fixed SubmissionQueueEntry PrepareReadFixed ✔️
io_uring_prep_readv SubmissionQueueEntry PrepareReadv ✔️
io_uring_prep_readv2 SubmissionQueueEntry PrepareReadv2 ✔️
io_uring_prep_recv SubmissionQueueEntry PrepareRecv ✔️
io_uring_prep_recv_multishot SubmissionQueueEntry PrepareRecvMultishot ✔️
io_uring_prep_recvmsg SubmissionQueueEntry PrepareRecvMsg ✔️
io_uring_prep_recvmsg_multishot SubmissionQueueEntry PrepareRecvMsgMultishot ✔️
io_uring_prep_remove_buffers SubmissionQueueEntry PrepareRemoveBuffers ✔️
io_uring_prep_rename SubmissionQueueEntry PrepareRename ✔️
io_uring_prep_renameat SubmissionQueueEntry PrepareRenameat ✔️
io_uring_prep_send SubmissionQueueEntry PrepareSend ✔️
io_uring_prep_send_set_addr SubmissionQueueEntry PrepareSendSetAddr ✔️
io_uring_prep_send_zc SubmissionQueueEntry PrepareSendZC ✔️
io_uring_prep_send_zc_fixed SubmissionQueueEntry PrepareSendZCFixed ✔️
io_uring_prep_sendmsg SubmissionQueueEntry PrepareSendMsg ✔️
io_uring_prep_sendmsg_zc SubmissionQueueEntry PrepareSendmsgZC ✔️
io_uring_prep_sendto SubmissionQueueEntry PrepareSendto ✔️
io_uring_prep_setxattr SubmissionQueueEntry PrepareSetxattr ✔️
io_uring_prep_shutdown SubmissionQueueEntry PrepareShutdown ✔️
io_uring_prep_socket SubmissionQueueEntry PrepareSocket ✔️
io_uring_prep_socket_direct SubmissionQueueEntry PrepareSocketDirect ✔️
io_uring_prep_socket_direct_alloc SubmissionQueueEntry PrepareSocketDirectAlloc ✔️
io_uring_prep_splice SubmissionQueueEntry PrepareSplice ✔️
io_uring_prep_statx SubmissionQueueEntry PrepareStatx ✔️
io_uring_prep_symlink SubmissionQueueEntry PrepareSymlink ✔️
io_uring_prep_symlinkat SubmissionQueueEntry PrepareSymlinkat ✔️
io_uring_prep_sync_file_range SubmissionQueueEntry PrepareSyncFileRange ✔️
io_uring_prep_tee SubmissionQueueEntry PrepareTee ✔️
io_uring_prep_timeout SubmissionQueueEntry PrepareTimeout ✔️
io_uring_prep_timeout_remove SubmissionQueueEntry PrepareTimeoutRemove ✔️
io_uring_prep_timeout_update SubmissionQueueEntry PrepareTimeoutUpdate ✔️
io_uring_prep_unlink SubmissionQueueEntry PrepareUnlink ✔️
io_uring_prep_unlinkat SubmissionQueueEntry PrepareUnlinkat ✔️
io_uring_prep_write SubmissionQueueEntry PrepareWrite ✔️
io_uring_prep_write_fixed SubmissionQueueEntry PrepareWriteFixed ✔️
io_uring_prep_writev SubmissionQueueEntry PrepareWritev ✔️
io_uring_prep_writev2 SubmissionQueueEntry PrepareWritev2 ✔️
io_uring_queue_exit Ring QueueExit ✔️
io_uring_queue_init Ring QueueInit ✔️
io_uring_queue_init_params Ring QueueInitParams ✔️
io_uring_recvmsg_cmsg_firsthdr RecvmsgOut CmsgFirsthdr ✔️
io_uring_recvmsg_cmsg_nexthdr RecvmsgOut CmsgNexthdr ✔️
io_uring_recvmsg_name RecvmsgOut Name ✔️
io_uring_recvmsg_payload RecvmsgOut Payload ✔️
io_uring_recvmsg_payload_length RecvmsgOut PayloadLength ✔️
io_uring_recvmsg_validate RecvmsgOut RecvmsgValidate ✔️
io_uring_register Ring Register ✔️
io_uring_register_buf_ring Ring RegisterBufferRing ✔️
io_uring_register_buffers Ring RegisterBuffers ✔️
io_uring_register_buffers_sparse Ring RegisterBuffersSparse ✔️
io_uring_register_buffers_tags Ring RegisterBuffersTags ✔️
io_uring_register_buffers_update_tag Ring RegisterBuffersUpdateTag ✔️
io_uring_register_eventfd Ring RegisterEventFd ✔️
io_uring_register_eventfd_async Ring RegisterEventFdAsync ✔️
io_uring_register_file_alloc_range Ring RegisterFileAllocRange ✔️
io_uring_register_files Ring RegisterFiles ✔️
io_uring_register_files_sparse Ring RegisterFilesSparse ✔️
io_uring_register_files_tags Ring RegisterFilesTags ✔️
io_uring_register_files_update Ring RegisterFilesUpdate ✔️
io_uring_register_files_update_tag Ring RegisterFilesUpdateTag ✔️
io_uring_register_iowq_aff Ring RegisterIOWQAff ✔️
io_uring_register_iowq_max_workers Ring RegisterIOWQMaxWorkers ✔️
io_uring_register_ring_fd Ring RegisterRingFd ✔️
io_uring_register_sync_cancel Ring RegisterSyncCancel ✔️
io_uring_setup Setup ✔️
io_uring_setup_buf_ring Ring SetupBufRing ✔️
io_uring_sq_ready Ring SQReady ✔️
io_uring_sq_space_left Ring SQSpaceLeft ✔️
io_uring_sqe_set_data SubmissionQueueEntry SetData ✔️
io_uring_sqe_set_data64 SubmissionQueueEntry SetData64 ✔️
io_uring_sqe_set_flags SubmissionQueueEntry SetFlags ✔️
io_uring_sqring_wait Ring SQRingWait ✔️
io_uring_submit Ring Submit ✔️
io_uring_submit_and_get_events Ring SubmitAndGetEvents ✔️
io_uring_submit_and_wait Ring SubmitAndWait ✔️
io_uring_submit_and_wait_timeout Ring SubmitAndWaitTimeout ✔️
io_uring_unregister_buf_ring Ring UnregisterBufferRing ✔️
io_uring_unregister_buffers Ring UnregisterBuffers ✔️
io_uring_unregister_eventfd Ring UnregisterEventFd ✔️
io_uring_unregister_files Ring UnregisterFiles ✔️
io_uring_unregister_iowq_aff Ring UnregisterIOWQAff ✔️
io_uring_unregister_ring_fd Ring UnregisterRingFd ✔️
io_uring_wait_cqe Ring WaitCQE ✔️
io_uring_wait_cqe_nr Ring WaitCQENr ✔️
io_uring_wait_cqe_timeout Ring WaitCQETimeout ✔️
io_uring_wait_cqes Ring WaitCQEs ✔️

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Paweł Gaczyński - LinkedIn

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

About

Go programming language port of liburing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages