DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vijay Srivastava <vijay.srivastava@xilinx.com>
To: <dev@dpdk.org>
Cc: <xuemingl@nvidia.com>, <andrew.rybchenko@oktetlabs.ru>,
	<praveenj@xilinx.com>, Vijay Srivastava <vsrivast@xilinx.com>
Subject: [dpdk-dev] [PATCH] eal: fix device iterator issue to find device for class type
Date: Fri, 29 Oct 2021 16:23:48 +0530	[thread overview]
Message-ID: <20211029105348.10885-1-vsrivast@xilinx.com> (raw)

devarg parser rte_devargs_layers_parse() does not configures
devargs->bus_str for class type. rte_dev_iterator_init is not
setting devargs->bus_str to NULL before passing it to devarg parser.
It results junk value for bus_str and due to this device
iterator is unable to find device for class type.

Bugzilla ID: 862
Fixes: 9a1a9e4a2ddd (devargs: support path value with global device syntax)

Signed-off-by: Vijay Srivastava <vsrivast@xilinx.com>
---
 lib/eal/common/eal_common_dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 148a238..4efdd8e 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -577,6 +577,8 @@ static int cmp_dev_name(const struct rte_device *dev, const void *_name)
 	struct rte_class *cls = NULL;
 	struct rte_bus *bus = NULL;
 
+	memset(&devargs, 0, sizeof(devargs));
+
 	/* Having both bus_str and cls_str NULL is illegal,
 	 * marking this iterator as invalid unless
 	 * everything goes well.
-- 
1.8.3.1


             reply	other threads:[~2021-10-29 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 10:53 Vijay Srivastava [this message]
2021-11-02  6:13 ` Xueming(Steven) Li
2021-11-04 10:33   ` David Marchand

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=20211029105348.10885-1-vsrivast@xilinx.com \
    --to=vijay.srivastava@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=praveenj@xilinx.com \
    --cc=vsrivast@xilinx.com \
    --cc=xuemingl@nvidia.com \
    /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).