| ... | @@ -3524,12 +3524,7 @@ test "accept/connect/send_zc/recv" { | ... | @@ -3524,12 +3524,7 @@ test "accept/connect/send_zc/recv" { |
| 3524 | _ = try ring.recv(0xffffffff, socket_test_harness.server, .{ .buffer = buffer_recv[0..] }, 0); | 3524 | _ = try ring.recv(0xffffffff, socket_test_harness.server, .{ .buffer = buffer_recv[0..] }, 0); |
| 3525 | try testing.expectEqual(@as(u32, 2), try ring.submit()); | 3525 | try testing.expectEqual(@as(u32, 2), try ring.submit()); |
| 3526 | | 3526 | |
| 3527 | var cqe_send, const cqe_recv = brk: { | 3527 | var cqe_send = try ring.copy_cqe(); |
| 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 | | | |
| 3533 | // First completion of zero-copy send. | 3528 | // First completion of zero-copy send. |
| 3534 | // IORING_CQE_F_MORE, means that there | 3529 | // IORING_CQE_F_MORE, means that there |
| 3535 | // will be a second completion event / notification for the | 3530 | // will be a second completion event / notification for the |
| ... | @@ -3541,6 +3536,12 @@ test "accept/connect/send_zc/recv" { | ... | @@ -3541,6 +3536,12 @@ test "accept/connect/send_zc/recv" { |
| 3541 | .flags = linux.IORING_CQE_F_MORE, | 3536 | .flags = linux.IORING_CQE_F_MORE, |
| 3542 | }, cqe_send); | 3537 | }, cqe_send); |
| 3543 | | 3538 | |
| | 3539 | cqe_send, const cqe_recv = brk: { |
| | 3540 | const cqe1 = try ring.copy_cqe(); |
| | 3541 | const cqe2 = try ring.copy_cqe(); |
| | 3542 | break :brk if (cqe1.user_data == 0xeeeeeeee) .{ cqe1, cqe2 } else .{ cqe2, cqe1 }; |
| | 3543 | }; |
| | 3544 | |
| 3544 | try testing.expectEqual(linux.io_uring_cqe{ | 3545 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3545 | .user_data = 0xffffffff, | 3546 | .user_data = 0xffffffff, |
| 3546 | .res = buffer_recv.len, | 3547 | .res = buffer_recv.len, |
| ... | @@ -3550,7 +3551,6 @@ test "accept/connect/send_zc/recv" { | ... | @@ -3550,7 +3551,6 @@ test "accept/connect/send_zc/recv" { |
| 3550 | | 3551 | |
| 3551 | // Second completion of zero-copy send. | 3552 | // Second completion of zero-copy send. |
| 3552 | // IORING_CQE_F_NOTIF in flags signals that kernel is done with send_buffer | 3553 | // IORING_CQE_F_NOTIF in flags signals that kernel is done with send_buffer |
| 3553 | cqe_send = try ring.copy_cqe(); | | |
| 3554 | try testing.expectEqual(linux.io_uring_cqe{ | 3554 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3555 | .user_data = 0xeeeeeeee, | 3555 | .user_data = 0xeeeeeeee, |
| 3556 | .res = 0, | 3556 | .res = 0, |