From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net
Subject: [PATCH] bus/pci: enhance driver pointer documentation
Date: Tue, 1 Mar 2022 11:53:54 +0100 [thread overview]
Message-ID: <20220301105354.13323-1-david.marchand@redhat.com> (raw)
Setting driver pointer before mapping required for write combining
support since commit 4a928ef9f611 ("bus/pci: enable write combining
during mapping").
Move comments that got separated after different changes.
Also change the condition relying on dev->driver itself.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/bus/pci/pci_common.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index def372b67e..37ab879779 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -207,11 +207,6 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
RTE_LOG(DEBUG, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->driver.name);
- /*
- * reference driver structure
- * This needs to be before rte_pci_map_device(), as it enables to use
- * driver flags for adjusting configuration.
- */
if (!already_probed) {
enum rte_iova_mode dev_iova_mode;
enum rte_iova_mode iova_mode;
@@ -247,9 +242,13 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
return -ENOMEM;
}
+ /*
+ * Reference driver structure.
+ * This needs to be before rte_pci_map_device(), as it enables
+ * to use driver flags for adjusting configuration.
+ */
dev->driver = dr;
-
- if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
+ if (dev->driver->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
ret = rte_pci_map_device(dev);
if (ret != 0) {
dev->driver = NULL;
--
2.23.0
next reply other threads:[~2022-03-01 10:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 10:53 David Marchand [this message]
2022-03-07 16:51 ` 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=20220301105354.13323-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--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).