23inline bool check_cqe32([[maybe_unused]] io_uring_cqe *cqe) {
24 auto *ring = detail::Context::current().ring();
25 assert(ring !=
nullptr);
26 auto ring_flags = ring->ring()->flags;
27 if (ring_flags & IORING_SETUP_CQE32) {
30#if !IO_URING_CHECK_VERSION(2, 13)
31 if (ring_flags & IORING_SETUP_CQE_MIXED) {
32 return cqe->flags & IORING_CQE_F_32;
47 int32_t operator()(io_uring_cqe *cqe)
noexcept {
return cqe->res; }
58template <BufferRingLike Br>
class SelectBufferCQEHandler {
60 SelectBufferCQEHandler(Br *buffers) : buffers_(buffers) {}
62 auto operator()(io_uring_cqe *cqe)
noexcept {
63 return std::make_pair(cqe->res, buffers_->handle_finish(cqe));
77 std::pair<int32_t, uint64_t> operator()(io_uring_cqe *cqe)
noexcept {
78 assert(detail::check_cqe32(cqe) &&
79 "Expected big CQE for NVMe passthrough");
80 return {cqe->res, cqe->big_cqe[0]};
84#if !IO_URING_CHECK_VERSION(2, 12)
114 std::pair<int32_t, TxTimestampResult>
115 operator()(io_uring_cqe *cqe)
noexcept {
116 assert(detail::check_cqe32(cqe) &&
117 "Expected big CQE for TX timestamp operations");
120 static_cast<int>(cqe->flags >> IORING_TIMESTAMP_TYPE_SHIFT);
121 result.
hwts = cqe->flags & IORING_CQE_F_TSTAMP_HW;
122 result.
ts = *
reinterpret_cast<io_timespec *
>(cqe + 1);
123 return {cqe->res, result};
The main namespace for the Condy library.
Wrapper classes for liburing interfaces.
A CQE handler for NVMe passthrough commands that extracts the status and result from the CQE.
A simple CQE handler that extracts the result from the CQE without any additional processing.
A CQE handler for TX timestamp operations that extracts timestamp information from the CQE.
Result for TX timestamp operations, containing timestamp information from the socket error queue.
int tstype
The timestamp type, could be SCM_TSTAMP_SND, SCM_TSTAMP_SCHED, SCM_TSTAMP_ACK, etc.
io_timespec ts
The timestamp value.
bool hwts
Whether this timestamp is a hardware timestamp.