From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6656A034E; Mon, 21 Feb 2022 07:51:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DE974068C; Mon, 21 Feb 2022 07:51:53 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 441A140395; Mon, 21 Feb 2022 07:51:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645426311; x=1676962311; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3PVppupBt+0YOnHTLw8Iwd5Jw6lrjEnKHmGJI+zKaKU=; b=Ftw9HAz2ROSRkwVFSjpwFfTitiEhx/oyWLX0pwMKmL20ssid3p7cc1BM 56DMZttrJqBEGNi+auvNSZ4mpdu8xuGRPNWgahVhbncFbSWjHnxIUSZMk uiP5nAUrMWvbm7TkEHknkl3Y1WEuvlpHsEu23OUvh50fb3ECj4toDGDZM U+ZplADt5wBMx23JUFeMZRV5lBdKo8hwps9LIuTYSH5zu9Gph41d9RlOz AU3Nt7R2E/11lSG2wbSkNLddLIW+vWBFwBnbTLfx/a1pVli/psj9/rrmT C8FVhoUNSHQlVnSzo4wcPypI2xrxJSXuBvdJsTR0z/bwa7nhPfSDHcmf1 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="251630338" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="251630338" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 22:51:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="606287246" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga004.fm.intel.com with ESMTP; 20 Feb 2022 22:51:50 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Sun, 20 Feb 2022 22:51:49 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Sun, 20 Feb 2022 22:51:49 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Sun, 20 Feb 2022 22:51:49 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.104) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Sun, 20 Feb 2022 22:51:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mt8KgAiyzWuSm4yWU0CX9Dhz93aX1UvwjSocyOJqDFxoTD+ZvpANq9vNjwaDSMuBfLee7KsEZEGhRLa5p9E71yCGpceJvodmLt+V1PidE/+hVoFPIthLTYEFcOlMcz1MMjVxlRgFwxtOPCywYFF874bhWXYI7UVWCAi2D76wGLLUQRwgN5qMD4vBWdI9po47szV/blX4QavxK7282A0Z5lXqkoH1wntz7UXE9Ha40w1G5SCKyLKeAWMNEuoWtflVCmNm5TT9y+us1IoR2l8ODoSO6tg7Yn6iXTYA/QykcrwxaAZDMosa2hnu4UR4/BCQj3nQpwKdR0u9h5+wtQ0cuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=51763xK35olU8MvZeJbL2F5MW5IB8MBDXvsfDkza9bw=; b=oN70F3I13NVvVvDpd1FZH9POh3hdrtZojLlebKnnA/C3ecKmMa9OP2gNmIv+dP6pVOnDhG1ZFjbekZmpKJZuSSqeKt8wHuc9g13xhiwVnD560UIab2KkzKGNSbW8XPgBpo92TcTARg9JNmfqfSd/u6HreeNj6eQ6DSd/+daOUDGhwl7NPnFRwg+NebBW/OMk6BJjaaES9c0tGxDbB0T3g9+ZeN1XrAKFd3WsK6lt8HxM3YR4P14nhLP2WRKEMA7mPXKJbvsxBjonsSkqvov2rhtgJiqFC6AzHsj8mMa+62IkFawmd2Tq7KzfgXq1A067rJ8BcuEkc/j57zkZiIVejw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by DM4PR11MB5230.namprd11.prod.outlook.com (2603:10b6:5:389::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Mon, 21 Feb 2022 06:51:45 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809%5]) with mapi id 15.20.4995.027; Mon, 21 Feb 2022 06:51:45 +0000 From: "Zhang, Tianfei" To: "Huang, Wei" , "dev@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" CC: "stable@dpdk.org" , "Yigit, Ferruh" Subject: RE: [PATCH v1] raw/ifpga: fix interrupt handle allocation Thread-Topic: [PATCH v1] raw/ifpga: fix interrupt handle allocation Thread-Index: AQHYJJsRdfT6/N4fnEuHKdE2w19blqydlUCw Date: Mon, 21 Feb 2022 06:51:44 +0000 Message-ID: References: <20220218073848.268548-1-wei.huang@intel.com> In-Reply-To: <20220218073848.268548-1-wei.huang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a639dc6-f564-47f9-1fba-08d9f5069fe9 x-ms-traffictypediagnostic: DM4PR11MB5230:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: U6zo6jlo6DZVWcknUP9lZpMJyCNan+LnlJJAY6ggAHK5LQ1VdiSKbprGPs7HRH28V2egT9A/7+uur0LD+u84YQbYJhs/uVeLyz3Tn1FoVzKK7lDGNSaKF91+K1n7brpz26ksQDLXWCM3vSH1ySrqwf6Gi80ocIAXiUvTX+/KtDiLmkfAJL781rIfTqat9vwUECye9zm3dxa9kwk1KtEFVvPfk4eaTY+fslG7qZZQV3q3yJuYu6q877vur2sg/mLXx2uyY41jO7vkcG9s9oLbfEF73WIIgxEWRToz0L8eJ1r2B3B0XSzP+gvc4dpQ7lj2Db3dlhdZfUX0CYQ5fwo19y8YjCuCuRuQ4sq3GE/MHZnXEff9VMetgNF4lnVMsahpbK4zzwUnePK9YbheQQBl12r/0I6Hy7klxUsZA5vcXYsrlNSopkimwZGF2dWSWZsEQ7Qm2mgqkw5l4s51XvqONwG2h0gAQZUAkjXZlr8hagMSexzrcVkgGghoyaUB12ApxKop+34lEmwQ46MZPf2vCEyrITzBNwdcUpS9xnSSoN5C3lEesydZPLzX2pXX+JocKTQpKHS44tsxbMULN1O0mPS/W/ux/ujwYpWLisdAIEuKXVIOgha3EUAL5jcN+Kv56uTZF9TcfcmmpQIuZxCcbkKiq14MMi0JaHrImVRLKFILh1k0xMRZ2YQCYSGXYtWyNbpOItJwfo1FhaAheSJ5Gg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5483.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66476007)(66446008)(64756008)(52536014)(66556008)(76116006)(66946007)(2906002)(6506007)(7696005)(9686003)(53546011)(8676002)(4326008)(38070700005)(38100700002)(122000001)(33656002)(8936002)(508600001)(55016003)(86362001)(5660300002)(107886003)(316002)(71200400001)(186003)(26005)(83380400001)(110136005)(82960400001)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oSfrBLpXDyqbhF8rWOOpJ8ZKET/eR1/ciEw5kPQI9LokQiewa9WFeDFx5UGa?= =?us-ascii?Q?cdlsfgyNLaPMleAHMyRpnvjWq892UNNz1xCE0kYzTtyLh7bvHX2jfh/7gML4?= =?us-ascii?Q?jOF3/d3mrWSLLn8xYDhEv8RLYxOjh2BbUmi7YoAobkXBQsrFiAMUhYg+8K01?= =?us-ascii?Q?5snpjFERzEru94saihb5nBBDV7XVYmzLnuHoMDULEjLoD+Rbb3TkXdAIijdB?= =?us-ascii?Q?aMN5gd3Vo/n6vhl5tq6oka8eIGvMaUWJZ+GZeVLVaXTlddIa2m5vo70u4DAS?= =?us-ascii?Q?1UJCEN0y1CSvbxppTky/q6XZdU1KjTKJZEvujJAAoXmVJELIRrL6tUTWsmVp?= =?us-ascii?Q?sr8IDmWzRrz724EmJP8e0CvAaHPohxN3FhmWwEsVRtAc9vwbBnoOmshZNyJi?= =?us-ascii?Q?Ex07OU6Apdtf5eY80nWiWvMaHPXhscvPhVtyrHws62LG7pYXeKSsL2MoQw2w?= =?us-ascii?Q?ugCnrkAlIFDLdAREhC9FBMAGfX21W0cPVS7qXOjUhnu040XCUOs0ejkMC5iH?= =?us-ascii?Q?xgD3+F4n+sVUKy0VcLDLjzU1oQyR7qH/AZ+9M0aW3OOQOC3+EcbQWdug1Ic0?= =?us-ascii?Q?isi4yOPl8gTICT92HcgGlfZm/iGOJd78IjB4J+/K2Vj+fYfFiuEkTY+6jWCO?= =?us-ascii?Q?zGl4Kn5hIHJouHbVer3h4D6XqbemBNJlyz1YSiAw9x8ro7DWalqJPuVa5py+?= =?us-ascii?Q?UezVt4ztGlWtfYsLV3FV4u6X+bvTl0/imQuo06ok0bAn4HH9KUrBBdStPlO7?= =?us-ascii?Q?gHEP3wB5KSQrWwBpCxgGS0shL79Km6/GsnEK50J3h/Pg3PciB85+l+57xoeY?= =?us-ascii?Q?c1OFuNQ4CgkAJ/xIxSgEGx2FVpBxHUlDunD7CfnJ8JiZAoAlBFxkG4kzbDmF?= =?us-ascii?Q?3yQGhTP3SvsFtulYDptDtSOGZ424phEtczflqQUNQvtjnBDWTeFz/pQDCnFK?= =?us-ascii?Q?8ub/ivpoCoitG2bsPlIV9CKTfD7dgeqd5SK0hCO7ovcrYrgzeLBm7iFkTqr1?= =?us-ascii?Q?tVAI5L0+7Ib/0JykrBTH+jkSb2Kq9EGqHLxyofeLqHsqcNvZFVdrRGquzNA/?= =?us-ascii?Q?tt7bthxfo91eA4ccqE0Fh4AdLZVDYNjdYGXVsNOQyE6haL8RqbKN/huTK+d1?= =?us-ascii?Q?S/znntqmVTD9KIE67E+iDMEYA73LUvY+7WSgOrieecH4y89R1XJu8+/oN+Oa?= =?us-ascii?Q?dxzBowvz92/nqhLhQLf9DgE9CDIzmtf2FvDXIVQlayEWvGyoxjjF/l+Xbrcj?= =?us-ascii?Q?lMyAK5wgg0pdPo3IT9SJujANBl/HrQNKQND4JYYlIf7Pdt5AxTjK3+Cpkh3P?= =?us-ascii?Q?9EZ+dZMElpD2fQdBhzspCUEfqRf0kEZOmU9BVuK1vWtLGo3Vc7BKhRoVscm0?= =?us-ascii?Q?0l7h6TgwOOUQWb1bzQ4BGGiK6UXNdDm14yfYpwNdrChfBGRnpGv5eneBjHov?= =?us-ascii?Q?MxVBH72wNMrNSnZTi4lBSlUbBGejhs+mMJEVhVr5g0RpUKM2EzRTFOqmuXMd?= =?us-ascii?Q?FrMxw8kvvvyrfunUKeoM12T0MgjZ1lBaft4MjD1Rs1jBahS80dzQg76WqeDK?= =?us-ascii?Q?nClVXTRknpaOlpkktUOGBPunGKEhGbiPHpiKHxTy2qvpxkLgL2mI0UNT5utr?= =?us-ascii?Q?nS/tzHPas0iD+AZZoiTV3j0=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a639dc6-f564-47f9-1fba-08d9f5069fe9 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2022 06:51:44.9694 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: od5uo9ncaE/ZgJdPLooPvIq0QUKh7lpuzzaqPqKoGacJuFfZkW4GgZEsfdiIlw8eqw60l1+wUAX5rckZLwMDTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5230 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Huang, Wei > Sent: Friday, February 18, 2022 3:39 PM > To: dev@dpdk.org; Xu, Rosen ; Zhang, Qi Z > ; nipun.gupta@nxp.com; hemant.agrawal@nxp.com > Cc: stable@dpdk.org; Zhang, Tianfei ; Yigit, Fer= ruh > ; Huang, Wei > Subject: [PATCH v1] raw/ifpga: fix interrupt handle allocation >=20 > Allocate FPGA interrupt handle instance for each card. >=20 > Fixes: e0a1aafe2af9 ("raw/ifpga: introduce IRQ functions") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Huang > --- > drivers/raw/ifpga/ifpga_rawdev.c | 94 ++++++++++++++++++++++++----------= --- > --- > drivers/raw/ifpga/ifpga_rawdev.h | 7 ++- > 2 files changed, 62 insertions(+), 39 deletions(-) >=20 > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c > b/drivers/raw/ifpga/ifpga_rawdev.c > index fdf3c23..f341f4a 100644 > --- a/drivers/raw/ifpga/ifpga_rawdev.c > +++ b/drivers/raw/ifpga/ifpga_rawdev.c > @@ -71,10 +71,6 @@ > static int ifpga_monitor_start; > static pthread_t ifpga_monitor_start_thread; >=20 > -#define IFPGA_MAX_IRQ 12 > -/* 0 for FME interrupt, others are reserved for AFU irq */ -static struc= t > rte_intr_handle *ifpga_irq_handle[IFPGA_MAX_IRQ]; > - > static struct ifpga_rawdev * > ifpga_rawdev_allocate(struct rte_rawdev *rawdev); static int > set_surprise_link_check_aer( @@ -118,6 +114,7 @@ struct ifpga_rawdev * { > struct ifpga_rawdev *dev; > uint16_t dev_id; > + int i =3D 0; >=20 > dev =3D ifpga_rawdev_get(rawdev); > if (dev !=3D NULL) { > @@ -134,6 +131,8 @@ struct ifpga_rawdev * > dev =3D &ifpga_rawdevices[dev_id]; > dev->rawdev =3D rawdev; > dev->dev_id =3D dev_id; > + for (i =3D 0; i < IFPGA_MAX_IRQ; i++) > + dev->intr_handle[i] =3D NULL; >=20 > return dev; > } > @@ -1341,49 +1340,62 @@ static int fme_clean_fme_error(struct > opae_manager *mgr) } >=20 > int > -ifpga_unregister_msix_irq(enum ifpga_irq_type type, > +ifpga_unregister_msix_irq(struct ifpga_rawdev *dev, enum ifpga_irq_type > +type, > int vec_start, rte_intr_callback_fn handler, void *arg) { > - struct rte_intr_handle *intr_handle; > - int rc, i; > + struct rte_intr_handle **intr_handle; > + int rc =3D 0; > + int i =3D vec_start + 1; > + > + if (!dev) > + return -ENODEV; >=20 > if (type =3D=3D IFPGA_FME_IRQ) > - intr_handle =3D ifpga_irq_handle[0]; > + intr_handle =3D (struct rte_intr_handle **)&dev->intr_handle[0]; > else if (type =3D=3D IFPGA_AFU_IRQ) > - intr_handle =3D ifpga_irq_handle[vec_start + 1]; > + intr_handle =3D (struct rte_intr_handle **)&dev->intr_handle[i]; > else > - return 0; > + return -EINVAL; >=20 > - rte_intr_efd_disable(intr_handle); > + if ((*intr_handle) =3D=3D NULL) { > + IFPGA_RAWDEV_PMD_ERR("%s interrupt %d not registered\n", > + type =3D=3D IFPGA_FME_IRQ ? "FME" : "AFU", > + type =3D=3D IFPGA_FME_IRQ ? 0 : vec_start); > + return -ENOENT; > + } >=20 > - rc =3D rte_intr_callback_unregister(intr_handle, handler, arg); > + rte_intr_efd_disable(*intr_handle); > + > + rc =3D rte_intr_callback_unregister(*intr_handle, handler, arg); > + if (rc < 0) { > + IFPGA_RAWDEV_PMD_ERR("Failed to unregister %s interrupt > %d\n", > + type =3D=3D IFPGA_FME_IRQ ? "FME" : "AFU", > + type =3D=3D IFPGA_FME_IRQ ? 0 : vec_start); > + } else { > + rte_intr_instance_free(*intr_handle); > + *intr_handle =3D NULL; > + } >=20 > - for (i =3D 0; i < IFPGA_MAX_IRQ; i++) > - rte_intr_instance_free(ifpga_irq_handle[i]); > return rc; > } >=20 > int > -ifpga_register_msix_irq(struct rte_rawdev *dev, int port_id, > +ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id, > enum ifpga_irq_type type, int vec_start, int count, > rte_intr_callback_fn handler, const char *name, > 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; > int *intr_efds =3D NULL, nb_intr, i; >=20 > - for (i =3D 0; i < IFPGA_MAX_IRQ; i++) { > - ifpga_irq_handle[i] =3D > - > rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE); > - if (ifpga_irq_handle[i] =3D=3D NULL) > - return -ENOMEM; > - } > + if (!dev || !dev->rawdev) > + return -ENODEV; >=20 > - adapter =3D ifpga_rawdev_get_priv(dev); > + adapter =3D ifpga_rawdev_get_priv(dev->rawdev); > if (!adapter) > return -ENODEV; >=20 > @@ -1392,32 +1404,40 @@ static int fme_clean_fme_error(struct > opae_manager *mgr) > return -ENODEV; >=20 > if (type =3D=3D IFPGA_FME_IRQ) { > - intr_handle =3D ifpga_irq_handle[0]; > + intr_handle =3D (struct rte_intr_handle **)&dev->intr_handle[0]; > count =3D 1; > } else if (type =3D=3D IFPGA_AFU_IRQ) { > - intr_handle =3D ifpga_irq_handle[vec_start + 1]; > + i =3D vec_start + 1; > + intr_handle =3D (struct rte_intr_handle **)&dev->intr_handle[i]; > } else { > return -EINVAL; > } >=20 > - if (rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_VFIO_MSIX)) > + if (*intr_handle) > + return -EBUSY; > + > + *intr_handle =3D > rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE); > + if (!(*intr_handle)) > + return -ENOMEM; > + > + if (rte_intr_type_set(*intr_handle, RTE_INTR_HANDLE_VFIO_MSIX)) > return -rte_errno; >=20 > - ret =3D rte_intr_efd_enable(intr_handle, count); > + ret =3D rte_intr_efd_enable(*intr_handle, count); > if (ret) > return -ENODEV; >=20 > - if (rte_intr_fd_set(intr_handle, > - rte_intr_efds_index_get(intr_handle, 0))) > + if (rte_intr_fd_set(*intr_handle, > + rte_intr_efds_index_get(*intr_handle, 0))) > return -rte_errno; >=20 > IFPGA_RAWDEV_PMD_DEBUG("register %s irq, vfio_fd=3D%d, fd=3D%d\n", > - name, rte_intr_dev_fd_get(intr_handle), > - rte_intr_fd_get(intr_handle)); > + name, rte_intr_dev_fd_get(*intr_handle), > + rte_intr_fd_get(*intr_handle)); >=20 > if (type =3D=3D IFPGA_FME_IRQ) { > struct fpga_fme_err_irq_set err_irq_set; > - err_irq_set.evtfd =3D rte_intr_efds_index_get(intr_handle, > + err_irq_set.evtfd =3D rte_intr_efds_index_get(*intr_handle, > 0); >=20 > ret =3D opae_manager_ifpga_set_err_irq(mgr, &err_irq_set); @@ > -1428,14 +1448,14 @@ static int fme_clean_fme_error(struct opae_manager > *mgr) > if (!acc) > return -EINVAL; >=20 > - nb_intr =3D rte_intr_nb_intr_get(intr_handle); > + nb_intr =3D rte_intr_nb_intr_get(*intr_handle); >=20 > intr_efds =3D calloc(nb_intr, sizeof(int)); > if (!intr_efds) > return -ENOMEM; >=20 > for (i =3D 0; i < nb_intr; i++) > - intr_efds[i] =3D rte_intr_efds_index_get(intr_handle, i); > + intr_efds[i] =3D rte_intr_efds_index_get(*intr_handle, i); >=20 > ret =3D opae_acc_set_irq(acc, vec_start, count, intr_efds); > if (ret) { > @@ -1445,7 +1465,7 @@ static int fme_clean_fme_error(struct opae_manager > *mgr) > } >=20 > /* 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) { > free(intr_efds); > @@ -1547,7 +1567,7 @@ static int fme_clean_fme_error(struct opae_manager > *mgr) > IFPGA_RAWDEV_PMD_INFO("this is a PF function"); > } >=20 > - ret =3D ifpga_register_msix_irq(rawdev, 0, IFPGA_FME_IRQ, 0, 0, > + ret =3D ifpga_register_msix_irq(dev, 0, IFPGA_FME_IRQ, 0, 0, > fme_interrupt_handler, "fme_irq", mgr); > if (ret) > goto free_adapter_data; > @@ -1604,7 +1624,7 @@ static int fme_clean_fme_error(struct opae_manager > *mgr) > if (!mgr) > return -ENODEV; >=20 > - if (ifpga_unregister_msix_irq(IFPGA_FME_IRQ, 0, > + if (ifpga_unregister_msix_irq(dev, IFPGA_FME_IRQ, 0, > fme_interrupt_handler, mgr) < 0) > return -EINVAL; >=20 > diff --git a/drivers/raw/ifpga/ifpga_rawdev.h > b/drivers/raw/ifpga/ifpga_rawdev.h > index 61c8366..6e09afe 100644 > --- a/drivers/raw/ifpga/ifpga_rawdev.h > +++ b/drivers/raw/ifpga/ifpga_rawdev.h > @@ -50,6 +50,7 @@ enum ifpga_rawdev_device_state { >=20 > #define IFPGA_RAWDEV_MSIX_IRQ_NUM 7 > #define IFPGA_RAWDEV_NUM 32 > +#define IFPGA_MAX_IRQ 12 >=20 > struct ifpga_rawdev { > int dev_id; > @@ -59,6 +60,8 @@ struct ifpga_rawdev { > uint32_t aer_old[2]; > char fvl_bdf[8][16]; > char parent_bdf[16]; > + /* 0 for FME interrupt, others are reserved for AFU irq */ > + void *intr_handle[IFPGA_MAX_IRQ]; > }; >=20 > struct ifpga_rawdev * > @@ -70,12 +73,12 @@ enum ifpga_irq_type { }; >=20 > int > -ifpga_register_msix_irq(struct rte_rawdev *dev, int port_id, > +ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id, > enum ifpga_irq_type type, int vec_start, int count, > rte_intr_callback_fn handler, const char *name, > void *arg); > int > -ifpga_unregister_msix_irq(enum ifpga_irq_type type, > +ifpga_unregister_msix_irq(struct ifpga_rawdev *dev, enum ifpga_irq_type > +type, > int vec_start, rte_intr_callback_fn handler, void *arg); >=20 > struct rte_pci_bus *ifpga_get_pci_bus(void); > -- It looks good for me. Acked-by: Tianfei Zhang