patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 2/3] devargs: make bus key parsing optional
       [not found] <20211005123012.264727-1-xuemingl@nvidia.com>
@ 2021-10-05 12:30 ` Xueming Li
       [not found] ` <20211005155435.279043-1-xuemingl@nvidia.com>
  1 sibling, 0 replies; 2+ messages in thread
From: Xueming Li @ 2021-10-05 12:30 UTC (permalink / raw)
  To: dev; +Cc: xuemingl, Thomas Monjalon, David Marchand, stable, Gaetan Rivet

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")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 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 691b5ea0180..f6fa3a5d6ce 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -85,11 +85,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) {
@@ -101,9 +100,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 e3786c6c02a..616cf77f229 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-stable] [PATCH v1 2/3] devargs: make bus key parsing optional
       [not found] ` <20211005155435.279043-1-xuemingl@nvidia.com>
@ 2021-10-05 15:54   ` Xueming Li
  0 siblings, 0 replies; 2+ messages in thread
From: Xueming Li @ 2021-10-05 15:54 UTC (permalink / raw)
  To: dev; +Cc: xuemingl, Thomas Monjalon, David Marchand, stable, Gaetan Rivet

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")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 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 691b5ea0180..f6fa3a5d6ce 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -85,11 +85,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) {
@@ -101,9 +100,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 e3786c6c02a..616cf77f229 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-05 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211005123012.264727-1-xuemingl@nvidia.com>
2021-10-05 12:30 ` [dpdk-stable] [PATCH 2/3] devargs: make bus key parsing optional Xueming Li
     [not found] ` <20211005155435.279043-1-xuemingl@nvidia.com>
2021-10-05 15:54   ` [dpdk-stable] [PATCH v1 " Xueming Li

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git