From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <david.marchand@6wind.com>
Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com
 [209.85.218.42]) by dpdk.org (Postfix) with ESMTP id 9AE24568E
 for <dev@dpdk.org>; Sat,  7 Mar 2015 07:53:41 +0100 (CET)
Received: by oiav1 with SMTP id v1so21357297oia.9
 for <dev@dpdk.org>; Fri, 06 Mar 2015 22:53:41 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:date
 :message-id:subject:from:to:cc:content-type;
 bh=4GFpdxHzokkl2pWsUBRqwBilgxoRoFcEV4bJsok7NiM=;
 b=KDo2WsKjTP+p0zukQLUxufPbwAAHTOigvYOMgmUx1LcRpSPF8mHxuqw9sL/vaSsZvn
 YtVF9Qx5fxP7NXPfBMSddbMH52vLGz2zCDJeicBowCKfiUtYJz/YIlobmpoWES0slezz
 Umve3TTE2CCqjKOr79iDzRbG62P0gNa+mXPKUCJv7rt4b43QOk39dHga6qJCgJQKgcYp
 rrmNmNjulbgUcARLlXvtQZNQM/iMppzMt6rAKfb2RohKvY15eV70BympOVyITikvmA1Y
 HscQDXoW8UC7kjS7IMwiZ9t9538VQe1XtVns5REKyZlPiFDX2yhbo9wbehjoYmeXmf3s
 8flg==
X-Gm-Message-State: ALoCoQk6vL+9U/nRxy1ZvPeLLSdtH/0E5sanDDP+q/5PA1PvLgmXJxMHhfO7Lzsy6Blllfv21Pgo
MIME-Version: 1.0
X-Received: by 10.60.42.211 with SMTP id q19mr13867751oel.58.1425711220881;
 Fri, 06 Mar 2015 22:53:40 -0800 (PST)
Received: by 10.76.34.35 with HTTP; Fri, 6 Mar 2015 22:53:40 -0800 (PST)
In-Reply-To: <20150306154344.7057b6d4@urahara>
References: <1425602726-26538-1-git-send-email-stephen@networkplumber.org>
 <1425602726-26538-2-git-send-email-stephen@networkplumber.org>
 <F52918179C57134FAEC9EA62FA2F962511A0C1AF@shsmsx102.ccr.corp.intel.com>
 <20150306082057.5c505f54@urahara>
 <CALwxeUuVtO3Dp4Y3UWQU9HtaVtAffOTzV9jnuETMvZ+NSgamfA@mail.gmail.com>
 <20150306085514.1b0ecbd2@urahara>
 <CALwxeUuGMh5q2O6zxOEkUaNUyehxmb_0ruvf+hsq_Y7nfNF2-Q@mail.gmail.com>
 <20150306154344.7057b6d4@urahara>
Date: Sat, 7 Mar 2015 07:53:40 +0100
Message-ID: <CALwxeUuK=8ZRHgqAS=wyv-pG3=_F0qd1rB7mhjjAmmWDkW3ZnQ@mail.gmail.com>
From: David Marchand <david.marchand@6wind.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] virtio: initialize iopl when device is
	initialized
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sat, 07 Mar 2015 06:53:41 -0000

On Sat, Mar 7, 2015 at 12:43 AM, Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Fri, 6 Mar 2015 23:04:33 +0100
> David Marchand <david.marchand@6wind.com> wrote:
>
> > In the end, the fix would be to move rte_eal_intr_init() after
> rte_eal_dev_init().
>
>
> That would work, but was worried it would break other devices.
>

I had checked the pmds before proposing.

rte_intr_* api is called only from the pdev (meaning pci) drivers at the
moment.

rte_eal_dev_init() means we are still in the "pmd init" phase for the pdev
drivers which means we are still initialising per-driver things for them
since they have no idea of the devices to handle (the devices are
discovered later with the pci scan).
In this phase, the code tells that they are not registering interrupts (and
I don't see how they could register interrupts without knowing devices).

The only problem would be for future vdev drivers (current drivers do not
use rte_intr_*).
But this problem would occur because the driver/device datamodel is not
consistent.
If we could rework this to have devices instantiated at the same phase,
then the problem won't happen.
So, we can hope we will have reworked the driver/device datamodel in dpdk,
before this problem hits us.


I only had checked the pmds, so I may have missed something else that uses
interrupts (if any) but I think this is worth trying and fixing for 2.0.
Thomas, opinion ?


-- 
David Marchand