All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: maxime.coquelin@redhat.com, Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>
Subject: [dpdk-dev] [PATCH v3 2/2] net/virtio: do not require IO permissions
Date: Tue, 22 Oct 2019 10:21:43 +0200	[thread overview]
Message-ID: <1571732503-30424-3-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1571732503-30424-1-git-send-email-david.marchand@redhat.com>

On x86, iopl permissions are only available to root user (or users that
have the CAP_SYS_RAWIO capability).
But those permissions are only needed when the virtio devices accesses
are done with inb/outb instructions, which is when the device is bound
to a UIO kernel module.

So far, the virtio driver was refusing to register based on the check
on IO permissions.
This check does not make sense when binding the device to vfio.

Now that the check on IO permissions has been abstracted in the ioport
API, we can remove it on virtio side.

We still need to call rte_eal_iopl_init() in the virtio constructor so
that the interrupt thread inherits this permission in the case it could
be used with UIO later.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
Changelog since v1:
- remove log message in constructor (thanks Tiwei),
- reword commit log,

---
 drivers/net/virtio/virtio_ethdev.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 7261109..0a2ed2e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1995,11 +1995,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;
-- 
1.8.3.1


  parent reply	other threads:[~2019-10-22  8:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 11:56 [dpdk-dev] [PATCH 0/2] Using virtio ethdev ports as non-root David Marchand
2019-10-17 11:56 ` [dpdk-dev] [PATCH 1/2] bus/pci: check IO permissions for UIO only David Marchand
2019-10-17 11:56 ` [dpdk-dev] [PATCH 2/2] net/virtio: do not require IO permissions David Marchand
2019-10-18  8:16   ` Tiwei Bie
2019-10-18  8:33     ` David Marchand
2019-10-18 10:05       ` Tiwei Bie
2019-10-20 12:29 ` [dpdk-dev] [PATCH v2 0/2] Using virtio ethdev ports as non-root David Marchand
2019-10-20 12:29   ` [dpdk-dev] [PATCH v2 1/2] bus/pci: check IO permissions for UIO only David Marchand
2019-10-20 12:29   ` [dpdk-dev] [PATCH v2 2/2] net/virtio: do not require IO permissions David Marchand
2019-10-21 13:10   ` [dpdk-dev] [PATCH v2 0/2] Using virtio ethdev ports as non-root Maxime Coquelin
2019-10-22  8:21 ` [dpdk-dev] [PATCH v3 " David Marchand
2019-10-22  8:21   ` [dpdk-dev] [PATCH v3 1/2] bus/pci: check IO permissions for UIO only David Marchand
2019-10-24  9:55     ` Maxime Coquelin
2019-10-22  8:21   ` David Marchand [this message]
2019-10-23  4:56     ` [dpdk-dev] [PATCH v3 2/2] net/virtio: do not require IO permissions Tiwei Bie
2019-10-25 10:11   ` [dpdk-dev] [PATCH v3 0/2] Using virtio ethdev ports as non-root 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=1571732503-30424-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.