DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: thomas.monjalon@6wind.com
Cc: dev@dpdk.org, benjamin.walker@intel.com
Subject: [dpdk-dev] [PATCH] pci: do not mark device as taken when probe fails
Date: Mon,  7 Nov 2016 10:03:29 +0100	[thread overview]
Message-ID: <1478509409-25508-1-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <CALwxeUtOT1TCaevHwx8kSdEqHd4b5VO1ER2n0Xym94mWvObm_Q@mail.gmail.com>

dev->driver should be set only if a driver did take the device.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 lib/librte_eal/common/eal_common_pci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 971ad20..6163b09 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -214,7 +214,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
 		dev->driver = dr;
 
 		/* call the driver probe() function */
-		return dr->probe(dr, dev);
+		ret = dr->probe(dr, dev);
+		if (ret)
+			dev->driver = NULL;
+
+		return ret;
 	}
 	/* return positive value if driver doesn't support this device */
 	return 1;
-- 
2.7.4

  reply	other threads:[~2016-11-07  9:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 21:50 [dpdk-dev] [PATCH] pci: Don't call probe callback if driver already loaded Ben Walker
2016-10-27 13:28 ` David Marchand
2016-10-27 13:30   ` David Marchand
2016-11-02  9:29 ` Shreyansh Jain
2016-11-06 21:59 ` Thomas Monjalon
2016-11-07  9:02   ` David Marchand
2016-11-07  9:03     ` David Marchand [this message]
2016-11-07 13:42       ` [dpdk-dev] [PATCH] pci: do not mark device as taken when probe fails Thomas Monjalon

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=1478509409-25508-1-git-send-email-david.marchand@6wind.com \
    --to=david.marchand@6wind.com \
    --cc=benjamin.walker@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.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).