Skip to contentSkip to conversation

tests: fix zc support checks

PATCH Applied Pavel Begunkov 2 participants 2 messages Oct 16, 2022 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: fix zc support checks

We should be checking cqe->res for -EINVAL to figure out whether we support zerocopy or not. It makes the test fail with older kernels.

---
 test/send-zerocopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
test/send-zerocopy.c +1 -1
index 31d66e3..c6279bc 100644
@@ -91,7 +91,7 @@ static int test_basic_send(struct io_uring *ring, int sock_tx, int sock_rx)
 	ret = io_uring_wait_cqe(ring, &cqe);
 	assert(!ret);
 	assert(cqe->user_data == 1);
-	if (ret == -EINVAL) {
+	if (cqe->res == -EINVAL) {
 		assert(!(cqe->flags & IORING_CQE_F_MORE));
 		return T_EXIT_SKIP;
 	}
Signature · 1 line
2.38.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Pavel Begunkov

We should be checking cqe->res for -EINVAL to figure out whether we support zerocopy or not. It makes the test fail with older kernels.

Applied, thanks!

[1/1] tests: fix zc support checks

      commit: 4f962862daa7d54de4d21eeaf89130ad49040fa7

Best regards,

Signature · 1 line
Jens Axboe