| 189 | } |
| 190 | |
| 191 | static int test_rw(struct buf_desc *bd, struct iovec *vecs, int nr_vec, int fd_wr) |
| 192 | { |
| 193 | unsigned buf_idx = bd->buf_idx; |
| 194 | struct io_uring *ring = &bd->ring; |
| 195 | struct io_uring_sqe *sqe; |
| 196 | struct io_uring_cqe *cqe; |
| 197 | int ret; |
| 198 | |
| 199 | sqe = io_uring_get_sqe(ring); |
| 200 | if (bd->fixed) |
| 201 | io_uring_prep_writev_fixed(sqe, fd_wr, vecs, nr_vec, 0, 0, buf_idx); |
| 202 | else |
| 203 | io_uring_prep_writev(sqe, fd_wr, vecs, nr_vec, 0); |
| 204 | |
| 205 | ret = io_uring_submit(ring); |
| 206 | if (ret != 1) { |
| 207 | fprintf(stderr, "submit failed %i\n", ret); |
| 208 | exit(1); |
| 209 | } |
| 210 | ret = io_uring_wait_cqe(ring, &cqe); |
| 211 | if (ret) { |
| 212 | fprintf(stderr, "wait_cqe=%d\n", ret); |
| 213 | exit(1); |
| 214 | } |
| 215 | |
| 216 | ret = cqe->res; |
| 217 | io_uring_cqe_seen(ring, cqe); |
| 218 | return ret; |
| 219 | } |
| 220 | |
| 221 | static int test_sendzc(struct buf_desc *bd, struct iovec *vecs, int nr_vec, int fd_wr) |
| 222 | { |
no test coverage detected