From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
Tiwei Bie <tiwei.bie@intel.com>,
Zhihong Wang <zhihong.wang@intel.com>
Subject: [dpdk-dev] [RFC PATCH 2/2] net/virtio: do not require IO permissions
Date: Fri, 6 Sep 2019 11:58:29 +0200 [thread overview]
Message-ID: <1567763909-307-3-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1567763909-307-1-git-send-email-david.marchand@redhat.com>
On x86, iopl permissions are only needed when the virtio devices are
bound to a uio kernel module.
When running a dpdk application as non root, the virtio driver was
refusing to register because of this check while it could work when
binding the device to vfio (requires to have a vIOMMU configured).
We still need to call rte_eal_iopl_init() in the constructor so that
the interrupt thread would inherit this permission in the case it could
be used with UIO later.
Log a warning message for the user to understand what is wrong.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/virtio/virtio_ethdev.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index f96588b..ebbd561 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1977,11 +1977,6 @@ exit:
static int eth_virtio_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
{
- if (rte_eal_iopl_init() != 0) {
- PMD_INIT_LOG(ERR, "IOPL call failed - cannot use virtio PMD");
- return 1;
- }
-
/* virtio pmd skips probe if device needs to work in vdpa mode */
if (vdpa_mode_selected(pci_dev->device.devargs))
return 1;
@@ -2013,7 +2008,8 @@ static struct rte_pci_driver rte_virtio_pmd = {
RTE_INIT(rte_virtio_pmd_init)
{
- rte_eal_iopl_init();
+ if (rte_eal_iopl_init() != 0)
+ PMD_INIT_LOG(WARNING, "IOPL call failed - virtio devices won't be functional if bound to UIO drivers");
rte_pci_register(&rte_virtio_pmd);
}
--
1.8.3.1
prev parent reply other threads:[~2019-09-06 9:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 9:58 [dpdk-dev] [RFC PATCH 0/2] Using virtio ethdev ports as non-root David Marchand
2019-09-06 9:58 ` [dpdk-dev] [RFC PATCH 1/2] bus/pci: check IO permissions for UIO only David Marchand
2019-09-06 9:58 ` David Marchand [this message]
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=1567763909-307-3-git-send-email-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=tiwei.bie@intel.com \
--cc=zhihong.wang@intel.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).