qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] qtest/migration/rdma: Add test for rdma migration wit


From: Peter Xu
Subject: Re: [PATCH v2 2/2] qtest/migration/rdma: Add test for rdma migration with ipv6
Date: Fri, 9 May 2025 11:32:54 -0400

On Fri, May 09, 2025 at 09:42:11AM +0800, Li Zhijian wrote:
> Recently, we removed ipv6 restriction[0] from RDMA migration, add a
> test for it.
> 
> [0] 
> https://lore.kernel.org/qemu-devel/20250326095224.9918-1-jinpu.wang@ionos.com/
> 
> Cc: Jack Wang <jinpu.wang@ionos.com>
> Cc: Michael R. Galaxy <mrgalaxy@nvidia.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Yu Zhang <yu.zhang@ionos.com>
> Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> 
> V2:
>   - Collect Reviewed-by
>   - quoate the whole string to adapt to the newer bash # Fedora40+
> ---
>  scripts/rdma-migration-helper.sh      | 26 +++++++++++++++++++++++---
>  tests/qtest/migration/precopy-tests.c | 21 +++++++++++++++++----
>  2 files changed, 40 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/rdma-migration-helper.sh 
> b/scripts/rdma-migration-helper.sh
> index a39f2fb0e5..9fb7a12274 100755
> --- a/scripts/rdma-migration-helper.sh
> +++ b/scripts/rdma-migration-helper.sh
> @@ -8,6 +8,15 @@ get_ipv4_addr()
>          head -1 | tr -d '\n'
>  }
>  
> +get_ipv6_addr() {
> +    ipv6=$(ip -6 -o addr show dev "$1" |
> +        sed -n 's/.*[[:blank:]]inet6[[:blank:]]*\([^[:blank:]/]*\).*/\1/p' |
> +        head -1 | tr -d '\n')
> +
> +    [ $? -eq 0 ] || return
> +    echo -n "[$ipv6%$1]"
> +}
> +
>  # existing rdma interfaces
>  rdma_interfaces()
>  {
> @@ -20,11 +29,16 @@ ipv4_interfaces()
>      ip -o addr show | awk '/inet / {print $2}' | grep -v -w lo
>  }
>  
> +ipv6_interfaces()
> +{
> +    ip -o addr show | awk '/inet6 / {print $2}' | sort -u | grep -v -w lo
> +}
> +
>  rdma_rxe_detect()
>  {
>      for r in $(rdma_interfaces)
>      do
> -        ipv4_interfaces | grep -qw $r && get_ipv4_addr $r && return
> +        "$IP_FAMILY"_interfaces | grep -qw $r && get_"$IP_FAMILY"_addr $r && 
> return
>      done
>  
>      return 1
> @@ -32,11 +46,11 @@ rdma_rxe_detect()
>  
>  rdma_rxe_setup()
>  {
> -    for i in $(ipv4_interfaces)
> +    for i in $("$IP_FAMILY"_interfaces)
>      do
>          rdma_interfaces | grep -qw $i && continue
>          rdma link add "${i}_rxe" type rxe netdev "$i" && {
> -            echo "Setup new rdma/rxe ${i}_rxe for $i with $(get_ipv4_addr 
> $i)"
> +            echo "Setup new rdma/rxe ${i}_rxe for $i with 
> $(get_"$IP_FAMILY"_addr $i)"
>              return
>          }
>      done
> @@ -50,6 +64,12 @@ rdma_rxe_clean()
>      modprobe -r rdma_rxe
>  }
>  
> +IP_FAMILY=${IP_FAMILY:-ipv4}

Does this mean I'll need to setup twice, one for each v?

Even if so, I did this:

===8<===
$ sudo ../scripts/rdma-migration-helper.sh setup
Setup new rdma/rxe wlp0s20f3_rxe for wlp0s20f3 with 192.168.68.123
$ sudo IP_FAMILY=ipv6 ../scripts/rdma-migration-helper.sh setup
Setup new rdma/rxe tun0_rxe for tun0 with [fd10:22:88:1::110c%tun0]
$ rdma link
link wlp0s20f3_rxe/1 state ACTIVE physical_state LINK_UP netdev wlp0s20f3
link tun0_rxe/1 state ACTIVE physical_state LINK_UP netdev tun0
===8<===

