Skip to content

Proposal: io_uring_cqe and io_uring_sqe should come in two variants. #1568

@LAC-Tech

Description

@LAC-Tech

So in #684 a user asked why io_uring_cqe lacks big_cqe, and the decision was made to make the struct match the C definition (the trailing member array thing).

I think that it's cleaner to model this as two structs:

  • the regular 16 byte version
  • the 32 bit version used for IORING_OP_URING_CMD. in which case the big_cqe field is always [u32; 4].

This has the added advantage that both structs could implement Copy, Clone and we avoid shenanigans like this in rustix-uring.

Of added note, io_uring_sqe also has a larger variant (flag IORING_SETUP_SQE128), again intended for using io_uring for NVMe passthrough stuff. The two struct solution would work well here too.


If you agree with this reasoning, let me know, and I'll make a pull request. This would technically be a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions