From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 893855A004F; Mon, 30 Sep 2024 11:58:40 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] test: Add tests for passt in vhost-user mode Date: Mon, 30 Sep 2024 11:58:40 +0200 Message-ID: <20240930095840.606964-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: SAQZLDPZ3VSQZXGSZ5R3F7UW5GHLYQIE X-Message-ID-Hash: SAQZLDPZ3VSQZXGSZ5R3F7UW5GHLYQIE X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Run functional and performance tests for vhost-user mode as well. For functional tests, we add passt_vu and passt_vu_in_ns as symbolic links to their non-vhost-user counterparts, as no differences are intended but we want to distinguish them in test logs. For performance tests, instead, we add separate perf/passt_vu_tcp and perf/passt_vu_udp files, as we need longer test duration, as well as higher UDP sending bandwidths and larger TCP windows, to actually get the highest throughput vhost-user mode offers. For valgrind tests, vhost-user mode needs two extra system calls: statx and readlink. Add them as EXTRA_SYSCALLS for the valgrind target. Signed-off-by: Stefano Brivio --- This is based on: [PATCH v5 0/4] Add vhost-user support to passt. (part 3) [PATCH] test: Kernel binary can now be passed via the KERNEL environmental variable and currently shows an issue reported by valgrind, as passt starts and gets a connection from QEMU: accepted connection from PID 4806 ==4804== Conditional jump or move depends on uninitialised value(s) ==4804== at 0x13AE26: vu_set_mem_table_exec (vhost_user.c:459) ==4804== by 0x13C756: vu_control_handler (vhost_user.c:1232) ==4804== by 0x10CE46: main (passt.c:380) ==4804== which I didn't really investigate. This is the relevant code: static bool vu_set_mem_table_exec(struct vu_dev *vdev, struct vhost_user_msg *msg) { struct vhost_user_memory m = msg->payload.memory, *memory = &m; unsigned int i; for (i = 0; i < vdev->nregions; i++) { <-- on top of that, once the tests terminate QEMU, we get: qemu-system-x86_64: Failed to set msg fds. qemu-system-x86_64: vhost VQ 0 ring restore failed: -22: Invalid argument (22) qemu-system-x86_64: Failed to set msg fds. qemu-system-x86_64: vhost VQ 1 ring restore failed: -22: Invalid argument (22) qemu-system-x86_64: terminating on signal 15 from pid 4220 () About performance tests: I didn't try hard to get throughput figures as good as the ones Laurent reported by running iperf3 without arguments on his setup. We should probably play with that a bit more. Laurent, please feel free to carry this as part of your vhost-user series. Makefile | 3 +- test/lib/perf_report | 15 +++++++++ test/lib/setup | 77 ++++++++++++++++++++++++++++++++++++-------- test/run | 21 ++++++++++++ 4 files changed, 101 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 1e8910d..ce8aa43 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,8 @@ qrap: $(QRAP_SRCS) passt.h valgrind: EXTRA_SYSCALLS += rt_sigprocmask rt_sigtimedwait rt_sigaction \ rt_sigreturn getpid gettid kill clock_gettime mmap \ - mmap2 munmap open unlink gettimeofday futex + mmap2 munmap open unlink gettimeofday futex statx \ + readlink valgrind: FLAGS += -g -DVALGRIND valgrind: all diff --git a/test/lib/perf_report b/test/lib/perf_report index d1ef50b..c4ec817 100755 --- a/test/lib/perf_report +++ b/test/lib/perf_report @@ -49,6 +49,21 @@ td:empty { visibility: hidden; } __passt_tcp_LINE__ __passt_udp_LINE__ +
  • passt with vhost-user support

    + + + + + + + + __passt_vu_tcp_header__ + __passt_vu_udp_header__ + + __passt_vu_tcp_LINE__ __passt_vu_udp_LINE__ +
    + TCP, __passt_vu_tcp_threads__ at __passt_vu_tcp_freq__ GHzUDP, __passt_vu_udp_threads__ at __passt_vu_udp_freq__ GHz
    MTU:
    +