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 D9B40A0543 for ; Tue, 21 Jun 2022 10:12:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC8DF4280C; Tue, 21 Jun 2022 10:12:32 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2075.outbound.protection.outlook.com [40.107.236.75]) by mails.dpdk.org (Postfix) with ESMTP id 8F4CA4281A for ; Tue, 21 Jun 2022 10:12:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TMwaC75qFoNdz7oWAndpuMewPALuosQqNBFfjGYrxk9AUI5j6uMHti3HF/hV3ioBWJSI4Baevy++wvl7oOQR6OsT8I6NEHZ/TQExY29fX3dWq4vvP5JXSvpZFfNFBYynF/YKVau3NLJYzBZ2/6nNHJqX33ZREYYq9fgqamfuvd6BqiMuWUqAFYORd9Wt872Z3W7tRXZpD89jYYJxOJujfx206G5GYN3QwRLcHH4PbnXfWCuriOMfIIJAGagUiCmr8/pf2jZjF/ap+VRuJI7MO2gnvyu6CHX5fgcM8LXJ4miugdFrdRvgWaamHpJtlLog//3JeNaFzY8Tsc9C0z108g== 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=mAKVDn+1atOz1uoOuX9DQdKqdLSX8UsC3X3jM/9Q6Ow=; b=HXYsbSkCVvrd/HyTGIRzP5Qmd9FSYs6ea//WTxLH+IbFPE2cmRdXMRk1cRxjeC2gmFOuVqBD8XFnE9WYob2iEt+AHmegRcNuttli3BpsTOS9Ph0KdwkKC8bAJpTZNheHcR+lg7eu9KCgRoYhGcBEVM4wPRPAmylpl0PeECGY47jM0oNiktEkeQpA7cx0tK38Jp/PeWjTzpsd0AUYr2RWlc+klK7+HPhF8Isf4RDyUrZY7G/3n+WboPLrQAj07WJ5k7gpU0BwVLj8/1MPyUaeadtFqvuAvVULLzpouqzt0ugsHF+b7tSTBxs7cL8yuT1UjlsmJAoRX7G3OS5AMH8nFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mAKVDn+1atOz1uoOuX9DQdKqdLSX8UsC3X3jM/9Q6Ow=; b=kqTfRNH+0OcXOpm1kX+dXrT88RbhkkvWtWCYSSLeXRFPiVUjoJiTtT/MkUDn1oOiX27jsWVHuUuq+8uqgZe2pUd0jyuCeFZ8IkddCFYxatAHcUwUJ7UCKy1EPOwzQekeLnlCpYo1RqZotbomGl5HOlniZWWDmiSkr2szRTCnQVyRdraqHpfj33giQzsPZiDMeQ3p1RlKoFkMjy/ZBB4cahyM3YmiL4n70EYz1unXiXeKLQaBqM8pjfsQpYfB/ws5grispbFLyOw299h1X7kcZToJqw0/fODiflL3K57BUSXBQ+fEtf5Rs1mKGCeFqRJ78kFXoFzFhbjHBWATu8BC/g== Received: from MW4PR03CA0022.namprd03.prod.outlook.com (2603:10b6:303:8f::27) by MN2PR12MB3359.namprd12.prod.outlook.com (2603:10b6:208:cc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.20; Tue, 21 Jun 2022 08:12:29 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::86) by MW4PR03CA0022.outlook.office365.com (2603:10b6:303:8f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:12:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT056.mail.protection.outlook.com (10.13.175.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:12:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:12:28 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:12:26 -0700 From: Xueming Li To: Wei Huang CC: Tianfei Zhang , Rosen Xu , dpdk stable Subject: patch 'raw/ifpga: unregister interrupt on close' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:51 +0300 Message-ID: <20220621080301.2315720-106-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b23050e-cf3b-466d-1e27-08da535dc8c7 X-MS-TrafficTypeDiagnostic: MN2PR12MB3359: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: ToXEZKH34WEAYia0aJEDH7lao4RxEnCSTnRGZK+fNZlQrrBRmn3xGLgi1sCO7f8kVsCpQTZOe5mI9DCZ1O0TKq0ioOB9lGagktaCivZUzMG5XWJ0UMIruZoPx8HtiesELnmIfKyREr8nH7QKG86qikMNKxsrebLbsxTgKR3a49z//lR11HBJEn2Jka04LUeqSJLGPDq0RvWPhTm3PgkuTFELH5BIBE41Qmn/vJ9JSR5Rz/YMbIJWWfdTSLygxHKSXkmMmbm5I2RJaw8ErS361yEVhAbrtBNm355rqi/q85XzB4jCEYXfCLttbqcERddij2WwzJiF8B1IGztRFPDmn2iUBcJyrz8B110WA7VDAQ85Ehyi6W2ocdsBG2hO4//J8pyqFyvVOgjtoh21MeMQQwXIiedE8NMBOSq4CXwFzQng+nt6dN3Hahfn2aqR1x28H5+IgLhr3n+7Zy3UYdgg6ZmuQ6YjF/ezJ+4Iif0GVQoZQHs6Qaw2i5+NPk9JGh7sQZaXmxmPyhls//nEBqbUa8YtUgW1FA6H1WE5DcpfrJfbDSLIXccv5KpETI904St5GVH3KzcXdgDceBCOD33pNOZF0Xs9DbcYqV6mT5eThvitqGSAzZMFXjMhCe+6Tu2M/ABM96q3jR9th2UjEP084NZYUuQlPMaCu3RY+/UuuoqtrPEpvOE+8gENeksy3RhEvJxx5+qXyZt2AtBw6JtFcdqf0k65PtYdRFX02uS/GFlSc35SiXpc00fcB0QtkbulAkrXLxFqBXR+JOk1GlwMhTgGCJrzriSL28X64UjIY6nZgVmi7k6vufbS/uTehxykv99V0kZ0bPfXrpiH2aDfglUUjmDH17YDo2KKScI4Q8o= X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(39860400002)(346002)(376002)(46966006)(40470700004)(36840700001)(83380400001)(6666004)(8936002)(82740400003)(5660300002)(26005)(70206006)(478600001)(86362001)(55016003)(53546011)(36860700001)(70586007)(4326008)(47076005)(356005)(6286002)(1076003)(36756003)(186003)(2616005)(7696005)(82310400005)(6916009)(41300700001)(426003)(336012)(316002)(966005)(16526019)(40460700003)(2906002)(8676002)(54906003)(40480700001)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:12:29.0653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b23050e-cf3b-466d-1e27-08da535dc8c7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3359 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, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/30c0b36a019c910f9f7d2c5b13b044aa40d8de8d Thanks. Xueming Li --- >From 30c0b36a019c910f9f7d2c5b13b044aa40d8de8d Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Tue, 7 Jun 2022 05:07:22 -0400 Subject: [PATCH] raw/ifpga: unregister interrupt on close Cc: Xueming Li [ upstream commit 2545683564aa15f36392be2b4ceead454064135b ] There is an API rte_pmd_ifpga_cleanup provided by ifpga driver to free the 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() 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. 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() Fixes: e0a1aafe2af9 ("raw/ifpga: introduce IRQ functions") Signed-off-by: Wei Huang Acked-by: Tianfei Zhang Reviewed-by: Rosen Xu --- drivers/raw/ifpga/ifpga_rawdev.c | 33 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index cc6223cb28..2d7f1af51d 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); struct ifpga_rawdev * ifpga_rawdev_get(const struct rte_rawdev *rawdev) @@ -736,18 +737,30 @@ ifpga_rawdev_stop(struct rte_rawdev *dev) static int ifpga_rawdev_close(struct rte_rawdev *dev) { + struct ifpga_rawdev *ifpga_rdev = NULL; struct opae_adapter *adapter; + struct opae_manager *mgr; + int ret = 0; if (dev) { - ifpga_monitor_stop_func(ifpga_rawdev_get(dev)); + ifpga_rdev = ifpga_rawdev_get(dev); + if (ifpga_rdev) + ifpga_monitor_stop_func(ifpga_rdev); adapter = ifpga_rawdev_get_priv(dev); if (adapter) { + mgr = 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 = -EINVAL; + } opae_adapter_destroy(adapter); opae_adapter_data_free(adapter->data); } } - return dev ? 0:1; + return ret; } static int @@ -1599,9 +1612,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) 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; if (!pci_dev) { IFPGA_RAWDEV_PMD_ERR("Invalid pci_dev of the device!"); @@ -1621,19 +1631,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) IFPGA_RAWDEV_PMD_ERR("Invalid device name (%s)", name); return -EINVAL; } - dev = ifpga_rawdev_get(rawdev); - - adapter = ifpga_rawdev_get_priv(rawdev); - if (!adapter) - return -ENODEV; - - mgr = 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; /* rte_rawdev_close is called by pmd_release */ ret = rte_rawdev_pmd_release(rawdev); -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:53.904207763 +0800 +++ 0105-raw-ifpga-unregister-interrupt-on-close.patch 2022-06-21 15:37:49.221118569 +0800 @@ -1 +1 @@ -From 2545683564aa15f36392be2b4ceead454064135b Mon Sep 17 00:00:00 2001 +From 30c0b36a019c910f9f7d2c5b13b044aa40d8de8d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 2545683564aa15f36392be2b4ceead454064135b ] @@ -29 +31,0 @@ -Cc: stable@dpdk.org @@ -35,2 +37,2 @@ - drivers/raw/ifpga/ifpga_rawdev.c | 29 +++++++++++------------------ - 1 file changed, 11 insertions(+), 18 deletions(-) + drivers/raw/ifpga/ifpga_rawdev.c | 33 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 18 deletions(-) @@ -39 +41 @@ -index fe3fc43abe..94df56c90c 100644 +index cc6223cb28..2d7f1af51d 100644 @@ -50 +52,3 @@ -@@ -740,8 +741,9 @@ ifpga_rawdev_close(struct rte_rawdev *dev) +@@ -736,18 +737,30 @@ ifpga_rawdev_stop(struct rte_rawdev *dev) + static int + ifpga_rawdev_close(struct rte_rawdev *dev) @@ -52 +56 @@ - struct ifpga_rawdev *ifpga_rdev = NULL; ++ struct ifpga_rawdev *ifpga_rdev = NULL; @@ -55,3 +59 @@ - char *vdev_name = NULL; -- int i = 0; -+ int i, ret = 0; ++ int ret = 0; @@ -60,3 +62,4 @@ - ifpga_rdev = ifpga_rawdev_get(dev); -@@ -756,12 +758,19 @@ ifpga_rawdev_close(struct rte_rawdev *dev) - } +- ifpga_monitor_stop_func(ifpga_rawdev_get(dev)); ++ ifpga_rdev = ifpga_rawdev_get(dev); ++ if (ifpga_rdev) ++ ifpga_monitor_stop_func(ifpga_rdev); @@ -82 +85 @@ -@@ -1629,9 +1638,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) +@@ -1599,9 +1612,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) @@ -92 +95 @@ -@@ -1651,19 +1657,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) +@@ -1621,19 +1631,6 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)