shared/tester: Add support for NULL PDUs
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 25 Apr 2023 00:15:00 +0000 (17:15 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:41:34 +0000 (16:11 +0530)
This adds support for NULL PDUs which can be used to skip a round of
TX/RX.

src/shared/tester.c
src/shared/tester.h

index 0f35b36..20e99bc 100755 (executable)
@@ -913,8 +913,12 @@ static bool test_io_send(struct io *io, void *user_data)
 
        g_assert_cmpint(len, ==, iov->iov_len);
 
-       if (!test->iovcnt && test->io_complete_func)
+       if (!test->iovcnt && test->io_complete_func) {
                test->io_complete_func(test->test_data);
+       } else if (test->iovcnt && !test->iov->iov_base) {
+               test_get_iov(test);
+               return test_io_send(io, user_data);
+       }
 
        return false;
 }
index 4961018..16f4102 100755 (executable)
@@ -21,6 +21,8 @@
                .iov_len = sizeof(data(args)), \
        }
 
+#define IOV_NULL {}
+
 void tester_init(int *argc, char ***argv);
 int tester_run(void);