diff mbox series

[liburing,1/1] tests: fix zc support checks

Message ID 0c8bf4d5dd7135c990f4fa9232a54c8cd6cc024f.1665958020.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series [liburing,1/1] tests: fix zc support checks | expand

Commit Message

Pavel Begunkov Oct. 16, 2022, 10:07 p.m. UTC
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.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/send-zerocopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Oct. 16, 2022, 11:28 p.m. UTC | #1
On Sun, 16 Oct 2022 23:07:35 +0100, Pavel Begunkov wrote:
> 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,
diff mbox series

Patch

diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index 31d66e3..c6279bc 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -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;
 	}