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 A82A741D8D for ; Mon, 27 Feb 2023 08:07:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1202410D3; Mon, 27 Feb 2023 08:07:54 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.48]) by mails.dpdk.org (Postfix) with ESMTP id E3810410D3 for ; Mon, 27 Feb 2023 08:07:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=au9ulfgUz+X7iIvP6wfDh4kuQcVSDObLzKgDM7LH8azFpNsuIbGWN5KeRNP0azeA8mZu7PWYpBiLTNtnrC3wgXTDxizwKFHRkJAJVYbVcxYBn9KBVaENMsVi2fhDp2wHK+PKeoHy6I94eGWTIgkeKHd5LQrDP62C+kiHpt36+VypaVzcatZCkV4R1OS9XTxK4OriIe+LHuV0QfYzVSblWR/IpPQ4MnuJTJ8vcCBwk5ViGkrUsvAtCjCktqhrbBSDKCdDgUUS2pHhts0ymvf+/OTv956UYZYypAp0sGOImK1c3viAWYmfC4h0yovwNZe6kqrxfOEkb4rnfFcNeTfK7w== 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=FNjFoKuHQa8QEy8v9m9/xUxNGi954tcAO3gTK5Y8vYY=; b=ADlW+o/rlGAJHlyjfw1dTOFbU66wTqcq7pQG3M70Tbmp6e+xSkAkCQDimGXUO5lrAJ3BSehA4p0oy55ivUCSpNfsJs8/LiDQSm94Tu4B7kASl98FLbL1vBJC9Xksw9F2AkB+b37CgSGV8OSVKJaUP8UNbDJ6ekzbBTmFVwnEXA7+K8pDS5k4XwW7IIjEcLOsHhwBIR3qvuX285YU3wP0aQgcwugyhqYRDbzIu4HJOQLBbxIrGHV70Wo0/Y5acR/hywfGB3IIFztmilDKMHY+ik5r6w70c1CBzoJVQi1m+p2aeifUnB32tPzkqhJoRLOuaAs/KshUxiDepPp1wn4oDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=marvell.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=FNjFoKuHQa8QEy8v9m9/xUxNGi954tcAO3gTK5Y8vYY=; b=qJLRMC+w9zI32IHIh2kowKK/VjUeYGqxaauOMwhClHOjC7rS3KP1hWSnv4GZu8fLSz0LCC/4LiYYGnEpE2NiwBBYdpq674k88OI2Ne3zaLapdriYbAq/WZW56j07yEG80dNymNldSmm4ozN+izBTXDBYkPvpDcQIBJLH0UtdUT+MEXN89M38j0ODmizzhzACuUKXtfmogGiuauDcEVsYYmweQtr27Aver5WbWnyf39nch9Eg+3/IXxr7Da0ARv8e9uKFUSlyVJ0azesn2xYg+N020G9qqyk8oncpn0a6igj9MzW0F2SoKHkQC2W+2YnvnodYuwCneB6XpswzEyywFQ== Received: from MW4PR03CA0009.namprd03.prod.outlook.com (2603:10b6:303:8f::14) by PH7PR12MB5951.namprd12.prod.outlook.com (2603:10b6:510:1da::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.27; Mon, 27 Feb 2023 07:07:51 +0000 Received: from CO1NAM11FT112.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::dd) by MW4PR03CA0009.outlook.office365.com (2603:10b6:303:8f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:07:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT112.mail.protection.outlook.com (10.13.174.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.16 via Frontend Transport; Mon, 27 Feb 2023 07:07:50 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:07:28 -0800 Received: from nvidia.com (10.126.231.37) 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.37; Sun, 26 Feb 2023 23:07:25 -0800 From: Xueming Li To: Michael Baum CC: Akhil Goyal , dpdk stable Subject: patch 'compressdev: fix end of driver list' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:59:26 +0800 Message-ID: <20230227070107.15664-58-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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-TrafficTypeDiagnostic: CO1NAM11FT112:EE_|PH7PR12MB5951:EE_ X-MS-Office365-Filtering-Correlation-Id: a587bc4e-19cd-4aaa-9de3-08db189156a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q0ErTRpTv21WcaxesLoTBxl2AceC+s+NNrrOXW9L+o8PYn1AY66v5bmQjIU5tqzMyPR5IrmKk/piKo8EaiTY4+icG2vk9QgzUHVcV0wL6Bact6btj1OCPKClFGB8ClwCYL1a4j/zXlFg66Z+vLocln4H9uYXhFnkOojJMZQk3ETAmuCviWJ70MNHEmszDW64SffYSAea5zWd426+SwJxjMvHqSkENFC9aFmjsDjOV2ckPXu4FecdrI3hPGwy3uJxp19gb6q1D1+t/X0ozF+PSw09P+Tm+Jgn5NRIpIO/HKzbx7GFPAP/MdbR0CE7JCyY1o4/+mo8v/yiUE8cnMlmP5z6sYuJ1u57dMdcKG4nyLZ/Udp281nzy5GlFeaznspQJNC3uoLTwkiHQ17HEORmOvBaREYu1/nuk0yLDaLHQeTGX2gHWKYA9siFw1pJE1Bsq2A0eVrAkaGHAn5vEzb2rL6OrpikekQQJK7gDoo+bVT31Wn28bG9U9t75YJLHMns22IqD15uiDoaJylvNKU4YH5sOLAwVEZ0JVPSYKRxBk9HwEkFyDnfNvPn0aHvoQdyAmpveb6yaQt/KRrq5/KZL2eaM8ut5XHP7okGSbO7QqGCpHBSz/Zl4d+zDDYLpF5zqqfvsY1sJtug2Rla1jrIbpIeJpVsjj+cIP/CMhfL0JbMdkZNFuCrjIbc691QMmLXa9dxYdeMitPcd0P0ykKTRwxiEgQyZId+f9wcITQ9YM0QFT1yOlWBJyxgsB1Y2ro0S1Z/LKUv5mYtKoEXRXhKtk0XGPCwzGXMJDwwraoobu2V/EcBz90126iwPNhmT6du X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199018)(40470700004)(36840700001)(46966006)(70206006)(70586007)(4326008)(83380400001)(34020700004)(41300700001)(47076005)(36860700001)(426003)(82740400003)(336012)(54906003)(316002)(6286002)(36756003)(16526019)(8676002)(37006003)(7636003)(6636002)(6862004)(8936002)(5660300002)(356005)(7696005)(86362001)(2906002)(966005)(478600001)(53546011)(26005)(186003)(40460700003)(82310400005)(55016003)(40480700001)(2616005)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:07:50.4226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a587bc4e-19cd-4aaa-9de3-08db189156a3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT112.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5951 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 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=031b48d67099780ecfcdcedddf414592010ab11f Thanks. Xueming Li --- >From 031b48d67099780ecfcdcedddf414592010ab11f Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Wed, 1 Feb 2023 17:35:30 +0200 Subject: [PATCH] compressdev: fix end of driver list Cc: Xueming Li [ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ] The "rte_compressdev_info_get()" function retrieves the contextual information of a device. The output structure "dev_info" contains a list of devices supported capabilities for each supported algorithm. In this function description, it says the element after the last valid element has op field set to "RTE_COMP_ALGO_LIST_END". On the other hand, when this function used by "rte_compressdev_capability_get()" function, it uses "RTE_COMP_ALGO_UNSPECIFIED" as end of list as same as the "RTE_COMP_END_OF_CAPABILITIES_LIST()". The mlx5 and qat PMDs use "RTE_COMP_ALGO_LIST_END" as the end of capabilities list. When "rte_compressdev_capability_get()" function is called with unsupported algorithm, it might read memory out of bound. This patch change the "rte_compressdev_info_get()" function description to say using "RTE_COMP_ALGO_UNSPECIFIED" as the end of capabilities list. In addition, it moves both mlx5 and qat PMDs to use "RTE_COMP_ALGO_UNSPECIFIED" through "RTE_COMP_END_OF_CAPABILITIES_LIST()" macro. Fixes: 5d432f364078 ("compressdev: add device capabilities") Fixes: 2d148597ce76 ("compress/qat: add gen-specific implementation") Fixes: 384bac8d6555 ("compress/mlx5: add supported capabilities") Signed-off-by: Michael Baum Acked-by: Akhil Goyal --- drivers/compress/mlx5/mlx5_compress.c | 4 +--- drivers/compress/qat/dev/qat_comp_pmd_gen1.c | 2 +- drivers/compress/qat/dev/qat_comp_pmd_gen4.c | 2 +- lib/compressdev/rte_compressdev.h | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index fb2bda9745..459e4b5e8a 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -96,9 +96,7 @@ static const struct rte_compressdev_capabilities mlx5_caps[] = { RTE_COMP_FF_HUFFMAN_DYNAMIC, .window_size = {.min = 10, .max = 15, .increment = 1}, }, - { - .algo = RTE_COMP_ALGO_LIST_END, - } + RTE_COMP_END_OF_CAPABILITIES_LIST() }; static void diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c index 12d9d89072..3a8484eef1 100644 --- a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c +++ b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c @@ -26,7 +26,7 @@ const struct rte_compressdev_capabilities qat_gen1_comp_capabilities[] = { RTE_COMP_FF_OOP_LB_IN_SGL_OUT | RTE_COMP_FF_STATEFUL_DECOMPRESSION, .window_size = {.min = 15, .max = 15, .increment = 0} }, - {RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } }; + RTE_COMP_END_OF_CAPABILITIES_LIST() }; static int qat_comp_dev_config_gen1(struct rte_compressdev *dev, diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c index 79b2ceb414..05906f13e0 100644 --- a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c +++ b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c @@ -25,7 +25,7 @@ qat_gen4_comp_capabilities[] = { RTE_COMP_FF_OOP_SGL_IN_LB_OUT | RTE_COMP_FF_OOP_LB_IN_SGL_OUT, .window_size = {.min = 15, .max = 15, .increment = 0} }, - {RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } }; + RTE_COMP_END_OF_CAPABILITIES_LIST() }; static int qat_comp_dev_config_gen4(struct rte_compressdev *dev, diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h index 42bda9fc79..7eb5c58798 100644 --- a/lib/compressdev/rte_compressdev.h +++ b/lib/compressdev/rte_compressdev.h @@ -353,7 +353,7 @@ rte_compressdev_stats_reset(uint8_t dev_id); * @note The capabilities field of dev_info is set to point to the first * element of an array of struct rte_compressdev_capabilities. * The element after the last valid element has it's op field set to - * RTE_COMP_ALGO_LIST_END. + * RTE_COMP_ALGO_UNSPECIFIED. */ __rte_experimental void -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:42.808209700 +0800 +++ 0059-compressdev-fix-end-of-driver-list.patch 2023-02-27 14:08:40.789237000 +0800 @@ -1 +1 @@ -From 33b84a2efca7ac188def108ba8b981daa7572b9a Mon Sep 17 00:00:00 2001 +From 031b48d67099780ecfcdcedddf414592010ab11f Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ] @@ -32 +34,0 @@ -Cc: stable@dpdk.org