DPDK usage discussions
 help / color / mirror / Atom feed
From: amit sehas <cun23@yahoo.com>
To: maxime.coquelin@redhat.com,
	Stephen Hemminger <stephen@networkplumber.org>
Cc: users@dpdk.org
Subject: Re: [dpdk-users] rte_virtio_pmd_init(): IOPL call failed - cannot use virtio PMD
Date: Fri, 3 Aug 2018 22:20:12 +0000 (UTC)	[thread overview]
Message-ID: <607910178.1827758.1533334812223@mail.yahoo.com> (raw)
In-Reply-To: <20180803142420.1198b64b@xeon-e3>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 7102 bytes --]

I tried my best to make iopl work but couldnt, i wrote a small 'c' program that does only iopl()  and even that does not work, neither on the host machine nor on the VM in docker ... i am wondering if this has anything to do with bios settings ...i tried it on different machines too ... root permissions, explicity setting capset ... etc .. i tried them all but still does not work ... quite frustrating how many hours i had to spent trying different things...

thanks
 

    On Friday, August 3, 2018, 2:24:28 PM PDT, Stephen Hemminger <stephen@networkplumber.org> wrote:  
 
 On Wed, 1 Aug 2018 16:27:49 +0000 (UTC)
amit sehas <cun23@yahoo.com> wrote:

> I am trying to run a dpdk application in docker and i get the above error ... the docker instance was run as below:
> 
> docker run -dit --name <name> -v /hostlibpath:/contlibpath:ro fedora:26 bash
> 
> i am new to dpdk, as a result i am quite lost as to where to look ...
> 
> thanks

Short answer virtio requires DPDK process to be run as root.

In order for the virtio device to signal the underlying host it may need the in/out instructions.
These CPU instructions are normally privileged (only allowed in kernel) but on Linux there is
is a system call to allow a process with root (really CAP_SYS_RAWIO) to do these from userspace.
See iopl manual page.

The actual answer is more complex. Older versions of virtio (legacy) use in/out but the
current version (modern) can use memory read/write.  Ideally, the DPDK virtio would only
ask for IOPL privilege if it needed it. The problem is that may need it during the negotiation
process. Someone should look into fixing this.
  
From stephen@networkplumber.org  Sat Aug  4 00:22:00 2018
Return-Path: <stephen@networkplumber.org>
Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com
 [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 90A581B5C4
 for <users@dpdk.org>; Sat,  4 Aug 2018 00:22:00 +0200 (CEST)
Received: by mail-pg1-f195.google.com with SMTP id r5-v6so3466911pgv.0
 for <users@dpdk.org>; Fri, 03 Aug 2018 15:22:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s 150623;
 hÚte:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=IzosJVJk8sWwKlKVQsTAYzj2g5D1wSpaDcg1w8wi2tQ=;
 b=LjmzFkAk4GqRMXcWb/smm3MdsKAaLu0Q9hWj16wTAezFqMYd6UbcuGyqlG4btYMQ48
 8saFkqr7M3p2l/H4/kliKuccJuo2a/m8Kfc86qkZPtUfC9LD6XGtNEyy+hzjaWwHCMtJ
 QWqWPkDAGIsFzsOve7RBilaVPqetu2d6BgHTJrJCOt0n4azdpujKR4Dc/b4rWvYKz6kS
 XZXOLzm0eOjmCwQrZVcQo5lz6oSqUreTSnZ6GEFfXfhcjr6MsAs6tQlTUm1IHPY+c+TV
 ld0iUtGpx86qhiloDIZjxCWb5PLX99bSB5sffoyTVBYfg9iSvUihgiMaE11zJW/uu9St
 xgyQ=X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d\x1e100.net; s 161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=IzosJVJk8sWwKlKVQsTAYzj2g5D1wSpaDcg1w8wi2tQ=;
 b=gRuTD9mG1cuF0rY4C8DMYbVRSteXn7TjuY+AQoUXA18OXRLI3zHuR7wtt0PPXEqXhy
 GC9ty/E282rv3CozwdlZ9XH8bW8at64MfTEN0o6PVHy7LTt4dHj0gzwZ6I+ycFjmXEJW
 /8ZSq+ERE5FiuimPor3r+9MqeR6rFAiqYJTUH7ESYyLOwYrblW0a+sgOafxLCbI2pr+Q
 HLkwID3g5oQx3rvRcKFwyb/CekZTxgjlyDCc28fZVISDkmhvDRd7Yq0of6Lyd+DlpPE5
 mvBE3tNEpHSkSMOBRxepArRsjoeAI9VJBxeoeXXCONNxxxsuUOkexFtw0s2mw37Dr5E3
 jyTQ=X-Gm-Message-State: AOUpUlEJf7+kNwzSi+aJ3F36hkswEGm3si5mS2MqItZq8gEB7XPSbgFH
 9bMA8zgQLWlRM664gmiF4gQbv4IPQf0X-Google-Smtp-Source: AAOMgpeAbw26mzUqm7z7rPtSQqFB0iFsfhcbgKqpshQ9zvWv+6ezbz4GUDt1AeR3ciKOfIiIOUeOqQ=X-Received: by 2002:a63:375b:: with SMTP id
 g27-v6mr5493715pgn.59.1533334919681;
 Fri, 03 Aug 2018 15:21:59 -0700 (PDT)
Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127])
 by smtp.gmail.com with ESMTPSA id h10-v6sm11118033pfj.78.2018.08.03.15.21.59
 (version=TLS1_2 cipherìDHE-RSA-CHACHA20-POLY1305 bits%6/256);
 Fri, 03 Aug 2018 15:21:59 -0700 (PDT)
