DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: dev@dpdk.org, David Marchand <david.marchand@redhat.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Ian Stokes <ian.stokes@intel.com>,
	Kevin Traynor <ktraynor@redhat.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Ilya Maximets <i.maximets@samsung.com>
Subject: [dpdk-dev] [PATCH v3 2/2] net/virtio: avoid annoying IOPL call related errors
Date: Fri, 23 Nov 2018 18:39:20 +0300	[thread overview]
Message-ID: <20181123153920.12398-3-i.maximets@samsung.com> (raw)
In-Reply-To: <20181123153920.12398-1-i.maximets@samsung.com>

In case of running with not enough capabilities, i.e. running as
non-root user any application linked with DPDK prints the message
about IOPL call failure even if it was just called like
'./testpmd --help'. For example, this breaks most of the OVS unit
tests if it built with DPDK support.

Let's register the virtio driver unconditionally and print error
message while probing the device. Silent iopl() call left in the
constructor to have privileges as early as possible as it was before.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e1fe36a23..2ba66d291 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1760,6 +1760,11 @@ vdpa_mode_selected(struct rte_devargs *devargs)
 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;
@@ -1785,11 +1790,7 @@ static struct rte_pci_driver rte_virtio_pmd = {
 
 RTE_INIT(rte_virtio_pmd_init)
 {
-	if (rte_eal_iopl_init() != 0) {
-		PMD_INIT_LOG(ERR, "IOPL call failed - cannot use virtio PMD");
-		return;
-	}
-
+	rte_eal_iopl_init();
 	rte_pci_register(&rte_virtio_pmd);
 }
 
-- 
2.17.1

  parent reply	other threads:[~2018-11-23 15:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181123141748eucas1p132a221972a87ec82b50d4a6c83bd9646@eucas1p1.samsung.com>
2018-11-23 14:17 ` [dpdk-dev] [PATCH] " Ilya Maximets
     [not found]   ` <CGME20181123143625eucas1p1def3421fa13b5aec7204549932c75bb7@eucas1p1.samsung.com>
2018-11-23 14:36     ` [dpdk-dev] [PATCH v2] " Ilya Maximets
2018-11-23 15:02       ` David Marchand
     [not found]       ` <CGME20181123153936eucas1p13bfbe13fcda92de7760ac768fcab43c5@eucas1p1.samsung.com>
2018-11-23 15:39         ` [dpdk-dev] [PATCH v3 0/2] IOPL related fixes Ilya Maximets
     [not found]           ` <CGME20181123153947eucas1p169a2b7cec02b2edd7258aef11b1c1e2e@eucas1p1.samsung.com>
2018-11-23 15:39             ` [dpdk-dev] [PATCH v3 1/2] eal/bsd: fix possible IOPL fd leak Ilya Maximets
2018-11-23 17:32               ` Maxime Coquelin
     [not found]           ` <CGME20181123153951eucas1p1218331b7e51db8eae3073fa6a14f3bcd@eucas1p1.samsung.com>
2018-11-23 15:39             ` Ilya Maximets [this message]
2018-11-23 17:34               ` [dpdk-dev] [PATCH v3 2/2] net/virtio: avoid annoying IOPL call related errors Maxime Coquelin
2018-11-23 15:41           ` [dpdk-dev] [PATCH v3 0/2] IOPL related fixes Maxime Coquelin
2018-11-23 15:53             ` Ilya Maximets
2018-11-23 16:25               ` Maxime Coquelin
2018-11-23 20:07                 ` Kevin Traynor
2018-11-23 22:29                   ` Thomas Monjalon
2018-11-25 10:42                     ` Thomas Monjalon
2018-11-26  9:49                       ` Kevin Traynor
2018-11-27 14:05                       ` David Marchand
2018-11-23 17:15       ` [dpdk-dev] [PATCH v2] net/virtio: avoid annoying IOPL call related errors Timothy Redaelli

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=20181123153920.12398-3-i.maximets@samsung.com \
    --to=i.maximets@samsung.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=ian.stokes@intel.com \
    --cc=ktraynor@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=thomas@monjalon.net \
    --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).