[PATCH RFC net-next v4 09/11] hv_sock: add netns hooks

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Make NS changes not break hyperv. Guest vsocks still remain in the global namespace always, so the behavior is unchanged. Signed-off-by: Bobby Eshleman --- net/vmw_vsock/hyperv_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock

[PATCH RFC net-next v4 11/11] vsock/loopback: add netns support

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add NS support to vsock loopback. In theory, loopback can be viewed as a given CID, and so should collide with other vsocks when the namespaces are in global mode, but should not collide if the namespace is in local mode. This has not been tested yet, but will be by the next

[PATCH RFC net-next v4 10/11] vsock/vmci: add netns hooks

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add hooks for new internal NS calls to avoid breaking vmci. Guest vsocks remain in global mode namespaces, so behavior is unchanged. Signed-off-by: Bobby Eshleman --- net/vmw_vsock/vmci_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH RFC net-next v4 07/11] vhost/vsock: add netns support

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add the ability to isolate vsock flows using namespaces. The namespace for a VM is inherited from the PID that opened the vhost-vsock device. Signed-off-by: Bobby Eshleman --- drivers/vhost/vsock.c | 48 ++-- 1 file changed, 38

[PATCH RFC net-next v4 08/11] vsock/virtio: add netns hooks

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman This changes virtio to not be broken by new internal API changes required for NS support on the host side. virtio-vsock namespaces are always global mode, so behavior is unchanged for them. Signed-off-by: Bobby Eshleman --- net/vmw_vsock/virtio_transport.c | 5 +++-- 1

[PATCH RFC net-next v4 06/11] virtio-vsock: add netns to common code

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add support to the virtio common code for passing around net namespace pointers (tx and rx). The series still requires non-common transport support to be added by future patches. Signed-off-by: Bobby Eshleman --- include/linux/virtio_vsock.h| 1 + net

[PATCH RFC net-next v4 05/11] vsock: add common code for vsock NS support

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add NS functionality (initialization, passing to transports, procfs, etc...) to the vsock socket layer. Later patches that add NS support to transports will depend on this patch. Signed-off-by: Bobby Eshleman --- include/net/af_vsock.h | 7 +- net/vmw_vsock/af_vsock.c

[PATCH RFC net-next v4 01/11] selftests/vsock: add NS tests to vmtest.sh

2025-06-16 Thread Bobby Eshleman
bridge with socat (perhaps ip tables would be better, because it can reduce an out-of-tree tool dependency). Another option is to not use vsock_test for the NS tests, but it seems more robust to test all of vsock instead of just (for example) connectibility... Signed-off-by: Bobby Eshleman

[PATCH RFC net-next v4 04/11] vsock: add net to vsock skb cb

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add a net pointer to the vsock skb and helpers for getting/setting it. This is in preparation for adding vsock NS support. Signed-off-by: Bobby Eshleman --- include/linux/virtio_vsock.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux

[PATCH RFC net-next v4 03/11] vsock: add vsock net ns helpers

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add helper functions for setting/getting vsock NS modes. This commit is in preparation for adding NS support to vsock. Signed-off-by: Bobby Eshleman --- include/net/af_vsock.h | 46 ++ 1 file changed, 46 insertions(+) diff

[PATCH RFC net-next v4 02/11] vsock: a per-net vsock NS mode state

2025-06-16 Thread Bobby Eshleman
From: Bobby Eshleman Add the per-net vsock NS mode state. This only adds the structure for holding the mode necessary and some of the definitions, but does not integrate the functionality yet. Signed-off-by: Bobby Eshleman --- MAINTAINERS | 1 + include/net/net_namespace.h

[PATCH RFC net-next v4 00/11] vsock: add namespace support to vhost-vsock

2025-06-16 Thread Bobby Eshleman
e already all done work on this together. Thanks again for everyone's help and reviews! Signed-off-by: Bobby Eshleman --- Changes in v3: - add notion of "modes" - add procfs /proc/net/vsock_ns_mode - local and global modes only - no /dev/vhost-vsock-netns - vmtest.sh already merge

[PATCH net-next v10] selftests/vsock: add initial vmtest.sh for vsock

