From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <konstantin.ananyev@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 9BCB2C44C
 for <dev@dpdk.org>; Fri, 19 Feb 2016 16:14:09 +0100 (CET)
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga102.fm.intel.com with ESMTP; 19 Feb 2016 07:14:08 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,470,1449561600"; d="scan'208";a="919386141"
Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66])
 by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2016 07:14:08 -0800
Received: from irsmsx105.ger.corp.intel.com ([169.254.7.237]) by
 IRSMSX152.ger.corp.intel.com ([169.254.6.200]) with mapi id 14.03.0248.002;
 Fri, 19 Feb 2016 15:14:07 +0000
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Qiu, Michael" <michael.qiu@intel.com>, "Zhang, Helin"
 <helin.zhang@intel.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>
Thread-Topic: [PATCH v2] ixgbe: Fix disable interrupt twice
Thread-Index: AQHRWmw2aN+UdeS0z0CEKKlFZ3+/yZ8zlwYg
Date: Fri, 19 Feb 2016 15:14:06 +0000
Message-ID: <2601191342CEEE43887BDE71AB97725836B0863A@irsmsx105.ger.corp.intel.com>
References: <1454046700-20843-1-git-send-email-michael.qiu@intel.com>
 <1454047090-21274-1-git-send-email-michael.qiu@intel.com>
 <6A0DE07E22DDAD4C9103DF62FEBC0909034256DA@shsmsx102.ccr.corp.intel.com>
 <533710CFB86FA344BFBF2D6802E6028622F28091@SHSMSX101.ccr.corp.intel.com>
 <6A0DE07E22DDAD4C9103DF62FEBC0909034266D1@shsmsx102.ccr.corp.intel.com>
 <533710CFB86FA344BFBF2D6802E6028622F28A4D@SHSMSX101.ccr.corp.intel.com>
 <F35DEAC7BCE34641BA9FAC6BCA4A12E70A991744@SHSMSX104.ccr.corp.intel.com>
 <533710CFB86FA344BFBF2D6802E6028622F28B7B@SHSMSX101.ccr.corp.intel.com>
 <2601191342CEEE43887BDE71AB97725836B02321@irsmsx105.ger.corp.intel.com>
 <533710CFB86FA344BFBF2D6802E6028622F44907@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <533710CFB86FA344BFBF2D6802E6028622F44907@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWVjNDQ3MWMtYmZhNS00MTkzLTlkNmQtMzJlYzRhZDQ0MTMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkdlV1FZUjlUbUQrMVh4Y2g3dzM1eUZFS1hwVVkyNmZrYmllQmx1c0RXVGc9In0=
x-ctpclassification: CTP_IC
x-originating-ip: [163.33.239.182]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v2] ixgbe: Fix disable interrupt twice
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: Fri, 19 Feb 2016 15:14:10 -0000

Hi Michael


>=20
> On 2016/2/2 19:03, Ananyev, Konstantin wrote:
> >
>=20
> [...]
>=20
> >>>> I don't think i40e miss it, because it not the right please to disab=
le interrupt.
> >>>> because all interrupts are enabled in init stage.
> >>>>
> >>>> Actually, ixgbe enable the interrupt in init stage, but in dev_start=
, it disable it
> >>>> first and re-enable, so it just the same with doing nothing about in=
terrupt.
> >>>>
> >>>> Just think below:
> >>>>
> >>>> 1. start the port.(interrupt already enabled in init stage, disable =
-->
> >>>> re-enable)
> >>>> 2. stop the port.(disable interrupt)
> >>>> 3. start port again(Try to disable, but failed, already disabled)
> >>>>
> >>>> Would you think the code has issue?
> >>> [Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_c=
lose(),
> >>> which calls dev_stop(). So I think the disabling can be done only in =
dev_stop().
> >>> All others can make use of dev_stop to disable the interrupt.
> >> As I said, if it is in dev_stop, it will has issue when dev_start -->
> >> dev_stop --> dev_start, this also could applied in i40e and fm10k. If
> >> you want to put it in dev_stop, better to remove enable interrupts in
> >> init stage, and only put it in dev_start.
> > We can't remove enabling interrupt at init stage and put it only in dev=
_start().
> > That means PF couldn't handle interrupts from VF till dev_start() will =
be executed on PF
> >  - which could never happen.
> > For same reason we can't disable all interrupts in dev_stop().
> > See: http://dpdk.org/ml/archives/dev/2015-November/027238.html
>=20
> Hi, Konstantin
>=20
> Yes, you are right.
>=20
> So the only way to fix this issue should remove it in dev_stop(), and
> left it in uinit() stage, which my patch does.
>=20
> Am I right?

Yes, I think so.
PF should be able to receive MBOX interrupts  after dev_stop().
Konstantin

>=20
> Thanks,
> Michael
> > Konstantin
> >
> >> Thanks,
> >> Michael
> >>> Regards,
> >>> Helin
> >>>
> >>>> Thanks,
> >>>> Michael
> >>>>
> >>>>> Maybe we can follow fm10k's style.
> >>>>>
> >>>>>> On other hand, if we remove it in dev_stop, any side effect? In ix=
gbe
> >>>>>> start, it will always disable it first and then re-enable it, so i=
t's safe.
> >>>>> I think you mean we can disable intr anyway even if it has been dis=
abled.
> >>>> Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable int=
errupts, and
> >>>> if we try disable twice, it will return and error.
> >>>> That's why I mean we need a flag to show the interrupts stats. If it=
 already
> >>>> disabled, we do not need call in to kernel. just return and give a w=
arning
> >>>> message.
> >>>>
> >>>> Thanks,
> >>>> Michael
> >>>>
> >>>>>  Sounds more like why we don't
> >>>>> need this patch :)
> >>>>>
> >>>>>> Thanks,
> >>>>>> Michael
> >