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 46B6FA055C; Fri, 27 May 2022 04:57:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2ADB540E25; Fri, 27 May 2022 04:57:38 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id AF77840DF7; Fri, 27 May 2022 04:57:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653620257; x=1685156257; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vVxdNkbIrVorP9iZvxdIqVGsYrqJ7er260PfTZ/HSfM=; b=jPsl3tqqecolDf3rVxf8wM1Vd8D5XUuAp4KCZpRbZRSZFr9omLGkJGZA cwljRwYV8zg19jNWjfV9DvZq+1sIGvc0GFEQwbmMqzZ0zROkSPumdyG5y u1ELCSocjj+A1dx77BzT9dRE/TqGGL1M1zrfhSdBv+Gqb+WUp+gw9iYb/ G+VIxsHCxMXOIfrIAt61TpdrgF6RerD6/dHByPqQTuo3M3oZ3cIMtalY0 wZfdXziYqWh0DWWDKtvGdim22j7AGEOl9h8KbEmCcN96yrGs/ugubCWaE 0i8vWgOzpvTsvOqgxBw2YCgo0m96QUGgXwU591/+2BfUc8nKc8OxuXggo A==; X-IronPort-AV: E=McAfee;i="6400,9594,10359"; a="254855512" X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="254855512" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 19:57:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="704908612" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga004.jf.intel.com with ESMTP; 26 May 2022 19:57:35 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.27; Thu, 26 May 2022 19:57:34 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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; Thu, 26 May 2022 19:57:34 -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; Thu, 26 May 2022 19:57:34 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) 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; Thu, 26 May 2022 19:57:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4SGoX9gEMJk+oex2eHSBGKBgH8obbNW7Q4cg/kbUd3cg3tPSriv8sIKVNlOtkuJYDVpNdVHeAMlrWR+8tzOSWS+rxnjUNV/+SKZLvaoLTNfbzT/3ksTyJfY9eXTACSXc+ltJ6Qi5WZLNTblDSUVVSjO3CnX5CYs/+wkzK5Nt4Rh7qx6cSSgxQMDDy3y152kTRm+QIuaWjQdtMzXOtLXkzuuaj0PI+JL9Y+CagUbZMgr9/3Ue2bzjmwX9M3v+WPEYyUir7c84mtW9VcAZy34ln2FmmbNYSRfZX2TRi6S65+DzC02cQEvQdakohg9VsS1EyR/ZEZpdGo7Yqzcfmz5Zg== 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=13l4Xr0eTZ7xYShGnitg+1W0rd/kuwJc4YJUYk1TqxA=; b=k0yFukpF0Lixr9k/aQ+iUjbeS/yYXuXn9Q6TDWf1YHuiwkHzE4fXTX5TCigwlYbU+IU22KQInXokZFYxfr/Q+oByUhxkbhgSVmt5dBT4G03TNBmfvsWvFfipz+kzxo/VU11a9/j69rnnnHHVxzgsbD2TA1D7R0YWYKDfMn2d/OtH3pvJtB4DcHQJranbaxybJc/Y4To/1YlE1GV2v7tEk6cKwVtLtsEpU88V0RPtZUBCBCJXZi1YYR84ZJs0RSDhpp/7M0iGqWhNjH7Pj5LBv+cFbaTaD9CDnlpl179RY0H9zGYPsbpTXGsNpjWnQH5R+FyCpb5eqEBTBBuKdzirww== 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 SJ0PR11MB5894.namprd11.prod.outlook.com (2603:10b6:a03:42a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Fri, 27 May 2022 02:57:31 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::4d94:5d8b:51d7:d8b4]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::4d94:5d8b:51d7:d8b4%9]) with mapi id 15.20.5293.013; Fri, 27 May 2022 02:57:31 +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 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: AQHYcLBT5gAySvXsdU+XOED3bP7Bma0yCV3Q Date: Fri, 27 May 2022 02:57:31 +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: 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: 50a1a934-3ef5-449e-bb42-08da3f8ca4ac x-ms-traffictypediagnostic: SJ0PR11MB5894: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: 6ByAFZMcu0CoZi0UjyPdypSLn8pOA7XvbcAZq7gM8eLwG1229f0fz8v4dimlUpn0zkK9G3v7T7qz32c3ILjB7vpRzQ7FN3DE0cpOOFTJykjjjUHgySd4Ex1n0Gl1TDYRfZsCme/APjf/KH8R0oi3zcm+sHLng2LFQ7lMLw1SY7gecgSlBpinaF8XzSFK5o0LMjV/rex0ZuUujiwUTz4ff2wtSrlinZ9BvShEutS+omSNQgEbnhw9sWWXVUPPrgndjy0Ruhj09AjxfQzVX2MLpQbRHB06AerUeReTxs++zNLnZCAkaAwIQkKF+J+HBvzoGjPPNdX1rKj0AbYevQKUBl9ZU2r1AIB1KD9s9DqdDpBxzFI3NlqBKIy50ZpyeN0aJKsDIIj2n52roPAafceND/qdS3fZyAWPqEcwLZ63Y/HGQdhpYsMHrBhb4kZua5goranYeQM0uvVCBKne/OKON4K+/zG8ofZl+jHigXr7YMCLnbpUS6YyFmYMRg3vjuk3l83yiA0bK/Lwzbo3aP7n0kILdoHsqg5kk53IobSxiAGF0cZ3pgcNw7rZ6TGM1tDTpCpM6mxhtLmuDvBNrtdLw+3OhukttWyo5J3HfBS0ak0Q7oGVgC7i0k8fiTrFJBPux2G0uik6JYM/G1Ejzp9IUwzaaIF+swT59KHorVPFRX24uCDMw41W5dPLLCRcK+3Pv/ONfmla7/nlSAVo0bb2wQ== 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)(86362001)(8676002)(4326008)(107886003)(71200400001)(7696005)(82960400001)(33656002)(83380400001)(316002)(186003)(2906002)(38100700002)(508600001)(9686003)(55016003)(54906003)(8936002)(26005)(110136005)(5660300002)(122000001)(52536014)(66476007)(66446008)(76116006)(66946007)(66556008)(64756008)(53546011)(38070700005)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iZjylAH+4XP01AltlIQKYDt4e8Put7Djcl5puSOvUBMVIFBDvuDnz/cWfTI4?= =?us-ascii?Q?G2J0VJrYX3YPfWjTa62eycABfju/ppDY6xpy980/6bjQw87eqoWGOMPtVdkL?= =?us-ascii?Q?nkV97uXSuiH5h4U6IUDIpHFem+oydleGImMxmBqWVa88CeV1hnbtC8Ll/G7P?= =?us-ascii?Q?BRwJcgzORqfzZjL8iLJveAZvedlyt8E+mMwp/ypsfz8cl1a1SWfwUlf2V5++?= =?us-ascii?Q?ktUQFPRehzsQ3ISTxD77JuWgq74csxBzsnWh1nqyTfp3y1uS/Q4KzN66ginW?= =?us-ascii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bG7q5glrN3SK/3aF+xF83n3lGe?= =?us-ascii?Q?NzSpIOOOp0Y/pAll67wT9UUnwd84m4RZ9xty0ufmMGx/0R278haX6Yi/31YM?= =?us-ascii?Q?TUBqz3W8M2QCv/qU2pPswyVYsAIy2PrCseSbAX6ZwglcJFZi7FsNWJ1Zo8zE?= =?us-ascii?Q?01xfHSC3d0ygH3UvJ5t1JAmamDnakZDZBYkYF3eam1E5QOxSx9vyRnP5Zr1p?= =?us-ascii?Q?RBcygBOpPryKmxu7j3VNWdA3uOtNiTAf+XZhlSrbuaWniYvp1WfzXdrdL0vG?= =?us-ascii?Q?JoOLoYwwjUFVOyKuJFPtyrFZdSTJsABTztWFS2xcSdSXeSaV9KprBGml+99e?= =?us-ascii?Q?r/HdGvHj34CMjXQ/RCM7OvmgP5B+iaB1fXPAr6Xz1JW5c5gbjiWsKypR4FOp?= =?us-ascii?Q?mlyIJEL0sZYB7BBung1Sfqxh0ru6wM3V3SkjYR0Sl3KNE9j/dLupTQ55bnYZ?= =?us-ascii?Q?MyQi/je/XeFnyEkJQjHTjdNMtM5EDsLsoFFuCk/SbftAY+YWuA4elE4KZjTT?= =?us-ascii?Q?01toViGl9mdU/jSo0lmwcGjwE/4QsIJKSHyyXUikgU11FJMYFk9zOaJ4de75?= =?us-ascii?Q?tovoEhnsqw=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: 50a1a934-3ef5-449e-bb42-08da3f8ca4ac X-MS-Exchange-CrossTenant-originalarrivaltime: 27 May 2022 02:57:31.6945 (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: h98kT2mgZusxQLgDRgSq81tbMkRNpE/g6shppekQltLGXgzaM8YBGMVPbXrdVuB57WropC20Yi5QkwCCx3YLNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5894 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: Thursday, May 26, 2022 11:33 AM > 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_d= estroy > function. If application want to release the ifpga driver resource by cal= ling > rte_rawdev_pmd_release, interrupt resource will 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); > -- Hi Wei, It looks good for me, you can add: Acked-by: Tianfei Zhang