From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC858A04DB for ; Thu, 15 Oct 2020 15:14:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D3AC1E906; Thu, 15 Oct 2020 15:14:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 465611E8C3; Thu, 15 Oct 2020 15:14:51 +0200 (CEST) IronPort-SDR: lzCjYGH+REv110Qbv/t0OeK8PkH7tE71oYdv28tOJ5Eqw5OB0AECyKqrJPuhxRndlURYWsP89p x00pFWU8+q+w== X-IronPort-AV: E=McAfee;i="6000,8403,9774"; a="230540830" X-IronPort-AV: E=Sophos;i="5.77,379,1596524400"; d="scan'208";a="230540830" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2020 06:14:48 -0700 IronPort-SDR: tV/YqEvJXG7XWZFm0iG4FzoWliPzf7DR8prUIQOz7lGrDjWpkh2ywV0O4nNRCQlsfrKUOHDTd3 w5Ts0Q76zaIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,379,1596524400"; d="scan'208";a="464291734" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga004.jf.intel.com with ESMTP; 15 Oct 2020 06:14:47 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 15 Oct 2020 06:14:46 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 15 Oct 2020 21:14:44 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Thu, 15 Oct 2020 21:14:44 +0800 From: "Zhang, Qi Z" To: "Xu, Rosen" , "Zhang, Tianfei" , "dev@dpdk.org" , "Huang, Wei" CC: "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ functions Thread-Index: AQHWlgHnWNPWKedZ10C/6xgFH6feNqmYvjSQ Date: Thu, 15 Oct 2020 13:14:44 +0000 Message-ID: References: <1600846213-18093-1-git-send-email-tianfei.zhang@intel.com> <1601257218-6606-1-git-send-email-tianfei.zhang@intel.com> <1601257218-6606-2-git-send-email-tianfei.zhang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.108.32.68] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ functions X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: dev On Behalf Of Xu, Rosen > Sent: Tuesday, September 29, 2020 9:42 AM > To: Zhang, Tianfei ; dev@dpdk.org; Huang, Wei > > Cc: stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ fun= ctions >=20 > Hi, >=20 > > -----Original Message----- > > From: Zhang, Tianfei > > Sent: Monday, September 28, 2020 9:40 > > To: dev@dpdk.org; Xu, Rosen ; Huang, Wei > > > > Cc: stable@dpdk.org; Zhang, Tianfei > > Subject: [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ functions > > > > From: Wei Huang > > > > Using a pointer instead of using a structure and point to > > ifpga_irq_handle[] in register and unregister interrupt functions. > > Treat positive return value of ifpga_unregister_msix_irq() as successfu= l. > > > > Fixes: e0a1aafe ("raw/ifpga: introduce IRQ functions") > > Cc: stable@dpdk.org > > > > Signed-off-by: Wei Huang > > Signed-off-by: Tianfei zhang > > --- > > v2: fix typo in commit log > > --- > > drivers/raw/ifpga/ifpga_rawdev.c | 41 > > ++++++++++++++++++-------------- > > 1 file changed, 23 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c > > b/drivers/raw/ifpga/ifpga_rawdev.c > > index a50173264..374a7ff1d 100644 > > --- a/drivers/raw/ifpga/ifpga_rawdev.c > > +++ b/drivers/raw/ifpga/ifpga_rawdev.c > > @@ -1337,17 +1337,18 @@ int > > ifpga_unregister_msix_irq(enum ifpga_irq_type type, > > int vec_start, rte_intr_callback_fn handler, void *arg) { > > - struct rte_intr_handle intr_handle; > > + struct rte_intr_handle *intr_handle; > > > > if (type =3D=3D IFPGA_FME_IRQ) > > - intr_handle =3D ifpga_irq_handle[0]; > > + intr_handle =3D &ifpga_irq_handle[0]; > > else if (type =3D=3D IFPGA_AFU_IRQ) > > - intr_handle =3D ifpga_irq_handle[vec_start + 1]; > > + intr_handle =3D &ifpga_irq_handle[vec_start + 1]; > > + else > > + return 0; > > > > - rte_intr_efd_disable(&intr_handle); > > + rte_intr_efd_disable(intr_handle); > > > > - return rte_intr_callback_unregister(&intr_handle, > > - handler, arg); > > + return rte_intr_callback_unregister(intr_handle, handler, arg); > > } > > > > int > > @@ -1357,7 +1358,7 @@ ifpga_register_msix_irq(struct rte_rawdev *dev, > > int port_id, > > void *arg) > > { > > int ret; > > - struct rte_intr_handle intr_handle; > > + struct rte_intr_handle *intr_handle; > > struct opae_adapter *adapter; > > struct opae_manager *mgr; > > struct opae_accelerator *acc; > > @@ -1371,26 +1372,29 @@ ifpga_register_msix_irq(struct rte_rawdev > > *dev, int port_id, > > return -ENODEV; > > > > if (type =3D=3D IFPGA_FME_IRQ) { > > - intr_handle =3D ifpga_irq_handle[0]; > > + intr_handle =3D &ifpga_irq_handle[0]; > > count =3D 1; > > - } else if (type =3D=3D IFPGA_AFU_IRQ) > > - intr_handle =3D ifpga_irq_handle[vec_start + 1]; > > + } else if (type =3D=3D IFPGA_AFU_IRQ) { > > + intr_handle =3D &ifpga_irq_handle[vec_start + 1]; > > + } else { > > + return -EINVAL; > > + } > > > > - intr_handle.type =3D RTE_INTR_HANDLE_VFIO_MSIX; > > + intr_handle->type =3D RTE_INTR_HANDLE_VFIO_MSIX; > > > > - ret =3D rte_intr_efd_enable(&intr_handle, count); > > + ret =3D rte_intr_efd_enable(intr_handle, count); > > if (ret) > > return -ENODEV; > > > > - intr_handle.fd =3D intr_handle.efds[0]; > > + intr_handle->fd =3D intr_handle->efds[0]; > > > > IFPGA_RAWDEV_PMD_DEBUG("register %s irq, vfio_fd=3D%d, fd=3D%d\n", > > - name, intr_handle.vfio_dev_fd, > > - intr_handle.fd); > > + name, intr_handle->vfio_dev_fd, > > + intr_handle->fd); > > > > if (type =3D=3D IFPGA_FME_IRQ) { > > struct fpga_fme_err_irq_set err_irq_set; > > - err_irq_set.evtfd =3D intr_handle.efds[0]; > > + err_irq_set.evtfd =3D intr_handle->efds[0]; > > > > ret =3D opae_manager_ifpga_set_err_irq(mgr, &err_irq_set); > > if (ret) > > @@ -1400,13 +1404,14 @@ ifpga_register_msix_irq(struct rte_rawdev > > *dev, int port_id, > > if (!acc) > > return -EINVAL; > > > > - ret =3D opae_acc_set_irq(acc, vec_start, count, > > intr_handle.efds); > > + ret =3D opae_acc_set_irq(acc, vec_start, count, > > + intr_handle->efds); > > if (ret) > > return -EINVAL; > > } > > > > /* register interrupt handler using DPDK API */ > > - ret =3D rte_intr_callback_register(&intr_handle, > > + ret =3D rte_intr_callback_register(intr_handle, > > handler, (void *)arg); > > if (ret) > > return -EINVAL; > > -- > > 2.17.1 >=20 > Acked-by: Rosen Xu Applied to dpdk-next-net-intel. Thanks Qi