From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 1A71D5A0082 for ; Fri, 24 Feb 2023 20:36:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677267415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9La6I3g2hLeQ+IePIs7u9HQa+NfojtWxPHvlJtJcxfY=; b=W8Fq+ZiiuUSyyM0BLdmVGy4Dw1C7NVfmK3pu9EQvDX8aumBpnKX/ds1YwBWfjOFyYxjW1D Vz67LaJnCDmLUNhaw/2UghyJvH4lrhgH4ewSR35bcI91WsrSeJCjQIo+fu9OqbG6safX2+ w+UjwuXgtY9Tqy/LV8bTawgeSp5tplw= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-649-ooL-t3vbOuK6FdWXF6Cj6Q-1; Fri, 24 Feb 2023 14:36:53 -0500 X-MC-Unique: ooL-t3vbOuK6FdWXF6Cj6Q-1 Received: by mail-pf1-f199.google.com with SMTP id t21-20020a056a00139500b005a8534314aeso36081pfg.17 for ; Fri, 24 Feb 2023 11:36:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:in-reply-to:mime-version:references:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9La6I3g2hLeQ+IePIs7u9HQa+NfojtWxPHvlJtJcxfY=; b=zKnD+Xq60f96HoqMw3y08TilYmhgxw2ww2/dxPqXuN+elWS1E3ZSEZF5qn+9WbOdjD 6fXxgOZCUkdogmYn3QYfzgBq5VC0+E0U/DY4zAVf5ssbK/Fnba6lB8w+S/N4Z9UaImJw ENghAbGUZN+WBJ4ielEM4dDuv7tpAFiT2dnFsB2IFqmuC7xZtE6wHno4n2EucHNlR2rc UeoGJHNhTSWkgUs39/7L7H2ZIZjXXjSFGGjMYBJLvaBt/5AjZbUvJrC164FMAbVVTYfV VjS6REAWc8ysbrdpLD5744bNDZ1sZmzm34/zE7eW1LtuX07eV+neGsO1fPh2iIQwndgS Jwtg== X-Gm-Message-State: AO0yUKX49+QK4RLD7e3Qb/a+KCEGNjqp+G+XEhM+fZ6cg/FoqMk5N/nb zH8ICRD1GAox/DNLiwUtCtEzFaHdGi6I1Ck/iezcxTB3q7/YwrSggwo01QH/o/qleftskaxg43q BF4ZqDUENB2/AGNt3fmvchxqyLZk64+MkLg== X-Received: by 2002:a17:902:a38d:b0:199:6fd:ecf6 with SMTP id x13-20020a170902a38d00b0019906fdecf6mr3288741pla.9.1677267412535; Fri, 24 Feb 2023 11:36:52 -0800 (PST) X-Google-Smtp-Source: AK7set8YjGdjaXUmAd5MDmRhQQHYSVxAqU64+CvyBQjKbRIPZRB1mb4U/TK0iqTJfkQDb/Oh5HgnD0Je7K3GhpJ/sPs= X-Received: by 2002:a17:902:a38d:b0:199:6fd:ecf6 with SMTP id x13-20020a170902a38d00b0019906fdecf6mr3288735pla.9.1677267412046; Fri, 24 Feb 2023 11:36:52 -0800 (PST) Received: from 744723338238 named unknown by gmailapi.google.com with HTTPREST; Fri, 24 Feb 2023 11:36:51 -0800 From: Andrea Bolognani References: <20230224184949.518615-1-abologna@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230224184949.518615-1-abologna@redhat.com> Date: Fri, 24 Feb 2023 11:36:51 -0800 Message-ID: Subject: Re: [PATCH 0/5] qrap: Fix a number of issues To: passt-dev@passt.top X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: NM4JK4WHGSKFHNACSAYNANOSHKCSWVYM X-Message-ID-Hash: NM4JK4WHGSKFHNACSAYNANOSHKCSWVYM X-MailFrom: abologna@redhat.com 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 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: On Fri, Feb 24, 2023 at 07:49:44PM +0100, Andrea Bolognani wrote: > Andrea Bolognani (5): > qrap: Fix limits for PCI addresses > qrap: Fix support for pc machines > qrap: Drop args in JSON format > qrap: Introduce machine-specific PCI address base > qrap: Generate -netdev as JSON > > qrap.c | 47 +++++++++++++++++++++++++++++++++++------------ > 1 file changed, 35 insertions(+), 12 deletions(-) Some information about testing. In order to convince myself that the changes I was working on were correct, I have created a few quick and dirty test scripts. You can find them here: https://gitlab.com/abologna/passt/-/commits/qrap-tests The commit contains a few YAML files: vmi-small-q35-passt.yaml # q35 VM with few devices vmi-small-pc-passt.yaml # pc VM with few devices vmi-big-q35-passt.yaml # q35 VM with many devices vmi-big-pc-passt.yaml # pc VM with many devices Each one of those, fed into KubeVirt, results in qrap being called with a bunch of command line arguments. These are normally passed to the actual QEMU binary, but in my case I've hacked qrap so that they're simply printed out. For each of the scenarios, there are three files: vm.in # arguments passed to qrap vm.exp # arguments generated by the current version of qrap vm.sh # test script Running vm.sh results in qrap being called with the same arguments contained in vm.in (but quoted for shell consumption), with the output collected into the temporary file vm.out. This file is then compared with both vm.in (to highlight changes made by qrap) and with vm.exp (to highlight changes in behavior compared to the current version of qrap). Running these tests before applying my patches should result in vm.out being identical to vm.ext whereas, after my patches have been applied, the following important changes will be visible: --- pc-small.exp 2023-02-24 20:11:14.559711296 +0100 +++ pc-small.out 2023-02-24 20:26:53.557307727 +0100 @@ -75,6 +75,6 @@ -msg timestamp=on -device -virtio-net-pci,bus=pci.0,addr=0x2,netdev=hostnet0,x-txburst=4096 +{"driver":"virtio-net-pci","bus":"pci.0","addr":"0x8","netdev":"hostnet0","x-txburst":4096} (addresses of other devices are now parsed correctly, so qrap's interface will be assigned to slot 8, which is available, instead of slot 2, which isn't) --- q35-big.exp 2023-02-24 20:11:14.560711288 +0100 +++ q35-big.out 2023-02-24 20:27:20.632094269 +0100 @@ -159,6 +159,6 @@ -msg timestamp=on -device -{"driver":"virtio-net-pci","bus":"pci.a","addr":"0x0","netdev":"hostnet0","x-txburst":4096} +{"driver":"virtio-net-pci","bus":"pci.15","addr":"0x0","netdev":"hostnet0","x-txburst":4096} (pci.15 is correctly identified as the bus where qrap's interface should be placed instead of the non-existing pci.a bus) --- pc-big.exp 2023-02-24 20:11:14.559711296 +0100 +++ pc-big.out 2023-02-24 20:27:37.124964240 +0100 @@ -129,6 +129,6 @@ -msg timestamp=on -device -virtio-net-pci,bus=pci.0,addr=0x2,netdev=hostnet0,x-txburst=4096 +{"driver":"virtio-net-pci","bus":"pci.0","addr":"0x11","netdev":"hostnet0","x-txburst":4096} (again, an available slot will be picked) Note how the q35-small test sees no differences. That's the one scenario that was already working, so the lack of changes there is a very good thing :) In addition to these crude test scripts, I've also made a custom RPM build of passt with these patches applied and integrated it into KubeVirt. Using it, I was able to successfully submit all the YAML files mentioned earlier and get working VMs, with functional network connection, as a result. I also ran the passt tests from KubeVirt's own functional test suite, and they all passed except for one. That one's about IPv6 connectivity, and I think the lack of IPv6 connectivity in my own machine / network is to blame for the failure. This specific test fails with the non-patched version of passt too, further validating this theory. -- Andrea Bolognani / Red Hat / Virtualization