From: Xueming Li <xuemingl@nvidia.com>
To: <dev@dpdk.org>, Gaetan Rivet <grive@u256.net>,
David Marchand <david.marchand@redhat.com>
Cc: <xuemingl@nvidia.com>, Thomas Monjalon <thomas@monjalon.net>,
"Lior Margalit" <lmargalit@nvidia.com>
Subject: [dpdk-dev] [PATCH v5 2/3] devargs: make bus key parsing optional
Date: Wed, 20 Oct 2021 23:47:38 +0800 [thread overview]
Message-ID: <20211020154739.2514499-3-xuemingl@nvidia.com> (raw)
In-Reply-To: <20211020154739.2514499-1-xuemingl@nvidia.com>
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 <xuemingl@nvidia.com>
Reviewed-by: Gaetan Rivet <grive@u256.net>
---
drivers/bus/pci/pci_params.c | 8 +++-----
lib/eal/common/eal_common_devargs.c | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 21c2e1d0368..60b424b8297 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=<id>' in: %s\n",
+ RTE_LOG(DEBUG, EAL, "No PCI address specified using '%s=<id>' 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 d673598032d..8c7650cf6c2 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;
}
--
2.33.0
next prev parent reply other threads:[~2021-10-20 15:48 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 12:30 [dpdk-dev] [PATCH 1/3] devargs: support path value for global device arguments Xueming Li
2021-10-05 12:30 ` [dpdk-dev] [PATCH 2/3] devargs: make bus key parsing optional Xueming Li
2021-10-05 12:30 ` [dpdk-dev] [PATCH 3/3] test/devargs: add devargs test cases Xueming Li
2021-10-05 14:01 ` David Marchand
2021-10-05 15:56 ` Xueming(Steven) Li
2021-10-05 15:54 ` [dpdk-dev] [PATCH v1 0/3] devargs: support path in global syntax Xueming Li
2021-10-05 15:54 ` [dpdk-dev] [PATCH v1 1/3] devargs: support path value for global device arguments Xueming Li
2021-10-19 14:57 ` Gaëtan Rivet
2021-10-05 15:54 ` [dpdk-dev] [PATCH v1 2/3] devargs: make bus key parsing optional Xueming Li
2021-10-19 15:19 ` Gaëtan Rivet
2021-10-05 15:54 ` [dpdk-dev] [PATCH v1 3/3] test/devargs: add devargs test cases Xueming Li
2021-10-19 15:07 ` Gaëtan Rivet
2021-10-20 7:20 ` Xueming(Steven) Li
2021-10-20 7:31 ` [dpdk-dev] [PATCH v2 0/3] devargs: support path in global syntax Xueming Li
2021-10-20 7:31 ` [dpdk-dev] [PATCH v2 1/3] devargs: support path value for global device arguments Xueming Li
2021-10-20 7:31 ` [dpdk-dev] [PATCH v2 2/3] devargs: make bus key parsing optional Xueming Li
2021-10-20 7:31 ` [dpdk-dev] [PATCH v2 3/3] test/devargs: add devargs test cases Xueming Li
2021-10-20 7:38 ` David Marchand
2021-10-20 8:23 ` Xueming(Steven) Li
2021-10-20 8:21 ` [dpdk-dev] [PATCH v3 0/3] devargs: support path in global syntax Xueming Li
2021-10-20 8:21 ` [dpdk-dev] [PATCH v3 1/3] devargs: support path value for global device arguments Xueming Li
2021-10-20 8:21 ` [dpdk-dev] [PATCH v3 2/3] devargs: make bus key parsing optional Xueming Li
2021-10-20 8:22 ` [dpdk-dev] [PATCH v3 3/3] test/devargs: add devargs test cases Xueming Li
2021-10-20 9:08 ` David Marchand
2021-10-20 9:40 ` Xueming(Steven) Li
2021-10-20 10:41 ` Bruce Richardson
2021-10-20 11:12 ` [dpdk-dev] [PATCH v4 0/3] devargs: support path in global syntax Xueming Li
2021-10-20 11:12 ` [dpdk-dev] [PATCH v4 1/3] devargs: support path value for global device arguments Xueming Li
2021-10-20 11:12 ` [dpdk-dev] [PATCH v4 2/3] devargs: make bus key parsing optional Xueming Li
2021-10-20 11:12 ` [dpdk-dev] [PATCH v4 3/3] test/devargs: add devargs test cases Xueming Li
2021-10-20 11:55 ` Gaëtan Rivet
2021-10-20 13:53 ` Xueming(Steven) Li
2021-10-20 14:22 ` Gaëtan Rivet
2021-10-20 14:34 ` Bruce Richardson
2021-10-20 15:47 ` [dpdk-dev] [PATCH v5 0/3] devargs: support path in global syntax Xueming Li
2021-10-20 15:47 ` [dpdk-dev] [PATCH v5 1/3] devargs: support path value for global device arguments Xueming Li
2021-10-20 15:47 ` Xueming Li [this message]
2021-10-20 15:47 ` [dpdk-dev] [PATCH v5 3/3] test/devargs: add devargs test cases Xueming Li
2021-10-21 9:03 ` Gaëtan Rivet
2021-10-23 6:17 ` David Marchand
2021-10-23 12:20 ` Xueming(Steven) Li
2021-10-21 9:22 ` [dpdk-dev] [PATCH v5 0/3] devargs: support path in global syntax David Marchand
2021-10-21 10:43 ` Xueming(Steven) Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211020154739.2514499-3-xuemingl@nvidia.com \
--to=xuemingl@nvidia.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=grive@u256.net \
--cc=lmargalit@nvidia.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).