From: Xueming Li Date: Wed, 20 Oct 2021 15:47:38 +0000 (+0800) Subject: devargs: make bus optional X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5adef306daccf741a0467015c5565f861b1da25b;p=dpdk.git devargs: make bus optional Global devargs syntax is used as device iteration filter like "class=vdpa", a devargs without bus args is valid from parsing perspective. This patch makes bus args optional. Fixes: d2a66ad79480 ("bus: add device arguments name parsing") Signed-off-by: Xueming Li Reviewed-by: Gaetan Rivet --- diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c index 21c2e1d036..60b424b829 100644 --- a/drivers/bus/pci/pci_params.c +++ b/drivers/bus/pci/pci_params.c @@ -87,11 +87,10 @@ rte_pci_devargs_parse(struct rte_devargs *da) struct rte_kvargs *kvargs; const char *addr_str; struct rte_pci_addr addr; - int ret; + int ret = 0; - if (da == NULL) + if (da == NULL || da->bus_str == NULL) return 0; - RTE_ASSERT(da->bus_str != NULL); kvargs = rte_kvargs_parse(da->bus_str, NULL); if (kvargs == NULL) { @@ -103,9 +102,8 @@ rte_pci_devargs_parse(struct rte_devargs *da) addr_str = rte_kvargs_get(kvargs, pci_params_keys[RTE_PCI_PARAM_ADDR]); if (addr_str == NULL) { - RTE_LOG(ERR, EAL, "No PCI address specified using '%s=' in: %s\n", + RTE_LOG(DEBUG, EAL, "No PCI address specified using '%s=' in: %s\n", pci_params_keys[RTE_PCI_PARAM_ADDR], da->bus_str); - ret = -ENODEV; goto out; } diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c index d673598032..8c7650cf6c 100644 --- a/lib/eal/common/eal_common_devargs.c +++ b/lib/eal/common/eal_common_devargs.c @@ -39,7 +39,7 @@ devargs_bus_parse_default(struct rte_devargs *devargs, /* Parse devargs name from bus key-value list. */ name = rte_kvargs_get(bus_args, "name"); if (name == NULL) { - RTE_LOG(INFO, EAL, "devargs name not found: %s\n", + RTE_LOG(DEBUG, EAL, "devargs name not found: %s\n", devargs->data); return 0; }