From 0ccf4a9ce6b81d9c6de89b0cdd012497858f47dd Mon Sep 17 00:00:00 2001 From: Jin Yu Date: Tue, 30 Mar 2021 23:49:39 +0800 Subject: [PATCH] env_pci: fix device_allow small issue The dbdf format is xxxx:xx:xx.x and with the wrong format the rte_devargs_parse always fails. Change-Id: Ia34bc5e68f6401bb25907d5d07c65636b4f491b5 Signed-off-by: Jin Yu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7140 Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu Community-CI: Mellanox Build Bot --- lib/env_dpdk/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index 6eabdb9172..9e67d0c8e0 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -1092,7 +1092,7 @@ spdk_pci_device_allow(struct spdk_pci_addr *pci_addr) return -ENOMEM; } - snprintf(devargs_str, sizeof(devargs_str), "pci:%04x:%02x:%02x:%x", + snprintf(devargs_str, sizeof(devargs_str), "pci:%04x:%02x:%02x.%x", pci_addr->domain, pci_addr->bus, pci_addr->dev, pci_addr->func); if (rte_devargs_parse(da, devargs_str) != 0) { SPDK_ERRLOG("rte_devargs_parse() failed on '%s'\n", devargs_str);