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 7CC44A0558 for ; Thu, 26 May 2022 08:41:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7518342684; Thu, 26 May 2022 08:41:42 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id B7C5440DF7; Thu, 26 May 2022 08:41:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653547300; x=1685083300; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rCtn49nF00CgvRR+iv90U0gAvX5u5yokJGpL+0CfBf4=; b=bXMpzIv2a3uIi3SDDluIr3le0t5EOJbOWgInLrUDw6AzLGHu41PqfNzv RI2W3Xq8iHS8ZxJAUfaKyvDkheOclA4uCOuEQ4mqQJi3BamFh00HLhZIx DtuZ5PkO0nH2jYmwzHno01yBK9/ZVYCNg8U5JT8A5kLej9fljgepQBKJa FHQampG6XH0jTJKo5oVc0xvi8FYw+ldjQp0iawOnI4rWGlIvmCpz972ki Ded4Hh3oPbfR838IcM+RjhHBXe9KgzsDNvfTMvG3KoTg3OuUh/I4VcfuA oAnxDPYuF5ysx9Vg2V6JShOoBTAPLEo/Dk3x1EE1U4ZfvOJqDrPQ99U4D A==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="256122141" X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="256122141" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 23:41:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="630745846" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 25 May 2022 23:41:37 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 25 May 2022 23:41:36 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 25 May 2022 23:41:36 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 25 May 2022 23:41:36 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.107) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 25 May 2022 23:41:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JoKSiGiFU8JMPgzt8zUhRlK+NzPK5ynJrwQ1G4SqlXVPO2mZC3qDPnePB//7LEME0SwcypeBmwkW4oNSaVb7JOoaKeFXSY8Um8KVZsLobBX8yhMBpvB/I8wO6Jhm+gnbhohGgUhVan6MruiOyRXaFbbDfdAQacPYzq99F5Lbe60U8MYogclo3W+9302YVNj4MMshVI/VLSrOfOU0erMrwWW4uDqXeHAfap91t7EV4X0uble9rsxK81JOvFMSGj1ERh4rJSJV7kQAT43wx2nexDBzKh8fXViQD3t+zg8u6waPUfwpIZ5YxDOLTtL49KIBENxqVONClMVg65D1jF3TYg== 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=rewx/V1lZxTOI93LAPgmDKGUvZZ3F+5rhXe/LiLAtMo=; b=MY1Nnsc7T7AVnEI+xQC9CIY4K4iMRHl5JOX2K0M15SGukfZLIgd/HSdHyR+GxuPs+NSsOQMY6xoDpuJyxGl9MEQbXXh/RwoCPLO9/O8dbbH5iloR0P5QCn/Nl64sLbkJoEBzdf7fiSvRIO2fndoV4vfkHuEaH/S9XomLJP/StGjzob8X3I9OA4qC4RQp3qbdvWd3V2f/77fbi0Jh3E2KifLPj5wW488ln40I4mof/BGCYyxMFNsPE9oeUDCFynFKRSr+7dQPrcu1JwMX8hYFHcrWbnUbjZVHDmxZJm1k+k2RgcM8OJQLh3SvFQTd03/4V6zE/JanHXVDtpSF18bt5w== 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 DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by BL3PR11MB6529.namprd11.prod.outlook.com (2603:10b6:208:38c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22; Thu, 26 May 2022 06:41:28 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::b9d5:600c:9f13:bc96]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::b9d5:600c:9f13:bc96%7]) with mapi id 15.20.5293.013; Thu, 26 May 2022 06:41:28 +0000 From: "Xu, Rosen" To: "Huang, Wei" , "dev@dpdk.org" , "thomas@monjalon.net" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" CC: "stable@dpdk.org" , "Zhang, Tianfei" , "Zhang, Qi Z" Subject: RE: [PATCH v3 3/5] raw/ifpga: unregister interrupt in ifpga close function Thread-Topic: [PATCH v3 3/5] raw/ifpga: unregister interrupt in ifpga close function Thread-Index: AQHYcLBTLr45Jd/Mi0eZYigw6HisTa0wtS0w Date: Thu, 26 May 2022 06:41:28 +0000 Message-ID: References: <1652862549-13131-1-git-send-email-wei.huang@intel.com> <1653535974-1379-1-git-send-email-wei.huang@intel.com> <1653535974-1379-4-git-send-email-wei.huang@intel.com> In-Reply-To: <1653535974-1379-4-git-send-email-wei.huang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODY3Y2Q5ZTktMzBkNy00YmRhLWFmZGQtYWNmZTMzMjRmMjIyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQXA5Wkh3bHIyXC9WRk96TlpFWTRXS2srRTZRYlNGbndWYzdhWE53UXR6TDJseHVrSDJsdFwvUWwrZ1lQUDE3WHBmIn0= x-ctpclassification: CTP_NT 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: b372885c-db96-4cc3-180a-08da3ee2c346 x-ms-traffictypediagnostic: BL3PR11MB6529:EE_ 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: NASv1GnWg78wHNCPE6PCcYciltL//lvS/Ea3f+2I1C16IyC+ARDg/rlPoQe8fIZ//qsGkP0ymo4xcpAmHZ9Wkkn/6IW91mP4TdqGUIYaM3qCseuEcK0K/GIRu8a+OnUHLbwRzVPEUmX7PwU59D418MPwiY89Bi06arsREAg7ZmU/1PoUjnQ20dQ2neHAmefLRUoVM9xato1UXR9rvZkpEEAJw1+iUJQZhUje0Z2uXfxfSqGlQ+v78HVEb0gfcW+kTn8PRn6ls89nJwqPQ18oXm1fCC2O/YIRHGZOUnHEhsTFg4qy2K5yew8M7+HadY3OEAzdtiV3OSHek+j/hX8e95Dwo/43refrMiLGDSRipEUFHHCAeeRY5eIOqA/qmbxZD9nnGf7eA8uPyBbAVvL0gPx8ecf9tcZw0XiTMjKMX31O52Lzs38Boi6fUlUjNagnWfkZJumbsLzUhhUx2Vo7ozTQ8Dkd4MCqv9ZyXPcrGchYCFeAYsULIuGfeP02tlp0viIw7DLmLQuP7auTWTmRqtV+8MgVfE+wxvIF/lmgOSH1AwrvywcM6HhIjl3YQFZZ6OP8S5XxpPsH5UAG9dgKdwggLu3d6L4rOjB5i/kweNV+KB+ONGVYaEse6MMBbk8xc6fhKha9Rfha5mLN/gYJoWhekuUcoXJ/Zz6IPDlwiJ8fUkt9tRDV0kJnwJuJUuR7fAdLYDu13ah7wDbojf/GFA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(2906002)(33656002)(38070700005)(66556008)(5660300002)(38100700002)(508600001)(52536014)(4326008)(66946007)(86362001)(122000001)(8676002)(55016003)(83380400001)(186003)(66476007)(107886003)(71200400001)(66446008)(64756008)(76116006)(9686003)(7696005)(6506007)(26005)(53546011)(316002)(82960400001)(110136005)(8936002)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hmfNbIh6Et9B/8AumqJrWqrLSUUZXcGLiAF5QBH/WbEoSN+qVVB8U3yqC7e4?= =?us-ascii?Q?84I/KT5Mb1DMe2Jafay72XjNk8m8up2s8LrLCJqMFpjiWc1cbP5QMlqMDgfC?= =?us-ascii?Q?lxOLbRxoDN0LbCcSjLxJaAfZ7kcdKoX2WBgk2S6FoolYM4XjjEfa8XjalFK4?= =?us-ascii?Q?MZZSOIoFXl9eJRkJlQlzZ9AT/P38xxwYb8EuMzXroAUU/ieB6tNTIwcZKXiq?= =?us-ascii?Q?OQ9o9LqFtoiaoNIiTssj53A+FzQWz6QIKTAqsrbyfH9qivEsJQSxjYJrTjyD?= =?us-ascii?Q?x+5due5TzzLRNuhX0d2CpSh1G+JEE7Yej/nC5UcTl7BPRmeVBCML8Y8u+zhb?= =?us-ascii?Q?p5D4KRfWP5oFO3nBdLbkIbN3CWzlq2D94PkzP92MsZlWh6axkGliLikw/+/7?= =?us-ascii?Q?/DQ6ASKaT4U4myUsIKLyj991pHiW5XFz3wjY/cZoUP3cvrUjhz9Vex5GTwV3?= =?us-ascii?Q?T7K34aybo4VnQlrB4pO3wt/DQC5BSICjUH2LPIvn24CmbzW8X8cZvlO2pErB?= =?us-ascii?Q?PjbnbWX502+gd15IKmb/QfM4w2P1N6ef1aFa/jWKi79Z3+bBMIWNiPsfSoTx?= =?us-ascii?Q?Vx5w+KieGfeOnGYQ8aiviMHLFwuNCPbCZofSzronqYWqAjyYXH5VES9qOyrL?= =?us-ascii?Q?dqj+4DBmCrmHtuKoDRr9hrjWQkJfkA7SJ1w1BNR8ikaFz7rmr0EYzm2b7G4T?= =?us-ascii?Q?JJ+gPUM7l17tZHiXeRxfH+qfHm61m1EXVQeXWzgrGGTgzS+CL9Q3mOyUpiLG?= =?us-ascii?Q?BK2AAg9uRfNblB9pMFRRtmgc/q1TnSLWrEBxCo94as1ZAife/yDymOABW1H4?= =?us-ascii?Q?HAxFuKwcNh6eKruKYLSuIie786lC0FqNiSdV2OD7WIPeZWg77XFWulSP4Mb1?= =?us-ascii?Q?QfbzsUmcCXO/YhyUd+fmCQ3bHVZpigoUfjhkF+KFWXoh7vx71aThonGOqwWw?= =?us-ascii?Q?rXcWdc5fs1tPLTahntME0+ppo7ZoVkY5BcHuPVPtDtu62TsiNt5giXz4l+Wl?= =?us-ascii?Q?JlAIGTKoNqZdFjhrQFL5M0ZYthiITseEvifexh4epOc0tYn1vvfGFB0EKutP?= =?us-ascii?Q?VW8wNG3qx5txC5bRb0rmQd1u/00Yh0KrKtRXpNutjzl554dGnlD064uH5Qka?= =?us-ascii?Q?6N6RfH/mK3Ymc6cNcS8t86BhuUiv+2FawIGcVCVJxvjK/VqXgzvgVYxwfd33?= =?us-ascii?Q?ZwC6sHiRZ62lSf4SCacx7DVzhBguedIERMoP7U+7ptd3w9grGEjvoq3u/po5?= =?us-ascii?Q?q5CXma2XK7ZrXzmk8rSibm5oJFDTF7xodFdJtROczyBudgmkzJ2WZVNSVlDk?= =?us-ascii?Q?WDgwgRN3OboOi0VeAIkugy4XHeU3tdVrSTfrsgOBbD1+OSL5JS/A1gemTm1V?= =?us-ascii?Q?JtGqHd/jSalKyG6RKiRTIfXGTfXiMEht8a/9IIDzx/3KhlG8911fiDI0yB5v?= =?us-ascii?Q?dJe1yMacPM+L8C2aUKChkDgDt9mcVV8UAROStuC//ISpwh0zW1/YPMmYc+tF?= =?us-ascii?Q?VA4FnNPvP0gJBPhVzvtJf+zg97KAy9Cc79cTGpqBm6ObQ+kVNVAhOnljD+wP?= =?us-ascii?Q?gJK3inTCPgDRZupavBlIffUdob6mAlvyK5DGjo5NgN1tNfitzpWedyaNv/1l?= =?us-ascii?Q?KTGJMwONaa9n3zsu0zIC71IBIjPBKyT7hkXlxwFn9Ts3YIBTpiMk5agx38mM?= =?us-ascii?Q?nup9fSHDyTGnW3KlhFj2vpUwWYFSdVoqCYO3Sps3NM6sihu/wBpHuLlgblm4?= =?us-ascii?Q?EH+6ipOSEg=3D=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: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b372885c-db96-4cc3-180a-08da3ee2c346 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2022 06:41:28.5559 (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: Z+BuDrga8Du2cb0PXfh5hxDH4rrscPIRJXLX9PvXkR1o3TXbFMzsY0LSWMnsYN/qVLwj0rl0kC6abTN2q4lTug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6529 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi Wei, It's a little bit hard to find the connections between functions you change= d and raw API. Could you add more explanations about the Function Call in the functions yo= u mentioned below? Thanks, Rosen > -----Original Message----- > From: Huang, Wei > Sent: Thursday, May 26, 2022 11:33 > To: dev@dpdk.org; thomas@monjalon.net; nipun.gupta@nxp.com; > hemant.agrawal@nxp.com > Cc: stable@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v3 3/5] raw/ifpga: unregister interrupt in ifpga close fu= nction >=20 > In original implementation, interrupts are unregistered in > ifpga_rawdev_destroy function. If application want to release the ifpga > driver resource by calling rte_rawdev_pmd_release, interrupt resource wil= l > not be released. > Now interrupt unregistration is moved from ifpga destroy function to ifpg= a > close function, when rte_rawdev_pmd_release is called, rte_rawdev_close > will be called, then interrupts are unregistered. >=20 > Signed-off-by: Wei Huang > --- > v2: update commit log > --- > drivers/raw/ifpga/ifpga_rawdev.c | 29 +++++++++++------------------ > 1 file changed, 11 insertions(+), 18 deletions(-) >=20 > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c > b/drivers/raw/ifpga/ifpga_rawdev.c > index fe3fc43..94df56c 100644 > --- a/drivers/raw/ifpga/ifpga_rawdev.c > +++ b/drivers/raw/ifpga/ifpga_rawdev.c > @@ -78,6 +78,7 @@ static int set_surprise_link_check_aer( static int > ifpga_pci_find_next_ext_capability(unsigned int fd, > int start, uint32_t cap); > static int ifpga_pci_find_ext_capability(unsigned int fd, uint32_t cap); > +static void fme_interrupt_handler(void *param); >=20 > struct ifpga_rawdev * > ifpga_rawdev_get(const struct rte_rawdev *rawdev) @@ -740,8 +741,9 @@ > static int set_surprise_link_check_aer( { > struct ifpga_rawdev *ifpga_rdev =3D NULL; > struct opae_adapter *adapter; > + struct opae_manager *mgr; > char *vdev_name =3D NULL; > - int i =3D 0; > + int i, ret =3D 0; >=20 > if (dev) { > ifpga_rdev =3D ifpga_rawdev_get(dev); > @@ -756,12 +758,19 @@ static int set_surprise_link_check_aer( > } > adapter =3D ifpga_rawdev_get_priv(dev); > if (adapter) { > + mgr =3D opae_adapter_get_mgr(adapter); > + if (ifpga_rdev && mgr) { > + if (ifpga_unregister_msix_irq(ifpga_rdev, > + IFPGA_FME_IRQ, 0, > + fme_interrupt_handler, mgr) < 0) > + ret =3D -EINVAL; > + } > opae_adapter_destroy(adapter); > opae_adapter_data_free(adapter->data); > } > } >=20 > - return dev ? 0:1; > + return ret; > } >=20 > static int > @@ -1629,9 +1638,6 @@ static int fme_clean_fme_error(struct > opae_manager *mgr) > int ret; > struct rte_rawdev *rawdev; > char name[RTE_RAWDEV_NAME_MAX_LEN]; > - struct opae_adapter *adapter; > - struct opae_manager *mgr; > - struct ifpga_rawdev *dev; >=20 > if (!pci_dev) { > IFPGA_RAWDEV_PMD_ERR("Invalid pci_dev of the device!"); > @@ -1651,19 +1657,6 @@ static int fme_clean_fme_error(struct > opae_manager *mgr) > IFPGA_RAWDEV_PMD_ERR("Invalid device name (%s)", > name); > return -EINVAL; > } > - dev =3D ifpga_rawdev_get(rawdev); > - > - adapter =3D ifpga_rawdev_get_priv(rawdev); > - if (!adapter) > - return -ENODEV; > - > - mgr =3D opae_adapter_get_mgr(adapter); > - if (!mgr) > - return -ENODEV; > - > - if (ifpga_unregister_msix_irq(dev, IFPGA_FME_IRQ, 0, > - fme_interrupt_handler, mgr) < 0) > - return -EINVAL; >=20 > /* rte_rawdev_close is called by pmd_release */ > ret =3D rte_rawdev_pmd_release(rawdev); > -- > 1.8.3.1