[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 09/40] ivshmem-test: Improve test cases /ivshmem/
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v3 09/40] ivshmem-test: Improve test cases /ivshmem/server-* |
Date: |
Tue, 15 Mar 2016 19:34:24 +0100 |
Document missing test: behavior with MSI-X present but not enabled.
For MSI-X, we test and clear the interrupt pending bit before testing
the interrupt. For INTx, we only clear. Change to test and clear for
consistency.
Test MSI-X vector 1 in addition to vector 0.
Improve comments.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
tests/ivshmem-test.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
index bbea8cd..7b6b957 100644
--- a/tests/ivshmem-test.c
+++ b/tests/ivshmem-test.c
@@ -339,18 +339,21 @@ static void test_ivshmem_server(bool msi)
vm2 = in_reg(s2, IVPOSITION);
g_assert_cmpuint(vm1, !=, vm2);
+ /* check number of MSI-X vectors */
global_qtest = s1->qtest;
if (msi) {
ret = qpci_msix_table_size(s1->dev);
g_assert_cmpuint(ret, ==, nvectors);
}
- /* ping vm2 -> vm1 */
+ /* TODO test behavior before MSI-X is enabled */
+
+ /* ping vm2 -> vm1 on vector 0 */
if (msi) {
ret = qpci_msix_pending(s1->dev, 0);
g_assert_cmpuint(ret, ==, 0);
} else {
- out_reg(s1, INTRSTATUS, 0);
+ g_assert_cmpuint(in_reg(s1, INTRSTATUS), ==, 0);
}
out_reg(s2, DOORBELL, vm1 << 16);
do {
@@ -359,18 +362,18 @@ static void test_ivshmem_server(bool msi)
} while (ret == 0 && g_get_monotonic_time() < end_time);
g_assert_cmpuint(ret, !=, 0);
- /* ping vm1 -> vm2 */
+ /* ping vm1 -> vm2 on vector 1 */
global_qtest = s2->qtest;
if (msi) {
- ret = qpci_msix_pending(s2->dev, 0);
+ ret = qpci_msix_pending(s2->dev, 1);
g_assert_cmpuint(ret, ==, 0);
} else {
- out_reg(s2, INTRSTATUS, 0);
+ g_assert_cmpuint(in_reg(s2, INTRSTATUS), ==, 0);
}
- out_reg(s1, DOORBELL, vm2 << 16);
+ out_reg(s1, DOORBELL, vm2 << 16 | 1);
do {
g_usleep(10000);
- ret = msi ? qpci_msix_pending(s2->dev, 0) : in_reg(s2, INTRSTATUS);
+ ret = msi ? qpci_msix_pending(s2->dev, 1) : in_reg(s2, INTRSTATUS);
} while (ret == 0 && g_get_monotonic_time() < end_time);
g_assert_cmpuint(ret, !=, 0);
--
2.4.3
- [Qemu-devel] [PATCH v3 04/40] qemu-doc: Fix ivshmem huge page example, (continued)
- [Qemu-devel] [PATCH v3 04/40] qemu-doc: Fix ivshmem huge page example, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 02/40] ivshmem-server: Fix and clean up command line help, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 14/40] ivshmem: Drop ivshmem_event() stub, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 08/40] ivshmem-test: Clean up wait for devices to become operational, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 07/40] ivshmem-test: Improve test case /ivshmem/single, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 24/40] ivshmem: Plug leaks on unplug, fix peer disconnect, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 19/40] ivshmem: Clean up MSI-X conditions, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 06/40] tests/libqos/pci-pc: Fix qpci_pc_iomap() to map BARs aligned, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 12/40] ivshmem: Compile debug prints unconditionally to prevent bit-rot, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 09/40] ivshmem-test: Improve test cases /ivshmem/server-*,
Markus Armbruster <=
- [Qemu-devel] [PATCH v3 03/40] ivshmem-server: Don't overload POSIX shmem and file name, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 13/40] ivshmem: Clean up after commit 9940c32, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 17/40] ivshmem: Failed realize() can leave migration blocker behind, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 20/40] ivshmem: Leave INTx alone when using MSI-X, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 25/40] ivshmem: Receive shared memory synchronously in realize(), Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 18/40] ivshmem: Clean up register callbacks, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 11/40] ivshmem: Add missing newlines to debug printfs, Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 23/40] ivshmem: Disentangle ivshmem_read(), Markus Armbruster, 2016/03/15
- [Qemu-devel] [PATCH v3 22/40] ivshmem: Simplify rejection of invalid peer ID from server, Markus Armbruster, 2016/03/15