From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D59782BB0 for ; Tue, 11 Apr 2017 13:00:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491908417; x=1523444417; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=qdxZnYClzbbSjvI9cOwstjIPywvn9v8Aapk/3IQ+aGY=; b=Uz2pWBQlVJhBXORx2Obr+u7pFMaQ1DhGoRmTMsXUoQvEcgqF+GN9LEc0 /emHPpahemBoZ0BjTbetWthQpRricg==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2017 04:00:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,185,1488873600"; d="scan'208";a="1133912086" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by fmsmga001.fm.intel.com with ESMTP; 11 Apr 2017 04:00:14 -0700 To: "Wu, Jingjing" , "Zhang, Qi Z" , Thomas Monjalon Cc: "dev@dpdk.org" References: <1486670573-5447-1-git-send-email-qi.z.zhang@intel.com> <20170321120953.73051-1-qi.z.zhang@intel.com> <039ED4275CED7440929022BC67E706115306A09F@SHSMSX103.ccr.corp.intel.com> <9BB6961774997848B5B42BEC655768F810D1BAE5@SHSMSX103.ccr.corp.intel.com> From: Ferruh Yigit Message-ID: <5b5c566a-6778-56a7-7e11-bdc50adad097@intel.com> Date: Tue, 11 Apr 2017 12:00:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <9BB6961774997848B5B42BEC655768F810D1BAE5@SHSMSX103.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix wrong handle when enable interrupt X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 11:00:17 -0000 On 3/30/2017 1:26 PM, Wu, Jingjing wrote: > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z >> Sent: Tuesday, March 21, 2017 7:34 PM >> To: Thomas Monjalon >> Cc: dev@dpdk.org; Yigit, Ferruh >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix wrong handle when enable >> interrupt >> >> Hi Thomas: >> >> >>> -----Original Message----- >>> From: Zhang, Qi Z >>> Sent: Tuesday, March 21, 2017 8:10 PM >>> To: Wu, Jingjing ; Zhang, Helin >>> >>> Cc: dev@dpdk.org; Zhang, Qi Z ; stable@dpdk.org >>> Subject: [PATCH v2] net/i40e: fix wrong handle when enable interrupt >>> >>> In i40e_dev_interrupt_handler, when call rte_intr_enable, the >>> intr_handle is the copy when we registered. >>> According to interrupt handle framework, if the requirement of >>> intr_handle is changed, we need to unregister then register a new >>> copy. This happens on i40e driver when bind to vfio-pci, the >>> rte_intr_efd_enable function will modify the max_intr according the >>> queue number, so a new copy of intr_handle need to be registered. >>> Without this fix, we saw lw3fwd-power does not work due to wrong >>> interrupt count in vfio_irq_set when set vfio interrupt. >>> >>> Fixes: 2ce7a1ed09fc ("net/i40e: localize mapping of ethdev to PCI >>> device") >>> >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Qi Zhang >>> --- >>> v2: >>> - follow current design, when intr_handle is modified, unregister >>> the old one and register the new one. >>> - there should be a patch set to fix on other devices. >>> >>> drivers/net/i40e/i40e_ethdev.c | 8 ++++++++ >>> 1 file changed, 8 insertions(+) >>> >>> diff --git a/drivers/net/i40e/i40e_ethdev.c >>> b/drivers/net/i40e/i40e_ethdev.c index 9c76baa..e7bbea5 100644 >>> --- a/drivers/net/i40e/i40e_ethdev.c >>> +++ b/drivers/net/i40e/i40e_ethdev.c >>> @@ -1886,6 +1886,14 @@ i40e_dev_start(struct rte_eth_dev *dev) >>> ret = rte_intr_efd_enable(intr_handle, intr_vector); >>> if (ret) >>> return ret; >>> + /** >>> + * intr_handle may be modified in rte_intr_efd_enable >>> + * so unregster the old one and register the new one. >>> + */ >>> + rte_intr_callback_unregister(intr_handle, >>> + i40e_dev_interrupt_handler, dev); >>> + rte_intr_callback_register(intr_handle, >>> + i40e_dev_interrupt_handler, dev); >> To me, this fix looks a little bit weird. >> May I know why we need to register an copy of intr_handle ? >> What do you think about my previous clean up patch. >> http://dpdk.org/dev/patchwork/patch/21529/ >> Thanks >> Qi. > > It seems [dpdk-dev,v2,1/3] vfio: keep interrupt source read only > http://www.dpdk.org/dev/patchwork/patch/21528/ is already > be acked by Anatoly. > > I think we need to support that change, but not this workaround. > No more required after "clean up interrupt handle" patches, patch status updated to rejected.