From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id DCB2510F84 for ; Thu, 30 Mar 2017 14:26:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490876780; x=1522412780; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=V+E+VCsWNopmdA4w/knQ4hzdOK7N3COASJv7B5f5E3o=; b=sJ2jgZJ2WD2qigdGdhvnwP4BVFWWi7d2L2GvpSNAtmjFrVxjMZkx0s/P Z8AE1/zsXqhehG70ohd7+mCxneqwaA==; Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2017 05:26:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,246,1486454400"; d="scan'208";a="80957925" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 30 Mar 2017 05:26:19 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 30 Mar 2017 05:26:19 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 30 Mar 2017 05:26:18 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.253]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0248.002; Thu, 30 Mar 2017 20:26:17 +0800 From: "Wu, Jingjing" To: "Zhang, Qi Z" , Thomas Monjalon CC: "dev@dpdk.org" , "Yigit, Ferruh" Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: fix wrong handle when enable interrupt Thread-Index: AQHSojcoiy3ShKsQiUeh44+OLvxIV6GtXFVQ Date: Thu, 30 Mar 2017 12:26:17 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810D1BAE5@SHSMSX103.ccr.corp.intel.com> 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> In-Reply-To: <039ED4275CED7440929022BC67E706115306A09F@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] 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: Thu, 30 Mar 2017 12:26:21 -0000 > -----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 >=20 > Hi Thomas: >=20 >=20 > > -----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 =3D 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.