From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Qiu, Michael" Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice Date: Fri, 19 Feb 2016 08:07:20 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F44907@SHSMSX101.ccr.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> <533710CFB86FA344BFBF2D6802E6028622F28B7B@SHSMSX101.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB97725836B02321@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: "Ananyev, Konstantin" , "Zhang, Helin" , "Lu, Wenzhuo" , "dev@dpdk.org" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 383FCC434 for ; Fri, 19 Feb 2016 09:07:24 +0100 (CET) Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2016/2/2 19:03, Ananyev, Konstantin wrote:=0A= >=0A= =0A= [...]=0A= =0A= >>>> I don't think i40e miss it, because it not the right please to disable= interrupt.=0A= >>>> because all interrupts are enabled in init stage.=0A= >>>>=0A= >>>> Actually, ixgbe enable the interrupt in init stage, but in dev_start, = it disable it=0A= >>>> first and re-enable, so it just the same with doing nothing about inte= rrupt.=0A= >>>>=0A= >>>> Just think below:=0A= >>>>=0A= >>>> 1. start the port.(interrupt already enabled in init stage, disable --= >=0A= >>>> re-enable)=0A= >>>> 2. stop the port.(disable interrupt)=0A= >>>> 3. start port again(Try to disable, but failed, already disabled)=0A= >>>>=0A= >>>> Would you think the code has issue?=0A= >>> [Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_clo= se(),=0A= >>> which calls dev_stop(). So I think the disabling can be done only in de= v_stop().=0A= >>> All others can make use of dev_stop to disable the interrupt.=0A= >> As I said, if it is in dev_stop, it will has issue when dev_start -->=0A= >> dev_stop --> dev_start, this also could applied in i40e and fm10k. If=0A= >> you want to put it in dev_stop, better to remove enable interrupts in=0A= >> init stage, and only put it in dev_start.=0A= > We can't remove enabling interrupt at init stage and put it only in dev_s= tart().=0A= > That means PF couldn't handle interrupts from VF till dev_start() will be= executed on PF=0A= > - which could never happen.=0A= > For same reason we can't disable all interrupts in dev_stop().=0A= > See: http://dpdk.org/ml/archives/dev/2015-November/027238.html=0A= =0A= Hi, Konstantin=0A= =0A= Yes, you are right.=0A= =0A= So the only way to fix this issue should remove it in dev_stop(), and=0A= left it in uinit() stage, which my patch does.=0A= =0A= Am I right?=0A= =0A= Thanks,=0A= Michael=0A= > Konstantin=0A= >=0A= >> Thanks,=0A= >> Michael=0A= >>> Regards,=0A= >>> Helin=0A= >>>=0A= >>>> Thanks,=0A= >>>> Michael=0A= >>>>=0A= >>>>> Maybe we can follow fm10k's style.=0A= >>>>>=0A= >>>>>> On other hand, if we remove it in dev_stop, any side effect? In ixgb= e=0A= >>>>>> start, it will always disable it first and then re-enable it, so it'= s safe.=0A= >>>>> I think you mean we can disable intr anyway even if it has been disab= led.=0A= >>>> Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable inter= rupts, and=0A= >>>> if we try disable twice, it will return and error.=0A= >>>> That's why I mean we need a flag to show the interrupts stats. If it a= lready=0A= >>>> disabled, we do not need call in to kernel. just return and give a war= ning=0A= >>>> message.=0A= >>>>=0A= >>>> Thanks,=0A= >>>> Michael=0A= >>>>=0A= >>>>> Sounds more like why we don't=0A= >>>>> need this patch :)=0A= >>>>>=0A= >>>>>> Thanks,=0A= >>>>>> Michael=0A= >=0A= =0A=