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 6F5D1A0544; Wed, 25 May 2022 05:26:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19C1F400EF; Wed, 25 May 2022 05:26:47 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 5BAFC400D6; Wed, 25 May 2022 05:26:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653449204; x=1684985204; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7w+sOalSR1it2m5cl9vGKv256hSfTPRX93jAjTSrz98=; b=AVmoC221jXJOzfb64ypUclIsPdDIuHPUulH0w5ugvOgx60inusGuLLBw 18SakURUMCN1KGGObfdE9lydKf2IansLKlzWzYwGxuqRBREXA0SmD/rwX 6cd/njPh+qKt+1D+8EwLrQAhXQAlB0R7vS5G4zfn7+R7RKzwc7uJ6h/L2 K9ke6lqaLKgFGMy7OQM6mX2W7iWbxMK7d+0jv2WrpVrLi9s13et7pwlTa ALHTYh2SmaOKUfBB4/i7vtF0BnK6sqbdiJrZl1gJL9wodnx0vbfcgZIpN xG/62n5J/U2fAABZhCIGnfURkLZRgTQKIf2XZ+BGfBOqQ1ztp0qxTN9qm g==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="273701679" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="273701679" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 20:26:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="608939941" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 24 May 2022 20:26:43 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) 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; Tue, 24 May 2022 20:26:43 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 24 May 2022 20:26:43 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170) 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; Tue, 24 May 2022 20:26:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EU3pGysQhi4MtAvGH5IzYujyiyPyZUwrhRu42ht2/Q+6Pv5k6xSlqpYBWmUAVM5N5nRAq9xEMmhyMRfv2qlpyGD/cignAfseU67iSIn8yCrddhClEZXL3fut2VqHxC6XHAIvZrxDxvCpPBrFuu1aKIkL6gnK89blT9UlCi09XJfqQrBpZI/rmxHdYrf4qzfaj82dADnoYFziduEKCj8KJt7VIuyqRqjITxSve7hF8s0vwBzyE7mQYloMstK6i7Iz/SrOEYeuKt601PAP7p/DkfCoFC39ToUiTJjBACWUuC2OKb6KWYZDXH53PS09KrFzU7a3xH4gREmzLLDVBbFsEA== 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=Wz71WqMBiLxNFqBi6Dp/DBmtNG05KQ4xrqWBxyaKIR4=; b=BU2C2Ql6hHGFgmO1CwToWA/4jal7/QTWYleQmX3CK8jeaJ1vcF3psgQJ5Xzco8uJ6Ey/4g5kCRz5mtmVKm/zkav/o4heyD3M+TEjCuUpXpBoBOSdrunUqyt3ew97ppqgSCPAKVaEEzDJfi1vkkwX7IfOxOLDWQMB6rp3VnCLRiGpUF8+7ybzuURqF/KB8GHQDqAtIPAPQitT+pV1JBeluImkS1AidTZfV3JwV48NhJnqwGRf8u3YrPdX95pwPl83VDFtjruBdniDoZc1WIUAOkbhbenXFYkKBvQnCHDR80VZc2L4e0NpijsjPymf6t9j09lPqKV4+rB1yGqyDCKfmw== 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 BYAPR11MB2982.namprd11.prod.outlook.com (2603:10b6:a03:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Wed, 25 May 2022 03:26:41 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::4d94:5d8b:51d7:d8b4]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::4d94:5d8b:51d7:d8b4%7]) with mapi id 15.20.5273.023; Wed, 25 May 2022 03:26:40 +0000 From: "Zhang, Tianfei" To: "Huang, Wei" , "dev@dpdk.org" , "thomas@monjalon.net" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" CC: "stable@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" Subject: RE: [PATCH v2 3/4] raw/ifpga: unregister interrupt in ifpga close function Thread-Topic: [PATCH v2 3/4] raw/ifpga: unregister interrupt in ifpga close function Thread-Index: AQHYapBsUkFC1nSjUEiFZpwVitpvPK0u+Qqw Date: Wed, 25 May 2022 03:26:40 +0000 Message-ID: References: <20220517062854.1161727-5-wei.huang@intel.com> <1652862549-13131-1-git-send-email-wei.huang@intel.com> <1652862549-13131-4-git-send-email-wei.huang@intel.com> In-Reply-To: <1652862549-13131-4-git-send-email-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.500.17 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: 29298a7c-8947-4ff5-00e0-08da3dfe627c x-ms-traffictypediagnostic: BYAPR11MB2982: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: BFvcwOHH6MxxoKJDTgz58oOBkRWPHEwocuZVZVkUlBIj5FqF4ooN/8i37QiG78bHyk4OX4u7oHFHJKtFFMVZZXOQtsrlk80rOsMnA/+z+eNdGmyUqhT+3tRvsRz+ShhBEnxoerGi/4vHA1uca6tNqhFmEPq+uEUF82mkQFrIaniysF0/5MvkDMeIDZY6uGwZ936TX0sEzM0jpY7ATMoFQlIcp7z2UgvdX/X+AvPg+lqnJmCdCwAUKHYfQSfYiJ90+mSLYudd+U8kloMmsr9Kj386PvvXJabJXKl7dsdWrLxnV3DPXQV6ESZOnOOdknXbjgcbLVW1Q3IfZYeI3EOtwgC+lsfZSNIwZD8QJCD9PFXqt1uGEeCUS/lLkjE1K1hs7so/E8s4St2uhhkFamP/2QCJr6s3kMGw0AYj7slwwzxPDUTLxGSMULMRN7QGTqA/YK93nUbfieJy86MhtmTIjHq0+h4oqYclpUAR1N0FGS2aDgVxZbIqBfxWOMn7Wzllok4gRHIdmqW9U0+UVJkrvEHUtvM+l+M5d4CJa230HIw2M5tWJ0PK2lwc+OC7Xc0xTrV6kH5e2QxE7VXaX21ROROZRj1maPnJOhYtNnzFhirKfKdYI6kw/s0mhA/5nnIodX9UBmfr9+f9M5VqgQ/BZS9vwjJTf84zwa63soWYRwQ7VO0fPDhworBrvfBeOvFevqOJrtMbH6BeKvu/tpSgoQ== 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)(8676002)(122000001)(7696005)(316002)(38070700005)(38100700002)(4326008)(110136005)(9686003)(53546011)(66446008)(66476007)(82960400001)(64756008)(76116006)(6506007)(186003)(66556008)(66946007)(71200400001)(83380400001)(54906003)(8936002)(2906002)(33656002)(508600001)(26005)(107886003)(52536014)(86362001)(5660300002)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?CQPQJHs/7/4fNVxOaA9YHpkZXbHrTKspgIvClRWUO2YVJ8DfwptEFaygEsOn?= =?us-ascii?Q?VAjmk6RnulPxlKqT+TzNAi8CUaDYZ6iUihV/5m+LYDm1dLajAv9PzamBf1/Z?= =?us-ascii?Q?ijNLP1eYWrYnBRw5kG/H+5zVC3RquGRxsidsZABzexx7+0xUvkp4/9kZwYwi?= =?us-ascii?Q?eLyOBxsD+v3rBiNc8yVegNOfnHEBkujE2R7TgmqmpcTgITR1F+wUGVSRqDLb?= =?us-ascii?Q?0k4xZkAwBOe5E7p6kkB7isnbpRLqO3KOG3SoQzQJWpqZ8Gu1bzVsMgwY7wqU?= =?us-ascii?Q?slvig/CCI16aZBiDp6TSYGdUAxdDUKYWrKXLnQ2wEMQr4D3MB9pjLoomkZDv?= =?us-ascii?Q?jt8rPhL9cO+ALKPRReI4GIx9/fZiM1m+mge/NcSFXSNA+5GjzGfZBPjRqCEJ?= =?us-ascii?Q?/kVrmOkmyvySaOvP6i/EuPKUMJusuyHYYJlU6WbH6mleRjpN3b6Co/RZBke9?= =?us-ascii?Q?baaL6x2OvGal5W+XGSBc1pFh2s0+mpoOB7JDze3QzVfwHzA3mQWIq4b680tg?= =?us-ascii?Q?jkNfDet6bjGh/XEunhsK30KrSRTAKGIg0NAwzlqFut6GayN1yGBKx0Wgd10y?= =?us-ascii?Q?K+RCKJjnVOPkmCalI5+0NbULs6MATiuUaKwk6ydihGUJLXEYAklDxToP8g2W?= =?us-ascii?Q?SRi+LrJffMiRlXDJ+z6F7sGI7m2GqhYRDYelfcpIxYkaam/uZCxnyeL/yST1?= =?us-ascii?Q?Bib07T3St1vp5EonHBi7AmRaNR31Iphj6atLEA5DF4SX2wLAtRfilJu3Zway?= =?us-ascii?Q?YHuRzV1tYw2Q7FifGESr26Bz2hW0vxFvYj9dzyKWa2tu7S/0GyZzeIV3G23S?= =?us-ascii?Q?aaOweJ5oCmhPuiO9aux2TEpcoUUwcneoGkyxeYFqx0rKViRBwikyv0Y6uQnz?= =?us-ascii?Q?H1fhY8Mg5mNXk/0Xu3poQYxGInt/Oxv0vQTFJ4XgG13z58z4Y8/ZTwJRN5QQ?= =?us-ascii?Q?sLP7cvlvemcyFbe/SSYW8K2K0hn6NATjMxc9mVhbF8L1zE4TomXxFYyxsMNl?= =?us-ascii?Q?c7MwYuof9q3sofVvQahalilCe/vl0wOO7wecppPdQoTFNx8HNQsM9nzwNqoQ?= =?us-ascii?Q?yOfkk3oWTC2GjW2tEzCmxxJ2XsMRDihKFIyw20VRKy9Ch008AS8mRChfitzU?= =?us-ascii?Q?ayn++Z/DceOIYrCeHqzuupu6T3JvNEujFp5X7+unN/VrDmx0lRf+D7xKktPP?= =?us-ascii?Q?lrzzH880JSStcJDdjW7O1q32uxq5xt0eaLPW7+Bcb2owNT7o1QUK0P/7+M98?= =?us-ascii?Q?1jitBUlZnsY6cNhFEjcHL0X59aO5e64tSj35ga855bnJJjA7cX7cm+zfhBXd?= =?us-ascii?Q?i+K5LuBt8CyZ0m8KdMIBegpNe4itLiL80cjrHrvck5O1CgwJA/HlHSkXAzGq?= =?us-ascii?Q?J/8YNAVc/bGgqwtbt+eWO8U2VEyfO1IYGLSMOM53/B7hr2xDwinpD+5DX7jg?= =?us-ascii?Q?PNStBg8WqRM2BJ19qBjL8Qj4bNnkOWfJj08xVuI8tSafUdjR2Hg7V5vWakG6?= =?us-ascii?Q?ZLNUnwX7fzkpcR+IyIZL2KtpzwwsIiR7ul5EkEQqe/hJ/k5Ipaes8Ghc9twd?= =?us-ascii?Q?dptaSvTEwHYiQWo07Ah0Jd0sXJvrycZCiZt5MrlFlffBHBVlK/zqpd7o6sGK?= =?us-ascii?Q?h2k97LNMla49wX7EMP/VmGmfP4Tg2qgFiB7Ho/tK6y6/p4/Oxnn6VpmIXCza?= =?us-ascii?Q?LBAGhwwVlk2LMe39HzTjy4B/GqqjdoCIcgumjIMzzd4leXYS7skGwUvaRXGs?= =?us-ascii?Q?YEl1lkzMNA=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: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29298a7c-8947-4ff5-00e0-08da3dfe627c X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2022 03:26:40.9471 (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: sCUE9qusO5cMiWfCTpyUxpoAP7/owfGw3MxMFn/3IM6iSXdEWokrUFwinPheHUIoYDRbp/WOOBBLYpJJx776Rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2982 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: Wednesday, May 18, 2022 4:29 PM > 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 v2 3/4] raw/ifpga: unregister interrupt in ifpga close fu= nction >=20 > Move interrupt unregistration from ifpga destroy function to ifpga close > function, so rte_rawdev_pmd_release function can release interrupt resour= ce. It is batter that you can add a little more explanation about why we move t= o ifpga close function. >=20 > Signed-off-by: Wei Huang > Acked-by: Tianfei Zhang > --- > 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