And it still fails..

===8<===
$ sudo QTEST_QEMU_BINARY=./qemu-system-x86_64 ./tests/qtest/migration-test -p 
/x86_64/migration/precopy/rdma/plain
TAP version 14
# random seed: R02S778a51bb3555664ae9449bf4fb9e3730
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-286985.sock 
-qtest-log /dev/null -chardev socket,path=/tmp/qtest-286985.qmp,id=char0 -mon 
chardev=char0,mode=control -display none -audio none -machine none -accel qtest
# Start of x86_64 tests
# Start of migration tests
# Start of precopy tests
# Start of rdma tests
# Running /x86_64/migration/precopy/rdma/plain
# Using machine type: pc-q35-10.1
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-286985.sock 
-qtest-log /dev/null -chardev socket,path=/tmp/qtest-286985.qmp,id=char0 -mon 
chardev=char0,mode=control -display none -audio none -accel kvm -accel tcg 
-machine pc-q35-10.1, -name source,debug-threads=on -m 150M  -serial 
file:/tmp/migration-test-QEB452/src_serial -drive 
if=none,id=d0,file=/tmp/migration-test-QEB452/bootsect,format=raw -device 
ide-hd,drive=d0,secs=1,cyls=1,heads=1    -accel qtest
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-286985.sock 
-qtest-log /dev/null -chardev socket,path=/tmp/qtest-286985.qmp,id=char0 -mon 
chardev=char0,mode=control -display none -audio none -accel kvm -accel tcg 
-machine pc-q35-10.1, -name target,debug-threads=on -m 150M  -serial 
file:/tmp/migration-test-QEB452/dest_serial -incoming rdma:192.168.68.123:29200 
 -drive if=none,id=d0,file=/tmp/migration-test-QEB452/bootsect,format=raw 
-device ide-hd,drive=d0,secs=1,cyls=1,heads=1    -accel qtest
ok 1 /x86_64/migration/precopy/rdma/plain
# slow test /x86_64/migration/precopy/rdma/plain executed in 1.46 secs
# Start of plain tests
# Running /x86_64/migration/precopy/rdma/plain/ipv6
# Using machine type: pc-q35-10.1
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-286985.sock 
-qtest-log /dev/null -chardev socket,path=/tmp/qtest-286985.qmp,id=char0 -mon 
chardev=char0,mode=control -display none -audio none -accel kvm -accel tcg 
-machine pc-q35-10.1, -name source,debug-threads=on -m 150M  -serial 
file:/tmp/migration-test-QEB452/src_serial -drive 
if=none,id=d0,file=/tmp/migration-test-QEB452/bootsect,format=raw -device 
ide-hd,drive=d0,secs=1,cyls=1,heads=1    -accel qtest
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-286985.sock 
-qtest-log /dev/null -chardev socket,path=/tmp/qtest-286985.qmp,id=char0 -mon 
chardev=char0,mode=control -display none -audio none -accel kvm -accel tcg 
-machine pc-q35-10.1, -name target,debug-threads=on -m 150M  -serial 
file:/tmp/migration-test-QEB452/dest_serial -incoming 
rdma:[fdd3:4fdc:97c9:ca4e:2837:28dd:1ec4:6b5a%wlp0s20f3]:29200  -drive 
if=none,id=d0,file=/tmp/migration-test-QEB452/bootsect,format=raw -device 
ide-hd,drive=d0,secs=1,cyls=1,heads=1    -accel qtest
qemu-system-x86_64: -incoming 
rdma:[fdd3:4fdc:97c9:ca4e:2837:28dd:1ec4:6b5a%wlp0s20f3]:29200: RDMA ERROR: 
could not rdma_getaddrinfo address 
fdd3:4fdc:97c9:ca4e:2837:28dd:1ec4:6b5a%wlp0s20f3
Broken pipe
../tests/qtest/libqtest.c:199: kill_qemu() tried to terminate QEMU process but 
encountered exit status 1 (expected 0)
Aborted
===8<===

It would be great if the setup only needs to be run once, setting up
whatever ipv* supported, then in the test run kickoff whatever ipv* is
supported and detected.

Would it be possible?

Thanks,

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]