From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang, Qi Z" Subject: Re: [PATCH] eal: fix max number of interrupt request Date: Mon, 13 Feb 2017 01:16:11 +0000 Message-ID: <039ED4275CED7440929022BC67E706115305B067@SHSMSX103.ccr.corp.intel.com> References: <1486670383-5286-1-git-send-email-qi.z.zhang@intel.com> <3158466.ioj3dkTVO6@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Wu, Jingjing" To: Thomas Monjalon Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D3C4C2BA1 for ; Mon, 13 Feb 2017 02:16:16 +0100 (CET) In-Reply-To: <3158466.ioj3dkTVO6@xps13> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Thomas: > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Friday, February 10, 2017 6:19 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Wu, Jingjing > Subject: Re: [PATCH] eal: fix max number of interrupt request >=20 > 2017-02-09 14:59, Qi Zhang: > > The max number of interrupt request is possible be changed after > > rte_intr_callback_register, so in get_max_intr, we need to check if > > nessesary to update the max_intr. >=20 > So you are using rte_intr_enable() to update the max_intr field in the ca= se of > VFIO_MSIX. > What about MSI, INTX and UIO cases? My thought is, even without my fix, VFIO_MSIX is already the only case that= try to modify max_intr field=20 In get_max_intr, we have: if (!src->intr_handle.max_intr) src->intr_handle.max_intr =3D 1; else if (src->intr_handle.max_intr > RTE_MAX_RXTX_INTR_VEC_= ID) src->intr_handle.max_intr =3D RTE_MAX_RXTX_INTR_VEC_ID + 1; So my patch just follow this and fix some problem. Another option is I can use a local variable that assigned by max_intr with= boundary check, so get_max_intr can be totally removed and max_intr in int= r_source will not be modified. To me both fix are not perfect, I think the problem is in rte_intr_callback= _register we just save a copy of the pci_dev->intr_handle but not the addre= ss point, so we are missing some mechanism to sync them. But since we have tight schedule on the 17.02 release and this issue does c= ause some example code can't work, so we need to a fix it first, we may con= sider improve the mechanism later. Thanks Qi