| ... | ... | @@ -3503,10 +3503,6 @@ test "accept multishot" { |
| 3503 | 3503 | } |
| 3504 | 3504 | |
| 3505 | 3505 | test "accept/connect/send_zc/recv" { |
| 3506 | | if (true) { |
| 3507 | | // https://github.com/ziglang/zig/issues/20212 |
| 3508 | | return error.SkipZigTest; |
| 3509 | | } |
| 3510 | 3506 | try skipKernelLessThan(.{ .major = 6, .minor = 0, .patch = 0 }); |
| 3511 | 3507 | |
| 3512 | 3508 | var ring = IoUring.init(16, 0) catch |err| switch (err) { |
| ... | ... | @@ -3528,25 +3524,28 @@ test "accept/connect/send_zc/recv" { |
| 3528 | 3524 | _ = try ring.recv(0xffffffff, socket_test_harness.server, .{ .buffer = buffer_recv[0..] }, 0); |
| 3529 | 3525 | try testing.expectEqual(@as(u32, 2), try ring.submit()); |
| 3530 | 3526 | |
| 3527 | var cqe_send, const cqe_recv = brk: { |
| 3528 | const cqe1 = try ring.copy_cqe(); |
| 3529 | const cqe2 = try ring.copy_cqe(); |
| 3530 | break :brk if (cqe1.user_data == 0xeeeeeeee) .{ cqe1, cqe2 } else .{ cqe2, cqe1 }; |
| 3531 | }; |
| 3532 | |
| 3531 | 3533 | // First completion of zero-copy send. |
| 3532 | 3534 | // IORING_CQE_F_MORE, means that there |
| 3533 | 3535 | // will be a second completion event / notification for the |
| 3534 | 3536 | // request, with the user_data field set to the same value. |
| 3535 | 3537 | // buffer_send must be keep alive until second cqe. |
| 3536 | | var cqe_send = try ring.copy_cqe(); |
| 3537 | 3538 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3538 | 3539 | .user_data = 0xeeeeeeee, |
| 3539 | 3540 | .res = buffer_send.len, |
| 3540 | 3541 | .flags = linux.IORING_CQE_F_MORE, |
| 3541 | 3542 | }, cqe_send); |
| 3542 | 3543 | |
| 3543 | | const cqe_recv = try ring.copy_cqe(); |
| 3544 | 3544 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3545 | 3545 | .user_data = 0xffffffff, |
| 3546 | 3546 | .res = buffer_recv.len, |
| 3547 | 3547 | .flags = cqe_recv.flags & linux.IORING_CQE_F_SOCK_NONEMPTY, |
| 3548 | 3548 | }, cqe_recv); |
| 3549 | | |
| 3550 | 3549 | try testing.expectEqualSlices(u8, buffer_send[0..buffer_recv.len], buffer_recv[0..]); |
| 3551 | 3550 | |
| 3552 | 3551 | // Second completion of zero-copy send. |