From c9afbb3ab2d887d8e8cbf80c6bcf67611e09cb5c Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Sat, 28 Mar 2020 06:56:06 +0800 Subject: [PATCH] pci_ut: Add the simple bdf parse test. Make sure that we can parse domain with 32 bit address. Signed-off-by: Ziye Yang Change-Id: I83ca08d5156c58b97e96b3884b5c6d6afcd1969a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1536 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- test/env/pci/pci_ut.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/env/pci/pci_ut.c b/test/env/pci/pci_ut.c index c2dfac3c9..ae2b78648 100644 --- a/test/env/pci/pci_ut.c +++ b/test/env/pci/pci_ut.c @@ -144,13 +144,16 @@ pci_hook_test(void) uint64_t bar0_paddr, bar0_size; int rc; - ut_dev.pci.addr.domain = 0x10000; - ut_dev.pci.addr.bus = 0x0; - ut_dev.pci.addr.dev = 0x1; - ut_dev.pci.addr.func = 0x0; ut_dev.pci.id.vendor_id = 0x4; ut_dev.pci.id.device_id = 0x8; + /* Use add parse for initilization */ + spdk_pci_addr_parse(&ut_dev.pci.addr, "10000:00:01.0"); + CU_ASSERT(ut_dev.pci.addr.domain == 0x10000); + CU_ASSERT(ut_dev.pci.addr.bus == 0x0); + CU_ASSERT(ut_dev.pci.addr.dev == 0x1); + CU_ASSERT(ut_dev.pci.addr.func == 0x0); + ut_dev.pci.map_bar = ut_map_bar; ut_dev.pci.unmap_bar = ut_unmap_bar; ut_dev.pci.cfg_read = ut_cfg_read;