From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] virtio: change io privilege level as early as possible
Date: Wed, 30 Sep 2015 10:26:47 -0700 [thread overview]
Message-ID: <20150930102647.5bfd9a12@urahara> (raw)
In-Reply-To: <2615920.hxcAs4lYm6@xps13>
On Wed, 30 Sep 2015 17:37:05 +0200
Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
> 2015-09-30 10:52, Neil Horman:
> > On Wed, Sep 30, 2015 at 10:28:53AM +0200, David Marchand wrote:
> > > On Tue, Sep 29, 2015 at 9:25 PM, Stephen Hemminger <
> > > stephen@networkplumber.org> wrote:
> > >
> > > > On Tue, 10 Mar 2015 09:14:28 -0400
> > > > Neil Horman <nhorman@tuxdriver.com> wrote:
> > > > > I don't see how this works for all cases. The constructor is called
> > > > once when
> > > > > the library is first loaded. What if you have multiple independent
> > > > (i.e. not
> > > > > forked children) processes that are using the dpdk in parallel? Only the
> > > > > process that triggered the library load will have io permissions set
> > > > > appropriately. I think what you need is to have every application that
> > > > expects
> > > > > to call through the transmit path or poll the receive path call iopl,
> > > > which I
> > > > > think speaks to having this requirement documented, so each application
> > > > can call
> > > > > iopl prior to calling fork/daemonize/etc.
> > > > >
> > > >
> > > > I am still seeing this problem with DPDK 2.0 and 2.1.
> > > > It seems to me that doing the iopl init in eal_init is the only safe way.
> > > > Other workaround is to have application calling iopl_init before eal_init
> > > > but that kind of violates the current method of all things being
> > > > initialized by eal_init
> > >
> > > Putting it in the virtio pmd constructor is my preferred solution and we
> > > don't need to pollute the eal for virtio (specific to x86, btw).
> >
> > Preferred solution or not, you can't just call iopl from the constructor,
> > because not all process will get appropriate permissions. It needs to be called
> > by every process. What Stephen is saying is that your solution has use cases
> > for which it doesn't work, and that needs to be solved.
>
> I think it may be solved by calling iopl in the constructor.
> We just need an extra call in rte_virtio_pmd_init() to detect iopl failures.
> We can also simply move rte_eal_intr_init() after rte_eal_dev_init().
> Please read my previous post on this topic:
> http://thread.gmane.org/gmane.comp.networking.dpdk.devel/14761/focus=22341
>
> About the multiprocess case, I don't see the problem as the RX/TX and interrupt
> threads are forked in the rte_eal_init() context which should call iopl even in
> secondary processes.
Another alternative is to use ioperm to give access to certain regions.
But ioperm does not inherit to other threads, therefore it required some code on
startup to execute the syscall on each EAL thread.
next prev parent reply other threads:[~2015-09-30 17:26 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 0:45 [dpdk-dev] [PATCH 0/2] virtio: bugfixes Stephen Hemminger
2015-03-06 0:45 ` [dpdk-dev] [PATCH 1/2] virtio: initialize iopl when device is initialized Stephen Hemminger
2015-03-06 3:41 ` Ouyang, Changchun
2015-03-06 16:20 ` Stephen Hemminger
2015-03-06 16:33 ` David Marchand
2015-03-06 16:55 ` Stephen Hemminger
2015-03-06 22:04 ` David Marchand
2015-03-06 23:43 ` Stephen Hemminger
2015-03-07 6:53 ` David Marchand
2015-03-09 11:05 ` David Marchand
2015-03-09 14:56 ` [dpdk-dev] [PATCH 0/2] fix virtio interrupt handling David Marchand
2015-03-09 14:56 ` [dpdk-dev] [PATCH 1/2] eal/linux: move plugin load to very start of eal init David Marchand
2015-03-09 15:21 ` Neil Horman
[not found] ` <CALwxeUs4hPbYDPBUfz9u2AoiCoj_wwTsAyj=_1xxzuT6LLW6nw@mail.gmail.com>
2015-03-10 10:55 ` Neil Horman
2015-10-14 0:05 ` Stephen Hemminger
2015-10-14 9:55 ` David Marchand
2015-03-09 14:56 ` [dpdk-dev] [PATCH 2/2] virtio: change io privilege level as early as possible David Marchand
2015-03-10 13:14 ` Neil Horman
2015-09-29 19:25 ` Stephen Hemminger
2015-09-30 8:28 ` David Marchand
2015-09-30 14:52 ` Neil Horman
2015-09-30 15:37 ` Thomas Monjalon
2015-09-30 17:26 ` Stephen Hemminger [this message]
2015-10-01 11:25 ` Neil Horman
2015-10-12 20:08 ` Stephen Hemminger
2015-10-14 0:07 ` Stephen Hemminger
2015-10-14 8:00 ` David Marchand
2015-10-14 9:49 ` David Marchand
2015-10-14 9:50 ` [dpdk-dev] [PATCH] eal: move interrupt init after device init David Marchand
2015-10-14 11:32 ` David Marchand
2015-10-20 21:22 ` Thomas Monjalon
2015-07-29 17:26 ` [dpdk-dev] [PATCH 1/2] virtio: initialize iopl when device is initialized Thomas Monjalon
2015-03-06 0:45 ` [dpdk-dev] [PATCH 2/2] virtio: allow running w/o vlan filtering Stephen Hemminger
2015-03-06 3:39 ` Ouyang, Changchun
2015-03-06 16:24 ` Stephen Hemminger
2015-07-29 12:56 ` Thomas Monjalon
2015-07-30 1:23 ` Ouyang, Changchun
2015-08-04 12:51 ` Vincent JARDIN
2015-08-05 1:01 ` Ouyang, Changchun
2015-08-05 1:22 ` Stephen Hemminger
2015-08-05 10:49 ` Vincent JARDIN
2015-10-21 13:58 ` Thomas Monjalon
2017-02-15 8:38 ` 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=20150930102647.5bfd9a12@urahara \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.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).