2025-06-09 Thread Bobby Eshleman
a kselftest itself. This is different than other systems that have a "vmtest.sh", where it is used as a utility script to spin up a VM to run the selftests as a guest (but isn't hooked into kselftest). Signed-off-by: Bobby Eshleman --- Changes in v10: - remove dupes in tools/te

[PATCH net-next v9] selftests/vsock: add initial vmtest.sh for vsock

2025-05-27 Thread Bobby Eshleman
a kselftest itself. This is different than other systems that have a "vmtest.sh", where it is used as a utility script to spin up a VM to run the selftests as a guest (but isn't hooked into kselftest). Signed-off-by: Bobby Eshleman --- Changes in v9: - make kselftest build target

Re: [PATCH net-next v8] selftests/vsock: add initial vmtest.sh for vsock

2025-05-27 Thread Bobby Eshleman
On Tue, May 27, 2025 at 05:55:13PM +0200, Stefano Garzarella wrote: > On Tue, May 27, 2025 at 07:30:29AM -0700, Bobby Eshleman wrote: > > On Mon, May 26, 2025 at 01:18:18PM +0200, Stefano Garzarella wrote: > > > On Thu, May 22, 2025 at 09:59:07PM -0700, Bobby Eshleman wrote: &g

Re: [PATCH net-next v8] selftests/vsock: add initial vmtest.sh for vsock

2025-05-27 Thread Bobby Eshleman
On Mon, May 26, 2025 at 01:18:18PM +0200, Stefano Garzarella wrote: > On Thu, May 22, 2025 at 09:59:07PM -0700, Bobby Eshleman wrote: > > This commit introduces a new vmtest.sh runner for vsock. > > > > It uses virtme-ng/qemu to run tests in a VM. The tests validate G2H,

[PATCH net-next v8] selftests/vsock: add initial vmtest.sh for vsock

2025-05-22 Thread Bobby Eshleman
a kselftest itself. This is different than other systems that have a "vmtest.sh", where it is used as a utility script to spin up a VM to run the selftests as a guest (but isn't hooked into kselftest). Signed-off-by: Bobby Eshleman --- Changes in v8: - remove NIPA comment from comm

Re: [PATCH net-next v7] selftests/vsock: add initial vmtest.sh for vsock

2025-05-20 Thread Bobby Eshleman
On Tue, May 20, 2025 at 01:09:25PM +0200, Stefano Garzarella wrote: > On Tue, May 20, 2025 at 12:58:18PM +0200, Paolo Abeni wrote: > > On 5/20/25 10:24 AM, Stefano Garzarella wrote: > > > > Still it could be worthy to re-introduce (behind a command line option) > > the ability to build the kernel

Re: [PATCH net-next v7] selftests/vsock: add initial vmtest.sh for vsock

2025-05-20 Thread Bobby Eshleman
On Tue, May 20, 2025 at 12:58:18PM +0200, Paolo Abeni wrote: > On 5/20/25 10:24 AM, Stefano Garzarella wrote: > > https://github.com/linux-netdev/nipa/wiki/How-to-run-netdev-selftests-CI-style > > @Bobby: AFAICS this now has all the ingredients to fit NIPA integration > am I correct? the last com

Re: [PATCH net-next v7] selftests/vsock: add initial vmtest.sh for vsock

2025-05-20 Thread Bobby Eshleman
On Tue, May 20, 2025 at 01:24:43PM +0200, Paolo Abeni wrote: > On 5/16/25 12:00 AM, Bobby Eshleman wrote: > > +tap_prefix() { > > + sed -e "s/^/${TAP_PREFIX}/" > > +} > > I think there is no need to the tap prefix to the output you intend to > 'com

[PATCH net-next v7] selftests/vsock: add initial vmtest.sh for vsock

2025-05-15 Thread Bobby Eshleman
as a kselftest itself. This is different than other systems that have a "vmtest.sh", where it is used as a utility script to spin up a VM to run the selftests as a guest (but isn't hooked into kselftest). Testing in NIPA is still WIP. Signed-off-by: Bobby Eshleman --- Changes in v7: - fi

Re: [PATCH net-next v5] selftests/vsock: add initial vmtest.sh for vsock

2025-05-15 Thread Bobby Eshleman
On Thu, May 15, 2025 at 11:02:00AM +0200, Stefano Garzarella wrote: > On Tue, May 13, 2025 at 11:31:13PM -0700, Bobby Eshleman wrote: > > This commit introduces a new vmtest.sh runner for vsock. > > > > It uses virtme-ng/qemu to run tests in a VM. The tests validate G2H,

[PATCH net-next v6] selftests/vsock: add initial vmtest.sh for vsock

2025-05-15 Thread Bobby Eshleman
WIP. Signed-off-by: Bobby Eshleman --- Changes in v6: - add make cmd in commit message in vmtest.sh example (Stefano) - check nonzero size of QEMU_PIDFILE using -s conditional (Stefano) - display log file path after tests so it is easier to find amongst other random names - cleanup qemu pidfile

[PATCH net-next v5] selftests/vsock: add initial vmtest.sh for vsock

2025-05-13 Thread Bobby Eshleman
st.sh as a kselftest itself. This is different than other systems that have a "vmtest.sh", where it is used as a utility script to spin up a VM to run the selftests as a guest (but isn't hooked into kselftest). Testing in NIPA is still WIP. Signed-off-by: Bobby Eshleman --- Chang

Re: [PATCH net-next v4] selftests/vsock: add initial vmtest.sh for vsock

2025-05-13 Thread Bobby Eshleman
On Tue, May 13, 2025 at 12:08:48PM +0200, Paolo Abeni wrote: > On 5/8/25 3:23 AM, Bobby Eshleman wrote: > > This commit introduces a new vmtest.sh runner for vsock. > > > > It uses virtme-ng/qemu to run tests in a VM. The tests validate G2H, > > H2G, and loopback. T

[PATCH net-next v4] selftests/vsock: add initial vmtest.sh for vsock

2025-05-07 Thread Bobby Eshleman
p_output +echo "1..${#ARGS[@]}" | tap_output + +rm -f "${LOG}" +log_setup "Booting up VM" +vm_setup +vm_wait_for_ssh +log_setup "VM booted up" + +cnt_pass=0 +cnt_fail=0 +cnt_skip=0 +cnt_total=0 +exitcode=0 +for arg in "${ARGS[@]}"; do + run_test "${arg}" + rc=$? + if [[ ${rc} == $KSFT_PASS ]]; then + cnt_pass=$(( cnt_pass + 1 )) + echo "[PASS]" | tap_prefix + echo "ok ${cnt_total} ${arg}" | tap_output + elif [[ ${rc} == $KSFT_SKIP ]]; then + cnt_skip=$(( cnt_skip + 1 )) + echo "[SKIP]" | tap_prefix + echo "ok ${cnt_total} ${arg} # SKIP" | tap_output + exitcode=$KSFT_SKIP + elif [[ ${rc} == $KSFT_FAIL ]]; then + cnt_fail=$(( cnt_fail + 1 )) + echo "[FAIL]" | tap_prefix + echo "not ok ${cnt_fail} ${arg} # exit=$rc" | tap_output + exitcode=$KSFT_FAIL + fi + cnt_total=$(( cnt_total + 1 )) +done + +echo "SUMMARY: PASS=${cnt_pass} SKIP=${cnt_skip} FAIL=${cnt_fail}" | tap_prefix +echo "1..${cnt_total}" | tap_output + +exit ${rc} --- base-commit: 8066e388be48f1ad62b0449dc1d31a25489fa12a change-id: 20250325-vsock-vmtest-b3a21d2102c2 Best regards, -- Bobby Eshleman

Re: [PATCH net-next v3] selftests/vsock: add initial vmtest.sh for vsock

2025-05-06 Thread Bobby Eshleman
On Fri, May 02, 2025 at 12:22:46PM +0200, Paolo Abeni wrote: > On 4/29/25 1:48 AM, Bobby Eshleman wrote: > > This commit introduces a new vmtest.sh runner for vsock. > > > > It uses virtme-ng/qemu to run tests in a VM. The tests validate G2H, > > H2G, and loopback. T

Re: [PATCH net-next v3] selftests/vsock: add initial vmtest.sh for vsock

2025-04-30 Thread Bobby Eshleman
PS. sorry for weird formatting, writing from the gmail web UI instead of mutt. Tried to limit line lengths manually. Looks weird after hitting "send"... lol. Best, Bobby On Wed, Apr 30, 2025 at 7:37 PM Bobby Eshleman wrote: > > On Wed, Apr 30, 2025 at 6:06 AM Stefano Garz

Re: [PATCH net-next v3] selftests/vsock: add initial vmtest.sh for vsock

2025-04-30 Thread Bobby Eshleman
On Wed, Apr 30, 2025 at 6:06 AM Stefano Garzarella wrote: > > On Mon, Apr 28, 2025 at 04:48:11PM -0700, Bobby Eshleman wrote: > >This commit introduces a new vmtest.sh runner for vsock. > > > >It uses virtme-ng/qemu to run tests in a VM. The tests validate G2H, > >

[PATCH net-next v3] selftests/vsock: add initial vmtest.sh for vsock

2025-04-28 Thread Bobby Eshleman
(but isn't hooked into kselftest). This aspect is worth review, as I'm not aware of all of the enviroments where this would run. Signed-off-by: Bobby Eshleman --- Changes in v3: - use common conditional syntax for checking variables - use return value instead of global rc - fix typo TES

[PATCH net-next v2] selftests/vsock: add initial vmtest.sh for vsock

2025-04-17 Thread Bobby Eshleman
used. Only tested on x86. To run: $ tools/testing/selftests/vsock/vmtest.sh Future work can include vsock_diag_test. Signed-off-by: Bobby Eshleman --- Changes in v2: - add kernel oops and warnings checker - change testname variable to use FUNCNAME - fix spacing in test_vm_server_host_client

Re: [PATCH net-next] selftests/vsock: add initial vmtest.sh for vsock

2025-04-14 Thread Bobby Eshleman
On Fri, Apr 11, 2025 at 10:32:45AM +0200, Stefano Garzarella wrote: > On Thu, Apr 10, 2025 at 06:07:59PM -0700, Bobby Eshleman wrote: > > This commit introduces a new vmtest.sh runner for vsock. > > > > It uses virtme-ng/qemu to run tests in a VM. The tests are designed to

[PATCH net-next] selftests/vsock: add initial vmtest.sh for vsock

2025-04-10 Thread Bobby Eshleman
: $ tools/testing/selftests/vsock/vmtest.sh Signed-off-by: Bobby Eshleman --- MAINTAINERS| 1 + tools/testing/selftests/vsock/.gitignore | 1 + tools/testing/selftests/vsock/config.vsock | 6 + tools/testing/selftests/vsock/vmtest.sh| 247