Date: Fri, 3 Aug 2018 15:21:50 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: amit sehas <cun23@yahoo.com>
Cc: maxime.coquelin@redhat.com, users@dpdk.org
Message-ID: <20180803152150.10c1ecc4@xeon-e3>
In-Reply-To: <607910178.1827758.1533334812223@mail.yahoo.com>
References: <1685797689.496737.1533140869394.ref@mail.yahoo.com>
 <1685797689.496737.1533140869394@mail.yahoo.com>
 <20180803142420.1198b64b@xeon-e3>
 <607910178.1827758.1533334812223@mail.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: [dpdk-users] rte_virtio_pmd_init(): IOPL call failed - cannot
 use virtio PMD
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 03 Aug 2018 22:22:01 -0000

On Fri, 3 Aug 2018 22:20:12 +0000 (UTC)
amit sehas <cun23@yahoo.com> wrote:
What was the error?

Are you running on KVM, what version? Or some other hypervisor like virtualbox?

> I tried my best to make iopl work but couldnt, i wrote a small 'c' program that does only iopl()  and even that does not work, neither on the host machine nor on the VM in docker ... i am wondering if this has anything to do with bios settings ...i tried it on different machines too ... root permissions, explicity setting capset ... etc .. i tried them all but still does not work ... quite frustrating how many hours i had to spent trying different things...
> 
> thanks
>  
> 
>     On Friday, August 3, 2018, 2:24:28 PM PDT, Stephen Hemminger <stephen@networkplumber.org> wrote:  
>  
>  On Wed, 1 Aug 2018 16:27:49 +0000 (UTC)
> amit sehas <cun23@yahoo.com> wrote:
> 
> > I am trying to run a dpdk application in docker and i get the above error ... the docker instance was run as below:
> > 
> > docker run -dit --name <name> -v /hostlibpath:/contlibpath:ro fedora:26 bash
> > 
> > i am new to dpdk, as a result i am quite lost as to where to look ...
> > 
> > thanks  
> 
> Short answer virtio requires DPDK process to be run as root.
> 
> In order for the virtio device to signal the underlying host it may need the in/out instructions.
> These CPU instructions are normally privileged (only allowed in kernel) but on Linux there is
> is a system call to allow a process with root (really CAP_SYS_RAWIO) to do these from userspace.
> See iopl manual page.
> 
> The actual answer is more complex. Older versions of virtio (legacy) use in/out but the
> current version (modern) can use memory read/write.  Ideally, the DPDK virtio would only
> ask for IOPL privilege if it needed it. The problem is that may need it during the negotiation
> process. Someone should look into fixing this.
>   

  reply	other threads:[~2018-08-03 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1685797689.496737.1533140869394.ref@mail.yahoo.com>
2018-08-01 16:27 ` amit sehas
2018-08-03 21:24   ` Stephen Hemminger
2018-08-03 22:20     ` amit sehas [this message]
2018-08-05 14:35       ` amit sehas

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=607910178.1827758.1533334812223@mail.yahoo.com \
    --to=cun23@yahoo.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=users@dpdk.org \
    /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).