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 9E434A0543 for ; Tue, 7 Jun 2022 08:03:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98EAB40156; Tue, 7 Jun 2022 08:03:25 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 6D87440156; Tue, 7 Jun 2022 08:03:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654581804; x=1686117804; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=poQldQHI4wA8ZlcyA+fmNFx3ovu8/PSJHBCKDi8yEuM=; b=EYqSmN5byNyluem3jnKFA64DY3+A9tD9yHIsurflyE7hnh8ZYLNdofVZ xyEuu7eo2U7igmaKujTGaSU/xPdkiuDSBd4VXL93ItDzW7/ebvnQ/tqev p9CmR3dsAORK9DaQiB/894q0E+cweqxfm4rg5wIWXXZ5rupGkHXssCiEm kKcOICAiyWhPfHxsvpU0xz33AGtMRpdrjOjOEU54+TFQH0ac5c8HiqWlI zMwrHgZIIdW8XgMRZIT3dULOoTSyBm+5H92IY11/ZkJ2tyg3NM2evcGB7 EBA6QTK9FkqGNGCM8sTUvDS4z3uJLteYgo19AjGit6m66ZdrAw7PeKT/1 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10370"; a="259343662" X-IronPort-AV: E=Sophos;i="5.91,282,1647327600"; d="scan'208";a="259343662" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 23:03:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,282,1647327600"; d="scan'208";a="584028644" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga007.fm.intel.com with ESMTP; 06 Jun 2022 23:03:22 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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; Mon, 6 Jun 2022 23:03:22 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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 via Frontend Transport; Mon, 6 Jun 2022 23:03:22 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) 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; Mon, 6 Jun 2022 23:03:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hu3/JhCdFS93EmTTFKIpwQ/gLz64c234q9MgmY17RXWDtEXCVV1J/q+qUSyidhOVOk1UDX7NpTiehIE+r53DwqPN13KPFIyzgWOqvOxbaGa/WK5YOeHtqHlVhlVQ6BrfpRZtt3H5826a8I2r1J8xtaZNNNGJ5Tolq6ri05NtOHfAxoQJGfoJAkzDh3bTqwf61n/CeJ+u6Q+eFr/ygAi/AvIbdWcKrfq0G5AOluDiIhHYqddo4VVAnyseZ5/9K4V4ZTpBe3QMAWaFlYCM9/sVutPveC84U+g1H1MX+y18q/FPhsWEktOZjsabgJoo0iOYW62hhCiyICCBCFhzOOxUmg== 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=k6SiCZWZWbOegbpFuPvfW2/xIfvVxVcqk0bEBWMEfwc=; b=O9FPvP9vpiASNAdwe1k387Bs43ToACnth4++Lwwcc8foLBAZGaaCyJ38IbqgYFr9rquCwgV0qtA6Sopwc+em6GeTjXUa/z3XoxHu8tqiQ0IfoEBK6KwN7VFsjg3+QVxMeuk0xHVy2HNBarDljHLoz9zt9QsktBYsTwX5B6WNk18GIMveoBAzPjDOjlXZ76nnWjiMYeaPJXKAxsZn7Ej/csmNUhzymiRAau9lmpnLlfgFxsFSioefa7HUA8ZlHTVLy/WDapMxiEiH2ZGgnVaNlq3mhlZzIigoEmOQoNhAUelaqbwycICCg1IfTW7mFWRKcwtP6PhSFkK3i67QLuV4Dg== 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 BYAPR11MB3685.namprd11.prod.outlook.com (2603:10b6:a03:fa::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Tue, 7 Jun 2022 06:03:20 +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.5314.019; Tue, 7 Jun 2022 06:03:20 +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 v4 3/5] raw/ifpga: unregister interrupt in ifpga close function Thread-Topic: [PATCH v4 3/5] raw/ifpga: unregister interrupt in ifpga close function Thread-Index: AQHYcaOHa46TFuoaBEWtoaEnSAKm2a1DhT2Q Date: Tue, 7 Jun 2022 06:03:19 +0000 Message-ID: References: <1653535974-1379-1-git-send-email-wei.huang@intel.com> <1653640433-5066-1-git-send-email-wei.huang@intel.com> <1653640433-5066-4-git-send-email-wei.huang@intel.com> In-Reply-To: <1653640433-5066-4-git-send-email-wei.huang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDA4MmVhOTktYmFmYy00YmZlLTljY2ItYjEzZDEzY2JjZWE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQkM3dHBDbzlaU1RkRzBjR2s0U1wvWHpOSThiXC9oYmRVOUxuaEY1VXlXdGxzU0xFSFVlNXhoVzJYT1ErUWFvM2tWIn0= 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: 7f330cb4-32df-4260-18b6-08da484b6c1f x-ms-traffictypediagnostic: BYAPR11MB3685: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: Xd+00YvTXU22ZCguqQlbULNbfma7hVfzB3iwTEGfG2tWw7ixPa+RAKmD938hcfI6w0nCMgKm/O1Ix88+AK/M0ZdhVPwz+py0CXUeisGriyfzSJ2qEt+ZCNy847SYyp2zCUg58K1nI4N6IYqiJ7k9T6pegVpvKu+4f608QGzK0dMZx3yxSKBZCpe8CQ8uLFugClzvrFKxBamYRjaveF0bAP+g/jr+L9WepIIHOVSV8mpsbEIO+XFtNDtMaJwBZjcU0jrJJzAlqfqV8tUIJZb58DEaYJB3qYgl96QJJB2q12hIgBiY6Q38JUjWlYuDIih+SVVgQFzmf0MAHmJVFrWXhznzaYvFdDbq3kc18a/g9BoADuj77Wh4zNvZCu9P8fHSpX2y97OWZ7Lj8wTZFhmLUXw151qZkGOJ1lw9k3TuzC9TGVaMH1GBDkfwKQQkrWWD47bxMdoy5uYqz+1h6ylaCcjLyDc4xoZ8FAlN3RtSnYcxw7xdR4y0uBm377VNVIrTG4PpT1H62v3uf+CQ017YLSzHi8/+m6SoqAInlI0bejI6/Fwcd6fbvMWLzPduWOSJ1JkYqWsCh1I6s8NFZSyOFuu7OEHld8v0PGUO72W53All0KTlv+NQl3lACBHSdhP2/xnnO24vaSSshrdMHO4va0v5IzlgoJMyXUhmIqSoChzC+KjMr9SHUEC0+hc508DYGdiXSpZ48HJipCWKhsAdgA== 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)(8676002)(4326008)(76116006)(5660300002)(52536014)(53546011)(66946007)(66556008)(64756008)(66446008)(66476007)(71200400001)(38070700005)(508600001)(83380400001)(8936002)(7696005)(82960400001)(26005)(86362001)(9686003)(122000001)(6506007)(186003)(107886003)(110136005)(316002)(54906003)(55016003)(38100700002)(33656002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BtAaoCOFoFRNtHILJR/EqS6Q7DQmXEORt5W7zNsZC/hvs915EFYQo9TElkIh?= =?us-ascii?Q?pQnr4Y5xsAiJP6Rkm/Sv6TDrc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=?us-ascii?Q?BiI/6Qvye1QpPntcb7ZS0wEhfIK6NRcbRNqN3TX6i3otACGp+MiZOPlIYyHi?= =?us-ascii?Q?Tu7T4SWM73ewtmpsHWclt+emoNYXubgr3zM3ENUXWfPVUaUTXPPffnV5v+Ps?= =?us-ascii?Q?SuFIe237gbdaqYk9W9AqDUe4CivjAr1h1SQ7wQUGgrP3jvzBAbAPkOOaL7e8?= =?us-ascii?Q?zPffAkblr8wgAPBe7BU4E1Bs8PgfDsZJ75H+1U1JotE3sfVFJkGRKjkeyfET?= =?us-ascii?Q?xlICGCuwNbcTayihAA6QREWTmNgre6P1gnwPzpVSb5XN1KD80wucKtIQ3wvT?= =?us-ascii?Q?LBlhnGVBhw1D65DP/6kRXjH4s6YiltXoZtFxxZiGcSg/Crm6+mH1jH5bnPhk?= =?us-ascii?Q?appa6ehSTVg5Zv9+Y3kmhFxSgG7zlEMne+uELPQXVYMlSg5OQPykJFz85lYN?= =?us-ascii?Q?1dDHaiGQGvpO8IOhh+BZWv82MMcgKtKfiauC96jk2tlxaNqyUda3c/kL2MBb?= =?us-ascii?Q?4BxyX9GCAns5GO5IsroxDGuNeVOmye8XOg5Lo23NO0/lwkHiCu9Iz2rWhGtc?= =?us-ascii?Q?3M9Bl2JM7cxIwA6Q1svIFJ0Lq5UgyVs2Ezt/D+vHXQirwFiYq3t6kXfFSnr9?= =?us-ascii?Q?8jJoJkNrMrSuuzHLDaKAetYWfMJEr1FMkm7LjLYaRhQ2cmxO7R0G8g3GoxwB?= =?us-ascii?Q?9NtrJJ6k6RNFAujADWnm/vE1fpD7QvIfNY/yeMiLlKIEfKkMPqxnfAifs2J9?= =?us-ascii?Q?u3Gp0ZQdp9QBHG4FqPuJG0lC6ddk2yRKCHdgr4xmA8vm6Aj6eqWlhhHrM9VS?= =?us-ascii?Q?PPwJ3GPFhw=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: 7f330cb4-32df-4260-18b6-08da484b6c1f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2022 06:03:19.9445 (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: uNuar6czDYte+0JTZjYZALVgue+JYd9sc4XJSrve4sGB7HO2C+FvdzDuC9fjN/wFfDMY5RpLm3PUQBNw/HDnpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3685 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, > -----Original Message----- > From: Huang, Wei > Sent: Friday, May 27, 2022 16:34 > 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 v4 3/5] raw/ifpga: unregister interrupt in ifpga close fu= nction >=20 > There is an API rte_pmd_ifpga_cleanup provided by ifpga driver to free th= e > software resource used by ifpga card. The function call of > rte_pmd_ifpga_cleanup is list below. > rte_pmd_ifpga_cleanup() > ifpga_rawdev_cleanup() > rte_rawdev_pmd_release() > rte_rawdev_close() > ifpga_rawdev_close() >=20 > The interrupts are unregistered in ifpga_rawdev_destroy instead of > ifpga_rawdev_close function, so rte_pmd_ifpga_cleanup cannot free > interrupt resource as expected. >=20 > To fix such issue, interrupt unregistration is moved from > ifpga_rawdev_destroy to ifpga_rawdev_close function. The change of > function call of ifpga_rawdev_destroy is as below. > ifpga_rawdev_destroy() > ifpga_unregister_msix_irq() // removed > rte_rawdev_pmd_release() > rte_rawdev_close() > ifpga_rawdev_close() >=20 > Fixes: e0a1aafe2af9 ("raw/ifpga: introduce IRQ functions") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Huang > Acked-by: Tianfei Zhang > --- > v2: update commit log with Tianfei's comment > --- > v3: update commit log with more explanations about the function call > --- > 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 Reviewed-by: Rosen Xu