From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 85EC395CC for ; Tue, 2 Feb 2016 04:07:23 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 01 Feb 2016 19:07:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,383,1449561600"; d="scan'208";a="874658068" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 01 Feb 2016 19:07:23 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Feb 2016 19:07:22 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Feb 2016 19:07:21 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by shsmsx102.ccr.corp.intel.com ([169.254.2.172]) with mapi id 14.03.0248.002; Tue, 2 Feb 2016 11:07:19 +0800 From: "Zhang, Helin" To: "Qiu, Michael" , "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [PATCH v2] ixgbe: Fix disable interrupt twice Thread-Index: AQHRWlokuxzst+DuYUqlXTIjOup9yZ8YGIsg Date: Tue, 2 Feb 2016 03:07:18 +0000 Message-ID: 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> <533710CFB86FA344BFBF2D6802E6028622F28B7B@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E6028622F28B7B@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2FjZDUwZjgtMjEyYy00MTg1LTllZGEtZTFhMDRjZWJhOGJlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWWJvamJlbStaMkNTMXdOT0Q1aDNtNGVkdngxZ01OUjVMQ0NNZTBOdFBPWT0ifQ== x-originating-ip: [10.239.127.40] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2016 03:07:24 -0000 > -----Original Message----- > From: Qiu, Michael > Sent: Tuesday, February 2, 2016 10:57 AM > To: Zhang, Helin ; Lu, Wenzhuo > ; dev@dpdk.org > Cc: Zhou, Danny ; Liu, Yong ; > Liang, Cunming > Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice >=20 > On 2/2/2016 10:14 AM, Zhang, Helin wrote: > > > >> -----Original Message----- > >> From: Qiu, Michael > >> Sent: Tuesday, February 2, 2016 10:07 AM > >> To: Lu, Wenzhuo; dev@dpdk.org > >> Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin > >> Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice > >> > >> [+cc helin] > >> > >> On 2/2/2016 9:03 AM, Lu, Wenzhuo wrote: > >>> Hi Michael, > >>> > >>>> -----Original Message----- > >>>> From: Qiu, Michael > >>>> Sent: Monday, February 1, 2016 4:05 PM > >>>> To: Lu, Wenzhuo; dev@dpdk.org > >>>> Cc: Zhou, Danny; Liu, Yong; Liang, Cunming > >>>> Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice > >>>> > >>>> On 1/29/2016 4:07 PM, Lu, Wenzhuo wrote: > >>>>> Hi Michael, > >>>>> > >>>>>> -----Original Message----- > >>>>>> From: Qiu, Michael > >>>>>> Sent: Friday, January 29, 2016 1:58 PM > >>>>>> To: dev@dpdk.org > >>>>>> Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, > >>>>>> Michael > >>>>>> Subject: [PATCH v2] ixgbe: Fix disable interrupt twice > >>>>>> > >>>>>> Currently, ixgbe vf and pf will disable interrupt twice in stop > >>>>>> stage and uninit stage. It will cause an error: > >>>>>> > >>>>>> testpmd> quit > >>>>>> > >>>>>> Shutting down port 0... > >>>>>> Stopping ports... > >>>>>> Done > >>>>>> Closing ports... > >>>>>> EAL: Error disabling MSI-X interrupts for fd 26 > >>>>>> Done > >>>>>> > >>>>>> Becasue the interrupt already been disabled in stop stage. > >>>>>> Since it is enabled in init stage, better remove from stop stage. > >>>>> I'm afraid it's not a good idea to just remove the intr_disable > >>>>> from > >> dev_stop. > >>>>> I think dev_stop have the chance to be used independently with > >>>>> dev_unint. In > >>>> this scenario, we still need intr_disable, right? > >>>>> Maybe what we need is some check before we disable the intr:) > >>>> Yes, indeed we need some check in disable intr, but it need > >>>> additional fields in "struct rte_intr_handle", and it's much saft > >>>> to do so, but as I check i40e/fm10k code, only ixgbe disable it in > dev_stop(). > >>> I found fm10k doesn't enable intr in dev_start. So, I think it's OK. > >>> But i40e > >> enables intr in dev_start. > >>> To my opinion, it's more like i40e misses the intr_disable in dev_sto= p. > >> I don't think i40e miss it, because it not the right please to disable= 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 noth= ing about > interrupt. > >> > >> 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_close(), which calls dev_stop(). So I think the disabling can be do= ne only in > dev_stop(). > > All others can make use of dev_stop to disable the interrupt. >=20 > 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. Oh, yes, you are talking about the refactoring. That's good, and reasonable= . Please do more validation with LSC, mailbox, rx interrupts, to make sure th= ere is no issue introduced. Thanks, Helin >=20 > 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 > >>>> ixgbe start, it will always disable it first and then re-enable it, = so it's safe. > >>> I think you mean we can disable intr anyway even if it has been disab= led. > >> Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable > >> interrupts, 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 warning message. > >> > >> Thanks, > >> Michael > >> > >>> Sounds more like why we don't > >>> need this patch :) > >>> > >>>> Thanks, > >>>> Michael > >