[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] tests/qtest/vhost-user-blk-test: Setup MSIx to avoid error o
From: |
Eric Auger |
Subject: |
[PATCH 4/6] tests/qtest/vhost-user-blk-test: Setup MSIx to avoid error on aarch64 |
Date: |
Mon, 10 Jan 2022 22:19:13 +0100 |
When run on ARM, basic and indirect tests currently fail with the
following error:
ERROR:../tests/qtest/libqos/virtio.c:224:qvirtio_wait_used_elem:
assertion failed (got_desc_idx == desc_idx): (50331648 == 0)
Bail out! ERROR:../tests/qtest/libqos/virtio.c:224: qvirtio_wait_used_elem:
assertion failed (got_desc_idx == desc_idx): (50331648 == 0)
Setting up and enabling MSIX fixes the issue.
Also remove the useless libqos/libqos-pc.h header inclusion.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
tests/qtest/vhost-user-blk-test.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/vhost-user-blk-test.c
b/tests/qtest/vhost-user-blk-test.c
index cea2570884b..2024aa5923e 100644
--- a/tests/qtest/vhost-user-blk-test.c
+++ b/tests/qtest/vhost-user-blk-test.c
@@ -19,7 +19,6 @@
#include "standard-headers/linux/virtio_pci.h"
#include "libqos/qgraph.h"
#include "libqos/vhost-user-blk.h"
-#include "libqos/libqos-pc.h"
#define TEST_IMAGE_SIZE (64 * 1024 * 1024)
#define QVIRTIO_BLK_TIMEOUT_US (30 * 1000 * 1000)
@@ -224,6 +223,10 @@ static QVirtQueue *test_basic(QVirtioDevice *dev,
QGuestAllocator *alloc)
char *data;
QTestState *qts = global_qtest;
QVirtQueue *vq;
+ QVirtioPCIDevice *vpcidev = container_of(dev, QVirtioPCIDevice, vdev);
+
+ qpci_msix_enable(vpcidev->pdev);
+ qvirtio_pci_set_msix_configuration_vector(vpcidev, alloc, 0);
features = qvirtio_get_features(dev);
features = features & ~(QVIRTIO_F_BAD_FEATURE |
@@ -236,9 +239,12 @@ static QVirtQueue *test_basic(QVirtioDevice *dev,
QGuestAllocator *alloc)
g_assert_cmpint(capacity, ==, TEST_IMAGE_SIZE / 512);
vq = qvirtqueue_setup(dev, alloc, 0);
+ qvirtqueue_pci_msix_setup(vpcidev, (QVirtQueuePCI *)vq, alloc, 1);
qvirtio_set_driver_ok(dev);
+ qvirtio_wait_queue_isr(qts, dev, vq, QVIRTIO_BLK_TIMEOUT_US);
+
/* Write and read with 3 descriptor layout */
/* Write request */
req.type = VIRTIO_BLK_T_OUT;
@@ -468,6 +474,10 @@ static void indirect(void *obj, void *u_data,
QGuestAllocator *t_alloc)
uint8_t status;
char *data;
QTestState *qts = global_qtest;
+ QVirtioPCIDevice *vpcidev = container_of(dev, QVirtioPCIDevice, vdev);
+
+ qpci_msix_enable(vpcidev->pdev);
+ qvirtio_pci_set_msix_configuration_vector(vpcidev, t_alloc, 0);
features = qvirtio_get_features(dev);
g_assert_cmphex(features & (1u << VIRTIO_RING_F_INDIRECT_DESC), !=, 0);
@@ -480,8 +490,12 @@ static void indirect(void *obj, void *u_data,
QGuestAllocator *t_alloc)
g_assert_cmpint(capacity, ==, TEST_IMAGE_SIZE / 512);
vq = qvirtqueue_setup(dev, t_alloc, 0);
+ qvirtqueue_pci_msix_setup(vpcidev, (QVirtQueuePCI *)vq, t_alloc, 1);
+
qvirtio_set_driver_ok(dev);
+ qvirtio_wait_queue_isr(qts, dev, vq, QVIRTIO_BLK_TIMEOUT_US);
+
/* Write request */
req.type = VIRTIO_BLK_T_OUT;
req.ioprio = 1;
--
2.26.3
- [PATCH 0/6] qtests/libqos: Introduce pci-arm, Eric Auger, 2022/01/10
- [PATCH 1/6] tests/qtest/vhost-user-test.c: Use vhostforce=on, Eric Auger, 2022/01/10
- [PATCH 2/6] tests/qtest/libqos/pci: Introduce pio_limit, Eric Auger, 2022/01/10
- [PATCH 3/6] tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable, Eric Auger, 2022/01/10
- [PATCH 4/6] tests/qtest/vhost-user-blk-test: Setup MSIx to avoid error on aarch64,
Eric Auger <=
- [PATCH 6/6] tests/qtest/libqos: Add pci-arm and add a pci-arm producer in arm-virt machine, Eric Auger, 2022/01/10
- [PATCH 5/6] tests/qtest/vhost-user-blk-test: Factorize vq setup code, Eric Auger, 2022/01/10