From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B38AAA04C3;
	Fri, 22 Nov 2019 13:40:25 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 399821B93E;
	Fri, 22 Nov 2019 13:40:12 +0100 (CET)
Received: from inbox.dpdk.org (xvm-172-178.dc0.ghst.net [95.142.172.178])
 by dpdk.org (Postfix) with ESMTP id 49BA17CBC
 for <dev@dpdk.org>; Fri, 22 Nov 2019 13:40:11 +0100 (CET)
Received: by inbox.dpdk.org (Postfix, from userid 33)
 id 2E020A04C7; Fri, 22 Nov 2019 13:40:11 +0100 (CET)
From: bugzilla@dpdk.org
To: dev@dpdk.org
Date: Fri, 22 Nov 2019 12:40:11 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: DPDK
X-Bugzilla-Component: core
X-Bugzilla-Version: unspecified
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: normal
X-Bugzilla-Who: anatoly.burakov@intel.com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: Normal
X-Bugzilla-Assigned-To: dev@dpdk.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: 
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
 op_sys bug_status bug_severity priority component assigned_to reporter
 target_milestone
Message-ID: <bug-370-3@http.bugs.dpdk.org/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
MIME-Version: 1.0
Subject: [dpdk-dev] [Bug 370] Cannot hotplug VFIO devices if VFIO driver was
 not loaded at init
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

https://bugs.dpdk.org/show_bug.cgi?id=3D370

            Bug ID: 370
           Summary: Cannot hotplug VFIO devices if VFIO driver was not
                    loaded at init
           Product: DPDK
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: core
          Assignee: dev@dpdk.org
          Reporter: anatoly.burakov@intel.com
  Target Milestone: ---

Currently, VFIO device initialization depends upon checking if VFIO is enab=
led.
That code looks like this:

> int
> rte_vfio_is_enabled(const char *modname)
> {
>     const int mod_available =3D rte_eal_check_module(modname) > 0;
>     return default_vfio_cfg->vfio_enabled && mod_available;
> }

The `default_vfio_cfg->vfio_enabled` is set at initialization time with
`rte_vfio_enable` function, and is never rechecked afterwards. This makes i=
t so
that if `vfio` driver was not loaded at EAL initialization time, any subseq=
uent
VFIO device initialization will fail.

To fix that, we would have to re-check the existence of a `vfio` driver eve=
ry
time, however the current API gets in the way, because even though it stores
global state, it is implemented in a way that looks like it is supposed to =
be
generic and support multiple driver names (and is never used that way - the
only time this API is used is in the EAL initialization when checking for a
specific `vfio` driver - i think it's a safe assumption to make that whatev=
er
implementation of VFIO is in use, it will depend upon the `vfio` kernel
module).

So, current API will need to be changed (it makes no sense anyway) before t=
his
bug can be fixed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=