DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: i.maximets@samsung.com
Cc: dev@dpdk.org, maxime.coquelin@redhat.com, tiwei.bie@intel.com,
	 zhihong.wang@intel.com, thomas@monjalon.net,
	ferruh.yigit@intel.com,  ian.stokes@intel.com,
	Kevin Traynor <ktraynor@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/virtio: avoid annoying IOPL call related errors
Date: Fri, 23 Nov 2018 16:02:01 +0100	[thread overview]
Message-ID: <CAJFAV8wtNjBtrb6=OW9+psXC8Px40b8UfAFHJwojayOiyijpyw@mail.gmail.com> (raw)
In-Reply-To: <20181123143620.10480-1-i.maximets@samsung.com>

On Fri, Nov 23, 2018 at 3:36 PM Ilya Maximets <i.maximets@samsung.com>
wrote:

> 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 beaks most of the OVS unit
> tests if it built with DPDK support.
>

breaks


>
> 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.
>

Yes, that's the important part to avoid issues with the interrupt thread
which is spawned later and inherits the capa from the thread running
rte_eal_init, iirc.


> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
>

Reviewed-by: David Marchand <david.marchand@redhat.com>

I wonder if we could move the "new" iopl check even later when probing a
device since it only makes sense in legacy mode when using uio.
But this patch keeps previous behaviour.

diff --git a/lib/librte_eal/bsdapp/eal/eal.c
> b/lib/librte_eal/bsdapp/eal/eal.c
> index 508cbc46f..b8152a75c 100644
> --- a/lib/librte_eal/bsdapp/eal/eal.c
> +++ b/lib/librte_eal/bsdapp/eal/eal.c
> @@ -556,9 +556,11 @@ int rte_eal_has_hugepages(void)
>  int
>  rte_eal_iopl_init(void)
>  {
> -       static int fd;
> +       static int fd = -1;
> +
> +       if (fd < 0)
> +               fd = open("/dev/io", O_RDWR);
>
> -       fd = open("/dev/io", O_RDWR);
>         if (fd < 0)
>                 return -1;
>         /* keep fd open for iopl */
>

Good catch.
Should be a separate fix.


-- 
David Marchand

  reply	other threads:[~2018-11-23 15:02 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 [this message]
     [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             ` [dpdk-dev] [PATCH v3 2/2] net/virtio: avoid annoying IOPL call related errors Ilya Maximets
2018-11-23 17:34               ` 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='CAJFAV8wtNjBtrb6=OW9+psXC8Px40b8UfAFHJwojayOiyijpyw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=i.maximets@samsung.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).