From patchwork Tue Feb 21 07:07:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124273 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9C6D41CFA; Tue, 21 Feb 2023 08:08:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4D3B43186; Tue, 21 Feb 2023 08:08:18 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2050.outbound.protection.outlook.com [40.107.243.50]) by mails.dpdk.org (Postfix) with ESMTP id C8AFB40E5A; Tue, 21 Feb 2023 08:08:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n84wNLuFwkeM7tvpfwgfFpUSLIUhxLqZs/SaGZb0Ber1aWDLT3xl8AFHY1oUqLgeCdW9YRIrpZM6TWcgTJI2dJCvhlmZqPKsQcJozpy5HZn8bOUjFQ4a+pWRlNLyzqC0FtOwIEd3e1MNR+d8YudemGmwNYCKTtWXgYhSyIfPwXEWPt1P2E97BlWbobrqCnQEyCwuMEb9H4c/sYx7ZCM8fc0VgtcKl2Z8FzSXAq4n7aWCQzi6XAgm82NWlC2hiSJEWRt4jL89kA5O/bxQhxdykVrh3tjFc6PORnCv1qiVKr8dUqdb0WnRdxKsQ3ukw+p0qtQOwN8E9nuZLTNaDzV2Iw== 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=GJQfIIjH0Z9aj9pgESEV0hJI9ON0CnrFbxfULwkVs84=; b=gwOKuMAXDhOUSoS/S0EvV00ZNTIOdOc0u9MiciVmh940sQRiB9xRLLMmypj2FIZYnsDUKj/BlUWg288Ds/BXTwVaiQiVPXBrA25bVErzTadAL2KtTqa2GC6G/hHhEZDb6vyoE42cyevJ6jyJ6+tnC6zv9e96a+TJYT+cvyi1qMKQOOd59jbAhaslT2hbDCJcrZGHXNUu4Uh5Ybs/N5KjrEYU8zdKPjzY14f106QERjc9nC5P6A7G/sof9snEMURdxgKu6q9j0jRtB4N9argIIpcYK8ltLHSsvNtN0UOSRrc9mSGxNwPBWNt7nOyab9ntVwlCHX15AN8kPAj4Tt7ZXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org 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=GJQfIIjH0Z9aj9pgESEV0hJI9ON0CnrFbxfULwkVs84=; b=diOC5YM0IrBd7sG2ByS2FZVzerO0zG/Ky02hct0wXtkDcJeFkGdaPR6Gm1ukf/NloabfqmVAnoxSvmuacrEtbA006FGTtSKMB/OqjYDsG29dafE6z0N6M/FY2HePAoHkw1LD5gG6YtiqmebFWJEl1ezqS97LpQXeA9XFH2afiCUAamxWPtfmY1iNTioACFhqqPZO9b5QEEdLO36Lop8RfvUjjWg+PisyWj7+/5h4bHM2oI9tPOZ7jPHO8zoOB7FvLMxOgS4oucLqAP0S0GFULPFXQUBfbsZMc9k8UqD9xZgAz9ZEbuuWVUlwhepHSAzYqj4eOAkkaOWfbC8z9AZDfQ== Received: from MW4PR03CA0199.namprd03.prod.outlook.com (2603:10b6:303:b8::24) by DS0PR12MB8319.namprd12.prod.outlook.com (2603:10b6:8:f7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Tue, 21 Feb 2023 07:08:12 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b8:cafe::61) by MW4PR03CA0199.outlook.office365.com (2603:10b6:303:b8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Tue, 21 Feb 2023 07:08:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.17 via Frontend Transport; Tue, 21 Feb 2023 07:08:11 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 20 Feb 2023 23:08:04 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.36; Mon, 20 Feb 2023 23:08:03 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:01 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" , , Subject: [PATCH v3 1/8] compress/mlx5: fix decompress xform validation Date: Tue, 21 Feb 2023 09:07:49 +0200 Message-ID: <20230221070756.3070819-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT054:EE_|DS0PR12MB8319:EE_ X-MS-Office365-Filtering-Correlation-Id: 687010f5-185b-4a03-9f34-08db13da64dd X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c1fAWICbA13towAEgCuKzQISEN1tjowxGHXIRl0z3tRYiO+mAqVpXy/+gR9KeqUm7kD+8bEZtVgzaNut4Z2rIJyhcxhDf5UqsL6pIctCb8gQ3i63vrlTKJAiFZ/CwtGW6WMioNFXvWXU20/Og8PKzt5Cw9x2+FwVAFlqZ3ar9gB6sm2DKu6+bT3hGpecNfV7Z6sIy9EIkvXY5wDeNkaXlJS57EURbS4PnArWJGWzSO9TVttkHcgypcLDROg2eoAkHMyNPtNX2WzbtuBX3rnP0Izc9HoVpsIWK09ylsAaY13pqyRoHNWtr2VH/1HUp3islKEscYlRwkCvMjOP2SrtREJ2Br1HY8f54DtUJ/uJky0UxcY5sYqlt+eCWlvX5KtD+Z1cZa8qSbzeDFBArRD+Ab9G/Z45xA/Og8aFV+JH4joef7+AxpEYRutfDzTLF7eQyjmAzR4tNLaH9ogW14QsyYkO6n9gnLrcds+QStJqkoP8dKoWurbqRWL8y1ZHZvsNREDgPALIKlgxzy7PtX8gJf4rJU9QrEaW2jASIfaNarR++IMeFDXS3k4Kl75mHXK3CxtzR53aLFQVnmKADF8gbMNjkqi5zahxH9HUTwnPoE5z5QARbnbGNBPxUtaUYkUBhtmunNnIEX9lmY4OYEmGPgjy1U8ncPhA8wc19hpNuLQqZPuiBCMIUiE+WDIOCZhHl8fi0h8J8R7pAu9OgtqvBw== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(186003)(26005)(6286002)(40460700003)(8936002)(4326008)(6916009)(1076003)(336012)(5660300002)(2616005)(426003)(47076005)(83380400001)(6666004)(82310400005)(36860700001)(36756003)(478600001)(40480700001)(55016003)(7636003)(82740400003)(7696005)(8676002)(41300700001)(70206006)(70586007)(2906002)(86362001)(54906003)(316002)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:11.8163 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 687010f5-185b-4a03-9f34-08db13da64dd 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8319 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 In xform creation, it first validate the xform according the capabilities. One of validations verifies that given "hash_algo" is "RTE_COMP_HASH_ALGO_NONE" for both compress and decompress xform objects. However, the validation for decompress checks it again for compress xform object. This patch changes it to verify decompress xform object. Fixes: 2efd26544554 ("compress/mlx5: support partial transformation") Cc: rzidane@nvidia.com Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/compress/mlx5/mlx5_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 430f769d41..06d1ff5b95 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -313,7 +313,7 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, DRV_LOG(ERR, "Not enough capabilities to support decompress operation, maybe old FW/OFED version?"); return -ENOTSUP; } - if (xform->compress.hash_algo != RTE_COMP_HASH_ALGO_NONE) { + if (xform->decompress.hash_algo != RTE_COMP_HASH_ALGO_NONE) { DRV_LOG(ERR, "SHA is not supported."); return -ENOTSUP; } From patchwork Tue Feb 21 07:07:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124274 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 700DD41CFA; Tue, 21 Feb 2023 08:08:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50E324319A; Tue, 21 Feb 2023 08:08:22 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) by mails.dpdk.org (Postfix) with ESMTP id 7821F4317C; Tue, 21 Feb 2023 08:08:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ESurKgTdkg5FtGpTNaGzOOIEG6Bdwus8HyX7fOsPLBKb7qKfdOkKep0WA9dgZB2ZxLGye4QtUfB2gWoYIN4H9B/b6MEb0eq7hGEuyvZ1QJS3OGaNVIY0T+8ZQ8Y1ArUt1RNt7c2Rr7+V3z9eLuWjGduHlQnL92GV+iO17OBMwa+EWs78OTiCtt6RquuFKXOubn2Q9+huNCiGfdlm559vvPvBV9eQed421UKJzQ0XQVa2olmGq52g2g+vmH0oB96PGH0urSTpulReLEi907oztuFbD1iVFRmKhkmvlvofkk25W+Vkr1Izj1NBRhh1Bo0ME13oTOWnUhARA3qYpuSlFA== 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=Ci6RYfDSZTQmampI+ubnFbBzzqI81Ahgj6OOyv+m/q0=; b=nkicKLW02ZCuOPq2MPVTuOw4ASXJuKRhDrFti3AFU9iijSo07d26XP3p7WifMRUsxNrZ1+3bvFBYhd3b5pZoxcQYpvdZgvVO3gkVfF+uEPHdDklMAJYT7l8JxVKuEBPizcM42tRKCm2PJR3XbkFryBoEO1s0TGCHUKNRGK1ms5+1yYtY4fyqIXMPLyB9jqn5TCxCNzSuILq838GVPd56N4HBoIsQfBK9KfMIZnzZA3pp1Wwz5P9vA17N0jpppCNVHJk+aOcO7dJAVno+oipH4F6MF/dNV7f9k7en32I3UZgKrcgntYWWd1QX60D3l512IQpVfBkhRn1VT4wp7aLgMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=Ci6RYfDSZTQmampI+ubnFbBzzqI81Ahgj6OOyv+m/q0=; b=k3d2gcV2cbOEJO+t8MBil3cfAs4ALXt7rliApPCPvZCMPc29aZ9+cd2yagoiXbLGKcvfDOz92iflHixLlTbWVjpveJ6QHigq3cf7oMILkcY39EW4aARtQWtBhhKWYgGWndY0tFuDpntAwdK4xQs+I/TsRJMens65D1GApGRTLcVjJyKI5UXfM0Tt3r0d9zAQ5S25kSBciz4S21ZMOf3wnOo03BpTWJ590oVqoVOCSUzk2HnG1lryvICP4Yr6e5AMUGdB4FzfYpvggRzIDAyg6xZQrKcya073mxh0mwvW84pfOy+VIVWTjbjxStq5sB6c9uM6vKOgV/LLorFKN1qGHg== Received: from BN6PR17CA0038.namprd17.prod.outlook.com (2603:10b6:405:75::27) by PH0PR12MB7840.namprd12.prod.outlook.com (2603:10b6:510:28a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20; Tue, 21 Feb 2023 07:08:16 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::df) by BN6PR17CA0038.outlook.office365.com (2603:10b6:405:75::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:16 +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 BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:16 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Mon, 20 Feb 2023 23:08:06 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 20 Feb 2023 23:08:05 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:04 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" , Subject: [PATCH v3 2/8] compress/mlx5: fix wrong output Adler-32 checksum offset Date: Tue, 21 Feb 2023 09:07:50 +0200 Message-ID: <20230221070756.3070819-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT010:EE_|PH0PR12MB7840:EE_ X-MS-Office365-Filtering-Correlation-Id: 4261ccad-2797-4b6b-6f37-08db13da67b9 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RnQmktXKHug6FtmkRXa23Xpamff1shApkTUnmzYgsCbMi6WUkUoNWL/EfK15/xS0mgpPIPoDzQnbi4UwlTjcYtBzPYLSYGd9ns0cJ0R2mY7Y9b6ieqNYWG1qlvNssovq/vzjbGaYb1qbKeK3eY739lp/og3Sz1E+gMe2rA+cPyDJY/JjJyi4arAZf30VXrK0saXhiQAIo1nZiVPkkGyU52wFlkqHOFGcCh68jxfvOsn1asD51rldRPI+FT0ba3LFtLhdDicjpvOBaAr5HfcXXYVMxXrykj0EKZZMRF0/+2V3kEOMQ6vbSiB2L+uZB6Zkc5WwKnWbWTZRxx0hVo6oJRFB+gD6iDlHmsCJQKlMaeZvLAfHm/tvOe42f74F/exWciWT3MNLPrwhgH/Vw3kEGZFHkzLuU21x8XCWfyHzNhuRHpl7XEONMBFSikZM22kNrq6ttCMsdxZBsQnkuK9tJrJgCWZrUB0QAH/OzmgJu90tAncOzDadVDmxWvdJi13uSE+MhraL47PF/ynq+G5sOUbMd5SphXPwdSvFqh1xQGdFOC2cB3DV5QPxSSytT4Ak1TuBmivvC6bfGt9fq2FtGFq9hj4Wvkabjqh2Usl47kRwhjPTVJfrTyBnwtU5tf+fAaS1WcR4orawdGEv9wR3HQsPS3mar0P+mi90CydXRBb4WR7FVB62loTwjfjBKyxA7nz5A8Q0seqo73U/OVyPzA== 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)(136003)(376002)(39860400002)(396003)(451199018)(36840700001)(40470700004)(46966006)(36756003)(5660300002)(36860700001)(8936002)(83380400001)(47076005)(426003)(40460700003)(86362001)(40480700001)(7696005)(55016003)(7636003)(70586007)(54906003)(336012)(478600001)(82310400005)(316002)(6916009)(41300700001)(4326008)(8676002)(356005)(2616005)(6286002)(1076003)(6666004)(70206006)(26005)(186003)(82740400003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:16.5030 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4261ccad-2797-4b6b-6f37-08db13da67b9 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: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7840 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 After de/compress dequeue, the output checksum is copied into the op structure. The "output_checksum" field in op structure is "uint64_t" type, and the 32-bit checksums (CRC32, Adler-32) are copied into the lower 32 bits. When both CRC32 and Adler-32 are configured, CRC32 is copied into the lower 32 bits and Adler-32 into the upper 32 bits. However, in mlx5 PMD Adler-32 without CRC, is mistakenly copied into the upper 32 bits. This patch updates Adler-32 output checksun to be copied into the lower 32 bits. Fixes: f8c97babc9f4 ("compress/mlx5: add data-path functions") Cc: matan@nvidia.com Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/compress/mlx5/mlx5_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 06d1ff5b95..82088a7b8c 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -633,7 +633,7 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops, break; case RTE_COMP_CHECKSUM_ADLER32: op->output_chksum = (uint64_t)rte_be_to_cpu_32 - (opaq[idx].adler32) << 32; + (opaq[idx].adler32); break; case RTE_COMP_CHECKSUM_CRC32_ADLER32: op->output_chksum = (uint64_t)rte_be_to_cpu_32 From patchwork Tue Feb 21 07:07:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124275 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB81241CFA; Tue, 21 Feb 2023 08:08:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C82014318A; Tue, 21 Feb 2023 08:08:26 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2073.outbound.protection.outlook.com [40.107.94.73]) by mails.dpdk.org (Postfix) with ESMTP id DAD054318E; Tue, 21 Feb 2023 08:08:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BSKXNxZ6O6MKMmXUuGkptfOLCc71u1jJhKFqrWu7xyII4PN0YlI4E3ppUsdFHexw6njKWmPrrlTxkFMbrMr+aYcjFr9dEeS6LVJmzfuH9p6xlG22Jdp+BSl6hNKhnfF5XUsOlfFT6czaYGqJy7egp9l2K1IyuCF9Xk/0rqonuwaxjQGfDMnFO613bzIVfaUyHYKpFIr07lrohNSp3OTK8ILczzhllGoAuBQrRViKxRdnXjBuoniPZlYnzvjacdOGAhCVsY3YMdZtGbR7ILLUMHgJOKkG6slisdX5DBEFZ89p2C38gUIyAPWf+ipQqWbs3GM/Z3xRJZKV0LJPFeOedQ== 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=HnA5vFpuutERKonufV6v4m8DxMYGBazr/zIdkGsg/UE=; b=oKi1ykgnvJaJo3GY9gc9katMOt58V6i/WCrQmpImYN10h/dMYYl8ZUSMk7QkYgciv469d4WoNtkm2imqlzCSCZrPJqpbprhyn09RcCk1rGRwnv4Cv/lG5cYQGVIVeS4HoSvmQtntdHx28kEWUkoGy0W7KSUrIRt++YfvYzs7oeVJaelf9bwyu1R1XgYKX5mGsILHKPQ0dYD5NWIyHz3FLEN/xSgFbQeyV3u/Vv7VnpIvRNxMX0e9+kZFhBAZd2T4y0t5VHsn0U7aRmAqj2NY0UevnhvqLV7dGUZqb0iXxWuckwNzj+gjpZBf2PS0RmnJR9NCGzXePtJB0rHGZP8wqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=HnA5vFpuutERKonufV6v4m8DxMYGBazr/zIdkGsg/UE=; b=NMGxz1SaJvt1LXhJjfuVlfI9jgtVcfam80STB2NWFow80PgCVAe6Gc8VwI5xNN4f9HemUACI6ZGERnbFBq0wBptWQsFtGbHB3+tBFIksqidgCL9Bs3ebT+BfL/B3IvLMjTjwav+7vT1Wq0bHOcVbzt5xy7R823MeqPdt2rdTSrzqpd8XcvxAH7m/DJcOEAnPiyOp52Dt9O8n3zWpeLvZfMQmZMLP8TP0rE5RNTsKOwkdsWzhshmEu769JZZE8zpZ7iCvGyM40AipVH6ZtC+pHi3BJz671+wATHH9594PCL+0g7TLnNl8LQAp6TgP6SHGa/bBhSLsZE9HXk4x2eTQjg== Received: from BN9PR03CA0058.namprd03.prod.outlook.com (2603:10b6:408:fb::33) by BL1PR12MB5972.namprd12.prod.outlook.com (2603:10b6:208:39b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Tue, 21 Feb 2023 07:08:20 +0000 Received: from BN8NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::ce) by BN9PR03CA0058.outlook.office365.com (2603:10b6:408:fb::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:20 +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 BN8NAM11FT044.mail.protection.outlook.com (10.13.177.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.17 via Frontend Transport; Tue, 21 Feb 2023 07:08:19 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Mon, 20 Feb 2023 23:08:08 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 20 Feb 2023 23:08:08 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:06 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" , , Subject: [PATCH v3 3/8] compress/mlx5: fix QP setup for partial transformations Date: Tue, 21 Feb 2023 09:07:51 +0200 Message-ID: <20230221070756.3070819-4-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT044:EE_|BL1PR12MB5972:EE_ X-MS-Office365-Filtering-Correlation-Id: d628dd55-72d7-4794-03d6-08db13da69c8 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ss6Sa+IR9AHBRcHsfStyAhSyJlqviA6guhYGoI5Emxj8dsHDPkCXNrGxEM2+pssOiX/ks+N++kE9jT7W1uLhxv0BZG6eSi0RmYzynccGrLwgvYwOuo203i/7BNPYbrnlO9yM/ssPTu0Z/zFS4DNpbm99JR8e8GUqG86mkdT3ci3tnTY2DNp/zpVOnQiSbvO+gXTfWclhA1ZAb096ql/dS80eR88HUNX3zpUTlxdjVSeRbwGeOO8ft8VFuMXqBxSw8lOCWjGDQBKphxxqkfQFwSF11E49zCAtr5oTgXRNFEKdx8AG8LofdvsJIjcQNEMwBIAqa1VpB5LrKLSsbwGmESr02jMXgFvxLL2orOYI2SHCWs4gR2CnBARySYi6btWekMm2CsaYKE2PYyjueF45kYf+fLdf2CwuDefsSFEsUX35lsZNgcTSQ6STEfob/Lo20+vEngmeuqj9fguVepeRzHa5/UQevX39OYvl5UAunfJCR4HXVF6JhPw8U/A14Y863LkszgLOR2C9D/cYYN8WZvgK3A1Sg1AFOQfZ1MZ1/UU0SGcrlUnrdsqWFsMPgk85qRqymmUcRyROdSqg4iGCRdVAz1YrWEnNa17UDWJ2Xtc8uBrKEk+1Lyva34Tdaeo769oTWW1Ee0YQ6M8p8QegnbR18PAcqhqmR7CuzOK5Y7zyCqVBneT0iMhpm4iQUDP0/zfzCGhxQJdfLVanYpfkTw== 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)(136003)(39860400002)(451199018)(36840700001)(40470700004)(46966006)(83380400001)(7696005)(2906002)(47076005)(336012)(426003)(2616005)(478600001)(36860700001)(5660300002)(55016003)(7636003)(82740400003)(4326008)(8936002)(186003)(26005)(1076003)(6916009)(8676002)(316002)(54906003)(356005)(40460700003)(6286002)(6666004)(40480700001)(82310400005)(70586007)(41300700001)(70206006)(86362001)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:19.9383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d628dd55-72d7-4794-03d6-08db13da69c8 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: BN8NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5972 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 The mlx5_compress_qp_setup() function creates QP for compress, decompress and DMA. Thus, the MMO flag is turned on only when all operations are supported. However, since partial transformations have been allowed, it should be turn on for part of them. This patch removes the compress MMO support requirement. Fixes: 2efd26544554 ("compress/mlx5: support partial transformation") Cc: rzidane@nvidia.com Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/compress/mlx5/mlx5_compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 82088a7b8c..6882bcf6d1 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -243,8 +243,8 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, mlx5_ts_format_conv(priv->cdev->config.hca_attr.qp_ts_format); qp_attr.num_of_receive_wqes = 0; qp_attr.num_of_send_wqbbs = RTE_BIT32(log_ops_n); - qp_attr.mmo = priv->mmo_decomp_qp && priv->mmo_comp_qp - && priv->mmo_dma_qp; + qp_attr.mmo = priv->mmo_decomp_qp || priv->mmo_comp_qp || + priv->mmo_dma_qp; ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp, qp_attr.num_of_send_wqbbs * MLX5_WQE_SIZE, &qp_attr, socket_id); From patchwork Tue Feb 21 07:07:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124276 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0A9241CFA; Tue, 21 Feb 2023 08:08:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F581431A2; Tue, 21 Feb 2023 08:08:30 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2068.outbound.protection.outlook.com [40.107.93.68]) by mails.dpdk.org (Postfix) with ESMTP id E75CF4319E for ; Tue, 21 Feb 2023 08:08:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jKPpy+ws6i+m6GLGKdis6vwAMbYp1S+qrE+BToogGR6moujH1fgdvWtIJok22MrVwQT+ErJt3bIRbQoYduAxhFROhB/fiIrLlDDiEw+ufZBcWWMGVew90Vr/jvauSvx/K+aki4C97J7JVKmFpgsPLQXlEvEBlqamOMCMERaUBofYtH6ybovwH8z93PfaCMk1LNLneZlZ2qiWinx6lD/XTC5/zZFPMxEOm846d6xaAFybreYfH/mmGjCp3PrAgiheTkvis2Tc3GYsnH8WwX19GSQ5Z4ZK355b6dnTQ7WcC97MI/+K1GlHmDdgmwOo24ExNUCDc1Ij8PpRChA3dribvQ== 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=ZvUWwn52B7t2aMcOqGtmuUKMO8iNQyDmF8+WcANv9yo=; b=hGV93J28cjYthSkur47yXY7RceuClEWzq0isHak9wQjierOM6A3lD+YqKZkXvEE/rfGg0hzbPfkFpWKL0/zCPxZQ9vCwecWeDiSlym+KFs03N7PIwYYZrxTlNE3r0/LF/QJ3leTkSsgebDW+A9tgoGZXygLb/ODskBpZE28bUAXHVWYLajBeVscqtDJEZqyWN2rsVCv7pJpLL6Bkt0GR1ndJ3AyUqFiDzintSYw1DNUHhu6Msdhf11xOfsEBuBsxBArYhuHTquVEfMK+ACW0oWQ/MZlq2snz76EXBDWRQw9x6c03PzpRYVhd+9C+HfRb6EUJfbK9r3BIpjKFjJmhEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=ZvUWwn52B7t2aMcOqGtmuUKMO8iNQyDmF8+WcANv9yo=; b=awMegB6d6O5vuZJdBwYShLh615T+2LNvVy5RCn3iIl461IqKmnKrkFqulTe2+O7/iz+fmcBqprqnxY40Pcw6lTeRsuGFb9c9KBTKO306nqFz+zxpofvXhSHiurX2KaPWXqYJFrzIRVvkD1M1a/DcUGBKIi/AZmEscfXfm3m1MYu1/V2adwSufwXO6mLyzgGDJM2Omev/9Q4Z3AOFL6kcF+yJTN5m8FfF09jfQpemsW3YgjRdzfVU6z2YJQo/B6lBpjoE76TGJWTUjHIiqyB3l7+lJUpxfEWsqXdqomlFH1CFKqzvaXNkMEOjjxU9qNuRtcW3dQdnPlvNJCrQKiFAzQ== Received: from BN6PR17CA0043.namprd17.prod.outlook.com (2603:10b6:405:75::32) by CH3PR12MB8547.namprd12.prod.outlook.com (2603:10b6:610:164::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.19; Tue, 21 Feb 2023 07:08:25 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::8) by BN6PR17CA0043.outlook.office365.com (2603:10b6:405:75::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Tue, 21 Feb 2023 07:08:24 +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 BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:23 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Mon, 20 Feb 2023 23:08:10 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 20 Feb 2023 23:08:10 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:08 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" Subject: [PATCH v3 4/8] compress/mlx5: support new metadata layout added in BF3 Date: Tue, 21 Feb 2023 09:07:52 +0200 Message-ID: <20230221070756.3070819-5-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT010:EE_|CH3PR12MB8547:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f3affb5-2e3c-42a1-36de-08db13da6ca4 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QLdCLQNn9y6uM8+FkCtL5L3O9/MVtjRdlJtm8qiONALXxjeUpUlTfZlZj69EMnrDv9ZeGuSiCzMETRtc6XdCbbdm28U3ttaDj7DBoBOtuy2CubAmlVX45YmASGI098hTJs6YmLAbuJ+5Z7DQc3Nn03p9Cr9q1g431CagOomz9kAnlxqePkmblq//w13J7GePE73sa91DRfAvCslERWD0bFn3dCmS7itMiFfUpSKsll1m1bWB0YW14k1O4g/Dyj/mWU9He4PLiW2bZHB7LTZfhYsiju/7uhRzK4C2VWLZjND7n62Xw84vgBW+VdfGhPYT1WLqTSgR5+V/Y+xlH4PxcvLaxOHzhoziejRgK7C65xg0/SR7A7mz2GZD9iff/obZQDJQj/NZWu+ikjyTEaOcHkMnb3Qudji5Vb86TEAO0h9wuMKXz3ydULLkTRRPmFzRxb5BWTjP0jtC3/jOIOKiOT526ZZy6DgDXyk1bMZtm7lLQp0YGmcfrbZ2jemJv5p3TeJ4LxDYZGmrUiGM+CdUWVCTdL0F57CnpMZT9WV5k4g3fWYWW857DxFxcYNkQOnqJSqwcwUp3f+BW9jBxRWpGHM53zl0/RbPV8fgvSOJDXz1VSmYbHHL/Uz2qg2aU5LwssLgIDses4sPtSSDgMixutIM2sE60GLCBiSHAL+bqeLqb2Vk2akOmMR0YRSIENN/oDNZG9f+UT8ThFOSxNVj+w== 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)(136003)(396003)(39860400002)(376002)(451199018)(36840700001)(40470700004)(46966006)(356005)(36860700001)(82740400003)(7636003)(86362001)(36756003)(2906002)(6916009)(8936002)(70206006)(4326008)(41300700001)(70586007)(5660300002)(82310400005)(40460700003)(478600001)(2616005)(426003)(40480700001)(336012)(55016003)(6666004)(83380400001)(47076005)(54906003)(6286002)(26005)(1076003)(186003)(7696005)(316002)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:23.6432 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f3affb5-2e3c-42a1-36de-08db13da6ca4 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: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8547 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 Commit [1] add support in Bluefield-3, but Bluefield-3 has different GGA opaque structure than Bluefield-2. This patch updates the PRM structure to include both versions, and culculate the relevant offset for each version in control path. Commit [1] 559014f232b4 ("compress/mlx5: add Bluefield-3 device ID") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++-- drivers/common/mlx5/mlx5_devx_cmds.h | 3 +- drivers/common/mlx5/mlx5_prm.h | 40 +++++++++++++++--------- drivers/compress/mlx5/mlx5_compress.c | 45 +++++++++++++++++---------- 4 files changed, 61 insertions(+), 33 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index fb670950ef..b801b05872 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -987,8 +987,10 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->mmo_dma_qp_en = MLX5_GET(cmd_hca_cap, hcattr, dma_mmo_qp); attr->mmo_compress_qp_en = MLX5_GET(cmd_hca_cap, hcattr, compress_mmo_qp); - attr->mmo_decompress_qp_en = MLX5_GET(cmd_hca_cap, hcattr, - decompress_mmo_qp); + attr->decomp_deflate_v1_en = MLX5_GET(cmd_hca_cap, hcattr, + decompress_deflate_v1); + attr->decomp_deflate_v2_en = MLX5_GET(cmd_hca_cap, hcattr, + decompress_deflate_v2); attr->compress_min_block_size = MLX5_GET(cmd_hca_cap, hcattr, compress_min_block_size); attr->log_max_mmo_dma = MLX5_GET(cmd_hca_cap, hcattr, log_dma_mmo_size); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 6b5a6b8667..045ff404e9 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -263,7 +263,8 @@ struct mlx5_hca_attr { uint32_t mmo_decompress_sq_en:1; uint32_t mmo_dma_qp_en:1; uint32_t mmo_compress_qp_en:1; - uint32_t mmo_decompress_qp_en:1; + uint32_t decomp_deflate_v1_en:1; + uint32_t decomp_deflate_v2_en:1; uint32_t mmo_regex_qp_en:1; uint32_t mmo_regex_sq_en:1; uint32_t compress_min_block_size:4; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 613cc6face..b33c55c257 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -613,17 +613,27 @@ struct mlx5_gga_wqe { struct mlx5_wqe_dseg scatter; } __rte_packed; -struct mlx5_gga_compress_opaque { - uint32_t syndrom; - uint32_t reserved0; - uint32_t scattered_length; - uint32_t gathered_length; - uint64_t scatter_crc; - uint64_t gather_crc; - uint32_t crc32; - uint32_t adler32; - uint8_t reserved1[216]; -} __rte_packed; +union mlx5_gga_compress_opaque { + struct { + uint32_t syndrome; + uint32_t reserved0; + uint32_t scattered_length; + union { + struct { + uint32_t reserved1[5]; + uint32_t crc32; + uint32_t adler32; + } v1 __rte_packed; + struct { + uint32_t crc32; + uint32_t adler32; + uint32_t crc32c; + uint32_t xxh32; + } v2 __rte_packed; + }; + } __rte_packed; + uint32_t data[64]; +}; struct mlx5_ifc_regexp_mmo_control_bits { uint8_t reserved_at_31[0x2]; @@ -1467,7 +1477,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_max_bsf_list_size[0x6]; u8 umr_extended_translation_offset[0x1]; u8 null_mkey[0x1]; - u8 log_max_klm_list_size[0x6]; + u8 log_maxklm_list_size[0x6]; u8 non_wire_sq[0x1]; u8 reserved_at_121[0x9]; u8 log_max_ra_req_dc[0x6]; @@ -1756,8 +1766,10 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 dma_mmo_qp[0x1]; u8 regexp_mmo_qp[0x1]; u8 compress_mmo_qp[0x1]; - u8 decompress_mmo_qp[0x1]; - u8 reserved_at_74c[0x14]; + u8 decompress_deflate_v1[0x1]; + u8 reserved_at_74c[0x4]; + u8 decompress_deflate_v2[0x1]; + u8 reserved_at_751[0xf]; u8 reserved_at_760[0x3]; u8 log_max_num_header_modify_argument[0x5]; u8 log_header_modify_argument_granularity_offset[0x4]; diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 6882bcf6d1..93721d6047 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -55,6 +55,7 @@ struct mlx5_compress_priv { uint32_t mmo_dma_sq:1; uint32_t mmo_dma_qp:1; uint32_t log_block_sz; + uint32_t crc32_opaq_offs; }; struct mlx5_compress_qp { @@ -157,7 +158,7 @@ mlx5_compress_init_qp(struct mlx5_compress_qp *qp) { volatile struct mlx5_gga_wqe *restrict wqe = (volatile struct mlx5_gga_wqe *)qp->qp.wqes; - volatile struct mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; + volatile union mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; const uint32_t sq_ds = rte_cpu_to_be_32((qp->qp.qp->id << 8) | 4u); const uint32_t flags = RTE_BE32(MLX5_COMP_ALWAYS << MLX5_COMP_MODE_OFFSET); @@ -211,8 +212,8 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, goto err; } opaq_buf = rte_calloc(__func__, (size_t)1 << log_ops_n, - sizeof(struct mlx5_gga_compress_opaque), - sizeof(struct mlx5_gga_compress_opaque)); + sizeof(union mlx5_gga_compress_opaque), + sizeof(union mlx5_gga_compress_opaque)); if (opaq_buf == NULL) { DRV_LOG(ERR, "Failed to allocate opaque memory."); rte_errno = ENOMEM; @@ -225,7 +226,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, qp->ops = (struct rte_comp_op **)RTE_ALIGN((uintptr_t)(qp + 1), RTE_CACHE_LINE_SIZE); if (mlx5_common_verbs_reg_mr(priv->cdev->pd, opaq_buf, qp->entries_n * - sizeof(struct mlx5_gga_compress_opaque), + sizeof(union mlx5_gga_compress_opaque), &qp->opaque_mr) != 0) { rte_free(opaq_buf); DRV_LOG(ERR, "Failed to register opaque MR."); @@ -544,7 +545,7 @@ mlx5_compress_dump_err_objs(volatile uint32_t *cqe, volatile uint32_t *wqe, DRV_LOG(ERR, "%08X %08X %08X %08X", wqe[i], wqe[i + 1], wqe[i + 2], wqe[i + 3]); DRV_LOG(ERR, "\nError opaq:"); - for (i = 0; i < sizeof(struct mlx5_gga_compress_opaque) >> 2; i += 4) + for (i = 0; i < sizeof(union mlx5_gga_compress_opaque) >> 2; i += 4) DRV_LOG(ERR, "%08X %08X %08X %08X", opaq[i], opaq[i + 1], opaq[i + 2], opaq[i + 3]); } @@ -558,7 +559,7 @@ mlx5_compress_cqe_err_handle(struct mlx5_compress_qp *qp, &qp->cq.cqes[idx]; volatile struct mlx5_gga_wqe *wqes = (volatile struct mlx5_gga_wqe *) qp->qp.wqes; - volatile struct mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; + volatile union mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; volatile uint32_t *synd_word = RTE_PTR_ADD(cqe, MLX5_ERROR_CQE_SYNDROME_OFFSET); switch (*synd_word) { @@ -575,7 +576,7 @@ mlx5_compress_cqe_err_handle(struct mlx5_compress_qp *qp, op->consumed = 0; op->produced = 0; op->output_chksum = 0; - op->debug_status = rte_be_to_cpu_32(opaq[idx].syndrom) | + op->debug_status = rte_be_to_cpu_32(opaq[idx].syndrome) | ((uint64_t)rte_be_to_cpu_32(cqe->syndrome) << 32); mlx5_compress_dump_err_objs((volatile uint32_t *)cqe, (volatile uint32_t *)&wqes[idx], @@ -590,13 +591,14 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops, struct mlx5_compress_qp *qp = queue_pair; volatile struct mlx5_compress_xform *restrict xform; volatile struct mlx5_cqe *restrict cqe; - volatile struct mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; + volatile union mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; struct rte_comp_op *restrict op; const unsigned int cq_size = qp->entries_n; const unsigned int mask = cq_size - 1; uint32_t idx; uint32_t next_idx = qp->ci & mask; const uint16_t max = RTE_MIN((uint16_t)(qp->pi - qp->ci), nb_ops); + uint32_t crc32_idx = qp->priv->crc32_opaq_offs; uint16_t i = 0; int ret; @@ -629,17 +631,17 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops, switch (xform->csum_type) { case RTE_COMP_CHECKSUM_CRC32: op->output_chksum = (uint64_t)rte_be_to_cpu_32 - (opaq[idx].crc32); + (opaq[idx].data[crc32_idx]); break; case RTE_COMP_CHECKSUM_ADLER32: op->output_chksum = (uint64_t)rte_be_to_cpu_32 - (opaq[idx].adler32); + (opaq[idx].data[crc32_idx + 1]); break; case RTE_COMP_CHECKSUM_CRC32_ADLER32: op->output_chksum = (uint64_t)rte_be_to_cpu_32 - (opaq[idx].crc32) | + (opaq[idx].data[crc32_idx]) | ((uint64_t)rte_be_to_cpu_32 - (opaq[idx].adler32) << 32); + (opaq[idx].data[crc32_idx + 1]) << 32); break; default: break; @@ -717,15 +719,17 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, .socket_id = cdev->dev->numa_node, }; const char *ibdev_name = mlx5_os_get_ctx_device_name(cdev->ctx); + uint32_t crc32_opaq_offset; if (rte_eal_process_type() != RTE_PROC_PRIMARY) { DRV_LOG(ERR, "Non-primary process type is not supported."); rte_errno = ENOTSUP; return -rte_errno; } - if (!attr->mmo_decompress_qp_en && !attr->mmo_decompress_sq_en - && !attr->mmo_compress_qp_en && !attr->mmo_compress_sq_en - && !attr->mmo_dma_qp_en && !attr->mmo_dma_sq_en) { + if (!attr->decomp_deflate_v1_en && !attr->decomp_deflate_v2_en && + !attr->mmo_decompress_sq_en && !attr->mmo_compress_qp_en && + !attr->mmo_compress_sq_en && !attr->mmo_dma_qp_en && + !attr->mmo_dma_sq_en) { DRV_LOG(ERR, "Not enough capabilities to support compress operations, maybe old FW/OFED version?"); rte_errno = ENOTSUP; return -ENOTSUP; @@ -746,11 +750,20 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, priv = compressdev->data->dev_private; priv->log_block_sz = devarg_prms.log_block_sz; priv->mmo_decomp_sq = attr->mmo_decompress_sq_en; - priv->mmo_decomp_qp = attr->mmo_decompress_qp_en; + priv->mmo_decomp_qp = + attr->decomp_deflate_v1_en | attr->decomp_deflate_v2_en; priv->mmo_comp_sq = attr->mmo_compress_sq_en; priv->mmo_comp_qp = attr->mmo_compress_qp_en; priv->mmo_dma_sq = attr->mmo_dma_sq_en; priv->mmo_dma_qp = attr->mmo_dma_qp_en; + if (attr->decomp_deflate_v2_en) + crc32_opaq_offset = offsetof(union mlx5_gga_compress_opaque, + v2.crc32); + else + crc32_opaq_offset = offsetof(union mlx5_gga_compress_opaque, + v1.crc32); + MLX5_ASSERT((crc32_opaq_offset % 4) == 0); + priv->crc32_opaq_offs = crc32_opaq_offset / 4; priv->cdev = cdev; priv->compressdev = compressdev; priv->min_block_size = attr->compress_min_block_size; From patchwork Tue Feb 21 07:07:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124277 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 526F741CFA; Tue, 21 Feb 2023 08:08:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 330B6431AC; Tue, 21 Feb 2023 08:08:31 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) by mails.dpdk.org (Postfix) with ESMTP id 1107343192 for ; Tue, 21 Feb 2023 08:08:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5PnsH4fNEyRGDXIgTAFQZOi2pyklvjpNSUYnbvjkYTz4XpVSal/lPqBbeFSEnWZW+bTe4BtLcZkjnWAUJ02tGZGLVjiZIFjl8CfeI1WLn44TXPFZps5ognq6g4jkKa3Bt/SHdqcUCjAGp9OMI9K7WKv4nZUZ07VrnK+DzlZ2zg9vuoactUnSRDJW4fKZyDAjGfHhbd6HomYP5QTuvhoTqmVwzcTyaCLhaVYoAKEKIcSMAULRDSKtPYKt8+qzMP6QJo7OaEqCaLE0zweWQPWzXSPkXBy2+ajgUauwQdVaKkC+SwHMOv5CuTzB5dFo1cIMSzX+9XbVTBPYqQyuatPeQ== 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=vCnEmr37P1LwvfxATcX/2H3lSVB+/OlCnM6SXrCw7Ig=; b=RAMGel72IpITaNqOmDeqFd6mOFschD+VyPjPw7jOJk6uWSYOrKSj9r+DdCwXT7FdGo6Rk8Vh5V1LoRJOPSjYnlSniJjTC9x5XMiutjb2+3nnFbsXz2XPeXZco6MWVDYJ1pcw9+ou+SWd3u0CW9hX09eZLSNtpdnzNt+JOoFvY8hRdiu04wAslFmaEkg6tQXLaCiPBlBy+V3j0zfeP2aCY2ZNd/KoPWYZIJ2TaWpGLfZfr/IVNGoyA4Pid3O07nANUr6jdH2qz/FWCjZnWeNwVJUzv5EpCO9U4jZhzEplfoNdBot2alh5g5ZYj7WshS85JkpEhFaZUfPwUCFtlOWKYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=vCnEmr37P1LwvfxATcX/2H3lSVB+/OlCnM6SXrCw7Ig=; b=BZBqF3Txz4ZFoQCfBv+gS6PmQ7BnXpknBx8l9NhAA7JRFEQkwUL8mNwUuGgeJuZcXa8t8jDo20qrX8uxNcWk0MwJiEeW+DFr0Zes+P20+5roaBr7jCjX8gbkAqQscIpr2yhQk+f0L/2LWVRpOe9O8Bc4DcrOJFq7o/t7ZoKBFtIQ4h9GWxGzuCseJxZ8lKcOZHXDnGMUzZOfyVTVH5uqno5b3XMQxC0xm104G5vY4z1OkA5dH7fT/7ovnaH2ioKZHnX94b0ac9RmT6hFyyCUjdqRhuvvxW+e+AIOASrjTpVkLcGnrPCLpn9XGof0bmwL5JkEYshyqA/UASOH7c1IyQ== Received: from BN9PR03CA0732.namprd03.prod.outlook.com (2603:10b6:408:110::17) by BL0PR12MB4866.namprd12.prod.outlook.com (2603:10b6:208:1cf::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Tue, 21 Feb 2023 07:08:27 +0000 Received: from BN8NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::56) by BN9PR03CA0732.outlook.office365.com (2603:10b6:408:110::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:27 +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 BN8NAM11FT083.mail.protection.outlook.com (10.13.177.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.17 via Frontend Transport; Tue, 21 Feb 2023 07:08:27 +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; Mon, 20 Feb 2023 23:08:12 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.36; Mon, 20 Feb 2023 23:08:12 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:10 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" Subject: [PATCH v3 5/8] compress/mlx5: remove unused variable from priv structure Date: Tue, 21 Feb 2023 09:07:53 +0200 Message-ID: <20230221070756.3070819-6-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT083:EE_|BL0PR12MB4866:EE_ X-MS-Office365-Filtering-Correlation-Id: 988c1bcb-fb4e-4913-2e84-08db13da6e25 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A7KZ+MenPQ4WqixYyJZjlDZLgt9MAEG5m04cdMpIFWfMv0v0+Rol6kn/p1olFsvb/6REkgRjV3WK1GPdNvHr1JCjW2y7f6ky+VS4RBAbNR8SkB4RJV1SII5ec/PJ2bK2nxuwJ4eSeJasu7Lx5mPdem/bNUHaOlcVMdCoRTaim/Rs1Z9xTlqhoiFo8zKL2BprRkH3TxxpSajHSbHJOSS1Ek+b8a36sGSZz34LwWNKq2pbI27THwlMVuyJHDpUdPp3y1P7WCTSEHdor3W4FHnrQOLUW0gfEYTmPHv+Li7O6fuKyOwAP7Qs+AmJzLyt1igJ7WuIbZgJz+dCWRWuZFzfugxBZIGD867Ju8k+M77PyjXjgwURtvhS4G1cOviW/cau9KKX4ybNImsqWZY7Y7b1fBqmQplPGTjB9lcU3XhOMQfVlKBEWyLCtY4wKFcpCps5KvqbBeZpOhWAxg9PQeLbvApClV41HBnI3qWVSiSegKiM/27QOPWjkxVf3GudNxAGTZ8HgWAjKJUSyy8ZJq0WYr/4VEew/hW0egXrEieXgfazNkg2jlrIe+ihJPSMjOSYz6sABEPyHmFrgMgb4xPzdjuPHcUFTc8vqSvR227BxQlz2HWf7t1qa1g3VmMwSp3Cyrca/r/sLARM779x6m0RoLu9X6mVrK405kkaNsqCK2A= 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)(376002)(346002)(396003)(136003)(39860400002)(451199018)(46966006)(36840700001)(7636003)(36860700001)(82740400003)(2906002)(8936002)(5660300002)(26005)(6286002)(54906003)(82310400005)(83380400001)(41300700001)(336012)(2616005)(36756003)(356005)(47076005)(6916009)(426003)(8676002)(4326008)(70586007)(70206006)(40480700001)(7696005)(86362001)(478600001)(6666004)(186003)(316002)(55016003)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:27.2598 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 988c1bcb-fb4e-4913-2e84-08db13da6e25 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: BN8NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4866 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 The priv structure has variable named "min_block_size" coming from HCA capabilities. This field isn't used and copied into the priv structure for free. This patch removes this field. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/compress/mlx5/mlx5_compress.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 93721d6047..1802a7ba52 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -42,8 +42,6 @@ struct mlx5_compress_priv { struct rte_compressdev *compressdev; struct mlx5_common_device *cdev; /* Backend mlx5 device. */ struct mlx5_uar uar; - uint8_t min_block_size; - /* Minimum huffman block size supported by the device. */ struct rte_compressdev_config dev_config; LIST_HEAD(xform_list, mlx5_compress_xform) xform_list; rte_spinlock_t xform_sl; @@ -766,7 +764,6 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, priv->crc32_opaq_offs = crc32_opaq_offset / 4; priv->cdev = cdev; priv->compressdev = compressdev; - priv->min_block_size = attr->compress_min_block_size; if (mlx5_devx_uar_prepare(cdev, &priv->uar) != 0) { rte_compressdev_pmd_destroy(priv->compressdev); return -1; From patchwork Tue Feb 21 07:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124278 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA55641CFA; Tue, 21 Feb 2023 08:08:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E961431B2; Tue, 21 Feb 2023 08:08:39 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by mails.dpdk.org (Postfix) with ESMTP id B894C43175 for ; Tue, 21 Feb 2023 08:08:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sio4QWpb5zxaXplLEklSfUhv43Z10fh5RpA/RP/wHx75GKR5tTjCkfkPW7TbHtRqmDr4Rjut16Z3MSIC2x2isZpQbgMdeVhVfoErnmdURO53csw9ez+tMDwCpJd8LS9S+5b8CrreqmH3n/d1KnbRFZSM5hq/Vj5BgXhiZZ09Qy+Rz17XeO5YjU1QcthmEvnUYKLm77BuyUIPUSUl4g3RXITelMvgrW0e7wafXokCQFVqKi0s3UxRK4UuIKPAIyNTeQZRMmpXjbZtIKMsWDxNr1ISN10d4JDe87O0bnjI+olDtaWA5/BdTZkbt4TINypSgaZM5KSFMbWHLQhc6byUbg== 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=HVhtNSTLXk6kPuHMgEPtmQPo6HqqH7CiIqJYcAZDGTc=; b=BTikve/7uId4+RwD9eYtZlj7p76VfvNkufEJd/pD8Vn4VnFmuMhNVtUA1Mk4dAZPAnysLW0p15nv5lQeNxalPIOLcFdC+tLK8L02kDLQ+UWmP5oBtjHrHfDpxxyw/hemUmxgqIowBc7VdOnhskjSd0H926VtNEKVxd4paeNFATGv67doTp0Sw+1dtSHTpJ02fGx5ssCKzf251Fz9ImVT8Bj+irtJpI1+ycD+/5sBxikUiToxyuid8oB5mDtd3/RihO04jHeZchhZcWwuIBRCowaFwZwOl390iLq6Al/WLD2pOShcg7MCP07Z7DzGJqYSWp7Xzq0WOuSqim3iEcMkbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=HVhtNSTLXk6kPuHMgEPtmQPo6HqqH7CiIqJYcAZDGTc=; b=QT/6fCF/ZIKtsWkqgtuVVZWu9+dQV9ctatawSIVCI+3VzdjsBBAA/3vLMT1du9OOQga44H9ce9iRsnsJzW5296Ex1r89AtDIdGvJ6SQPtr0STKnmckl9pBUHBiz9bLRzw5pu7+7s6grqdacXKWzgPnTRgcu+6YyLbuF+oXXatV3fFU2tEymcpq5n0skOfIfZ6scdvMJG0EmXsCNK1yZSmeYWSo51HoLxuCFSrAvXva+4l9oXTxzb6uNGlP7IQz0/2LAzeH/9a2t7uRcuonna31MBZtWvIc5EvHnlPDSGk4wov9cjCWzGIZpykh/7qBfnieqUaoEgsE2hgMe9KvOY/A== Received: from BN9PR03CA0741.namprd03.prod.outlook.com (2603:10b6:408:110::26) by PH7PR12MB6657.namprd12.prod.outlook.com (2603:10b6:510:212::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Tue, 21 Feb 2023 07:08:31 +0000 Received: from BN8NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::18) by BN9PR03CA0741.outlook.office365.com (2603:10b6:408:110::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:31 +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 BN8NAM11FT083.mail.protection.outlook.com (10.13.177.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.17 via Frontend Transport; Tue, 21 Feb 2023 07:08:31 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Mon, 20 Feb 2023 23:08:14 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 20 Feb 2023 23:08:14 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:12 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" Subject: [PATCH v3 6/8] compress/mlx5: add xform validate function Date: Tue, 21 Feb 2023 09:07:54 +0200 Message-ID: <20230221070756.3070819-7-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT083:EE_|PH7PR12MB6657:EE_ X-MS-Office365-Filtering-Correlation-Id: a42d8cbd-75b0-4d82-4309-08db13da708c X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/fO/3KWKpTassIGCZE48a2rrJVy6G6wvCMcqT3atY0x8xcXiqhIVHJZMsLiVzCb+oTBLBx44lEfMo04LwOTBpPGfupjedOQ8AgMq8PNeA0GJ4hhFqO9dMVVAjcSqzd+Xx6kZ+0xYDEwbtZz1q8Xd4kmpxbKhGop8kYLIrkwAAK5W5IBQQV5c4oDEi6+unHiKrhqaViMH8G9epo6fGxnjnq4iATNAoTk1KHLmAgwcK6FA+ce0QShZVyO8FiN5cMmnoMxJzWkuExmUflDvjpVtWagJHNWvf0lxSQDZLMXljFQqIGBmJ5VxRILNQNGaugbySvTjgpu5Q2MUmhB5SYYuuQEwQVKmcTyxv3PhQdz1JbXMhXgtP3cnEubL3v4Xr+eZLnEO3DOPvMMVsumL3SfQ+R2/qsWzHqrh5opiw2AcDH8SKpN2cpgKBgLnkYvrOCmAUKOgzOkqr3uls0ML/qdaFBs58j2GewcEM5T2/DeX13lfkaWKi4HpCs8M3YW50a30CboMnAG0LJ5zeDEg1JCB8KIw9gTUEfqmFOoJvHbImfQnfP8PQyTmqG/dkl+HFQcSNkGkcQgPbTbEzHLG9iIFna9UxBxwyH5zEne/p3wfz9x6opxS8htSMKEHViXnf5xeNirV5baJydXsqG/0IXwY10GUygPCM120b/qlvaD0+qPOzb28q30dzGtZzuBPD5S 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)(136003)(346002)(39860400002)(376002)(396003)(451199018)(36840700001)(40470700004)(46966006)(426003)(40460700003)(47076005)(478600001)(7696005)(336012)(82310400005)(7636003)(82740400003)(86362001)(2906002)(36860700001)(356005)(316002)(54906003)(41300700001)(36756003)(5660300002)(8936002)(83380400001)(55016003)(40480700001)(70586007)(70206006)(6916009)(8676002)(4326008)(2616005)(6666004)(6286002)(186003)(26005)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:31.3064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a42d8cbd-75b0-4d82-4309-08db13da708c 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: BN8NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6657 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 Separate the xform validations from create function into new function. The new function checks caps directly from HCA attr structure, so all capabilities in priv structure were removed. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/compress/mlx5/mlx5_compress.c | 75 +++++++++++++++------------ 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 1802a7ba52..3ea3447f11 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -45,13 +45,6 @@ struct mlx5_compress_priv { struct rte_compressdev_config dev_config; LIST_HEAD(xform_list, mlx5_compress_xform) xform_list; rte_spinlock_t xform_sl; - /* HCA caps */ - uint32_t mmo_decomp_sq:1; - uint32_t mmo_decomp_qp:1; - uint32_t mmo_comp_sq:1; - uint32_t mmo_comp_qp:1; - uint32_t mmo_dma_sq:1; - uint32_t mmo_dma_qp:1; uint32_t log_block_sz; uint32_t crc32_opaq_offs; }; @@ -178,6 +171,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, uint32_t max_inflight_ops, int socket_id) { struct mlx5_compress_priv *priv = dev->data->dev_private; + struct mlx5_hca_attr *attr = &priv->cdev->config.hca_attr; struct mlx5_compress_qp *qp; struct mlx5_devx_cq_attr cq_attr = { .uar_page_id = mlx5_os_get_devx_uar_page_id(priv->uar.obj), @@ -238,12 +232,11 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, goto err; } qp_attr.cqn = qp->cq.cq->id; - qp_attr.ts_format = - mlx5_ts_format_conv(priv->cdev->config.hca_attr.qp_ts_format); + qp_attr.ts_format = mlx5_ts_format_conv(attr->qp_ts_format); qp_attr.num_of_receive_wqes = 0; qp_attr.num_of_send_wqbbs = RTE_BIT32(log_ops_n); - qp_attr.mmo = priv->mmo_decomp_qp || priv->mmo_comp_qp || - priv->mmo_dma_qp; + qp_attr.mmo = attr->mmo_compress_qp_en || attr->mmo_dma_qp_en || + attr->decomp_deflate_v1_en || attr->decomp_deflate_v2_en; ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp, qp_attr.num_of_send_wqbbs * MLX5_WQE_SIZE, &qp_attr, socket_id); @@ -276,21 +269,17 @@ mlx5_compress_xform_free(struct rte_compressdev *dev, void *xform) } static int -mlx5_compress_xform_create(struct rte_compressdev *dev, - const struct rte_comp_xform *xform, - void **private_xform) +mlx5_compress_xform_validate(const struct rte_comp_xform *xform, + const struct mlx5_hca_attr *attr) { - struct mlx5_compress_priv *priv = dev->data->dev_private; - struct mlx5_compress_xform *xfrm; - uint32_t size; - switch (xform->type) { case RTE_COMP_COMPRESS: if (xform->compress.algo == RTE_COMP_ALGO_NULL && - !priv->mmo_dma_qp && !priv->mmo_dma_sq) { + !attr->mmo_dma_qp_en && !attr->mmo_dma_sq_en) { DRV_LOG(ERR, "Not enough capabilities to support DMA operation, maybe old FW/OFED version?"); return -ENOTSUP; - } else if (!priv->mmo_comp_qp && !priv->mmo_comp_sq) { + } else if (!attr->mmo_compress_qp_en && + !attr->mmo_compress_sq_en) { DRV_LOG(ERR, "Not enough capabilities to support compress operation, maybe old FW/OFED version?"); return -ENOTSUP; } @@ -304,12 +293,24 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, } break; case RTE_COMP_DECOMPRESS: - if (xform->decompress.algo == RTE_COMP_ALGO_NULL && - !priv->mmo_dma_qp && !priv->mmo_dma_sq) { - DRV_LOG(ERR, "Not enough capabilities to support DMA operation, maybe old FW/OFED version?"); - return -ENOTSUP; - } else if (!priv->mmo_decomp_qp && !priv->mmo_decomp_sq) { - DRV_LOG(ERR, "Not enough capabilities to support decompress operation, maybe old FW/OFED version?"); + switch (xform->decompress.algo) { + case RTE_COMP_ALGO_NULL: + if (!attr->mmo_dma_qp_en && !attr->mmo_dma_sq_en) { + DRV_LOG(ERR, "Not enough capabilities to support DMA operation, maybe old FW/OFED version?"); + return -ENOTSUP; + } + break; + case RTE_COMP_ALGO_DEFLATE: + if (!attr->decomp_deflate_v1_en && + !attr->decomp_deflate_v2_en && + !attr->mmo_decompress_sq_en) { + DRV_LOG(ERR, "Not enough capabilities to support decompress DEFLATE algorithm, maybe old FW/OFED version?"); + return -ENOTSUP; + } + break; + default: + DRV_LOG(ERR, "Algorithm %u is not supported.", + xform->decompress.algo); return -ENOTSUP; } if (xform->decompress.hash_algo != RTE_COMP_HASH_ALGO_NONE) { @@ -321,7 +322,22 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, DRV_LOG(ERR, "Xform type should be compress/decompress"); return -ENOTSUP; } + return 0; +} + +static int +mlx5_compress_xform_create(struct rte_compressdev *dev, + const struct rte_comp_xform *xform, + void **private_xform) +{ + struct mlx5_compress_priv *priv = dev->data->dev_private; + struct mlx5_compress_xform *xfrm; + uint32_t size; + int ret; + ret = mlx5_compress_xform_validate(xform, &priv->cdev->config.hca_attr); + if (ret < 0) + return ret; xfrm = rte_zmalloc_socket(__func__, sizeof(*xfrm), 0, priv->dev_config.socket_id); if (xfrm == NULL) @@ -747,13 +763,6 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, compressdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED; priv = compressdev->data->dev_private; priv->log_block_sz = devarg_prms.log_block_sz; - priv->mmo_decomp_sq = attr->mmo_decompress_sq_en; - priv->mmo_decomp_qp = - attr->decomp_deflate_v1_en | attr->decomp_deflate_v2_en; - priv->mmo_comp_sq = attr->mmo_compress_sq_en; - priv->mmo_comp_qp = attr->mmo_compress_qp_en; - priv->mmo_dma_sq = attr->mmo_dma_sq_en; - priv->mmo_dma_qp = attr->mmo_dma_qp_en; if (attr->decomp_deflate_v2_en) crc32_opaq_offset = offsetof(union mlx5_gga_compress_opaque, v2.crc32); From patchwork Tue Feb 21 07:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124279 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB71041CFA; Tue, 21 Feb 2023 08:09:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F8EF431B6; Tue, 21 Feb 2023 08:08:40 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2042.outbound.protection.outlook.com [40.107.94.42]) by mails.dpdk.org (Postfix) with ESMTP id CB93443175 for ; Tue, 21 Feb 2023 08:08:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KUxRKYGbt+kW3mgzceWnelrSisA0pwfkuB9ETJB2HpG3w1YLL550SiJxeYWj+sqaJxKxEHiTZ9JX98EMPK9+gc59VPtJLUODGcT1Ao5BEVtYTE6Z992KTd2opGDdhDFL2GvblZO7QvFvMDNioZQTXHthnYGwX+7G+SyGhHybQqHlHUzOFxTJ+9ORPc5A2mgr+uPLfIEfpY8UR4OYpIzTnCa4X5cwzln1kcyra4rp1PLqm8cfBEXXeypyu1+RDHe4kzqoJADaJMW6cK9B4Y/XM0sS7T+bTg+84/owLUhDdRlANGdMpuFHSzmk66UKIrExpn8tEx2oWcQWDymwVMZtOw== 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=HCQPeF91J5FjmxpSqJPNLS9IYVe+1wD7FLlfmKqVCKY=; b=b4NCbbDxtHbX6FfE3bC+CCXPYHw9LkR7kEnbIrpBB/OxObYB97zd8N3BYu+6yQ5cXw0gACZNQh75hWF9w9Apm8ifSOs1ZfLzO+gruUCEV4zQsxnkPjrQnrcYe4Wq/oLw+HhkiCyD41Hd5orQBGFndh6q9Ws4Cph+orO3EKa1mWJe6i4nBHuo3an3shpkAAsKvIID6Cvr77BYu5CEhuoY6BPRtkv8xvej5TGZbfeWqStPN7WxaRVsJZRB/LOA/oqT1Ntr0q8o+0/zFbD/3bmPruOLZSvOBUEsiqkg8XV5QHxJ83soXe53HpW3BGLiX4Iyl1rMVJcejp2aUM4V4WLKUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=HCQPeF91J5FjmxpSqJPNLS9IYVe+1wD7FLlfmKqVCKY=; b=GVfEwHaRUUgOI+j/1+kusG9SmEc90bmUL7mhhbmYZ3+CwvL679xrLPZkGJy5r/qAeIis75IWtW2v+Y4Oc8/zyDdQflEbmfrSZrXky8sxzL0UawSbFhdJ94uBcOuXS9E77Wl0Qcpw/ovtrrnRK3uXf3AMy8YZJ0S57P+I5Aotiax8HtZAqjQU9myMWe0nhBcBZ/ebnvlJ1Nf1zCX02Vojf3JsNLKDNqd/j9cm0XkczVGQQpBA8/2M0GB58ytOii5AVXOz/8ANtO/vpcYAUKoLSZbP9wecEh6levhuA8Wt5bQTrQyWGKpnj+P2vNmtQbjo0co7/PwKHRuarc/vgr/EVA== Received: from BN9PR03CA0729.namprd03.prod.outlook.com (2603:10b6:408:110::14) by CO6PR12MB5490.namprd12.prod.outlook.com (2603:10b6:303:13d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.19; Tue, 21 Feb 2023 07:08:33 +0000 Received: from BN8NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::29) by BN9PR03CA0729.outlook.office365.com (2603:10b6:408:110::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Tue, 21 Feb 2023 07:08:33 +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 BN8NAM11FT083.mail.protection.outlook.com (10.13.177.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.17 via Frontend Transport; Tue, 21 Feb 2023 07:08:32 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Mon, 20 Feb 2023 23:08:16 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 20 Feb 2023 23:08:15 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:14 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" Subject: [PATCH v3 7/8] common/mlx5: add LZ4 capabilities check Date: Tue, 21 Feb 2023 09:07:55 +0200 Message-ID: <20230221070756.3070819-8-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT083:EE_|CO6PR12MB5490:EE_ X-MS-Office365-Filtering-Correlation-Id: 447945f2-8387-4b7b-0c86-08db13da717d X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YiZeAsL4bwQu8s/6nG4msudHkMN8UqU+wSWVZLbCfgw4KFY3okfVwW2OCAs69ZR/LPqBAqFIkRjL8A9baGYcJzZ677gimL+LjpVCJRbjJPzbbSCKW1LEf4SzDLYi+vFNJCrkW2LVnc2kbz3rG9UH5mmIN2l/7gedIR3WocUQTtf1BDtM13BZuDTmFNYHW7MJcjiooCiFip3Vumj4n+5f70ew+ZeEnpOyRWGUa+BxAdoMyHEqq5PhSDy41neKqvWvcJY5FiqC8X3YBuVcyewL5+BPCdS3GdariKwpdwsA+fpXcgOM1hgpobz+i9DpiAr+Rqs/BH8ORwKQuM4ZGXRBeE1EofgJOKVv2pPFUdBoj8Q1O26IQZwRbkwyYmXpwozlaNrzePsv5d62up96hFLAGRDaamWTqk3M+MqACno3bv3RmfqsNVHnuoFSfuRHS96xN76qKwOWydxXuPBdp9IUeaTmRt5bOuh9ykw9sZ0Smxf74bABoAYB6mIiOoERFMtxoj9fsGy1tz+ekFmvfwvBcOP/G5P/ccuGVRya1aiDWjJbDbWoYDhgwuRvKWCm4YhjZ4aVWjYvIB0tp+yjofsxCYbJLxOUB1zunNflSmH4gCptBWP21D+0osC/Cfw3GFDAUgfhffT/jAfPRnIPmoLdNIEwlfRznp9zTLoBS9H4rnQhmU5CVURyAzC2uZ57rUjBm9ihvmzW1pvlg3ylW3z7WQ== 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)(376002)(136003)(346002)(39860400002)(396003)(451199018)(40470700004)(36840700001)(46966006)(82740400003)(36860700001)(5660300002)(82310400005)(86362001)(7636003)(2906002)(336012)(40480700001)(478600001)(36756003)(186003)(47076005)(26005)(426003)(6286002)(40460700003)(356005)(55016003)(7696005)(1076003)(70586007)(83380400001)(54906003)(316002)(4326008)(41300700001)(8676002)(6916009)(70206006)(8936002)(2616005)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:32.8688 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 447945f2-8387-4b7b-0c86-08db13da717d 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: BN8NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5490 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 Add capabilities check for LZ4 decompression algorithm. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 3 +++ drivers/common/mlx5/mlx5_prm.h | 16 ++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index b801b05872..bd0e1c6398 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -998,6 +998,12 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, log_compress_mmo_size); attr->log_max_mmo_decompress = MLX5_GET(cmd_hca_cap, hcattr, log_decompress_mmo_size); + attr->decomp_lz4_data_only_en = MLX5_GET(cmd_hca_cap, hcattr, + decompress_lz4_data_only_v2); + attr->decomp_lz4_no_checksum_en = MLX5_GET(cmd_hca_cap, hcattr, + decompress_lz4_no_checksum_v2); + attr->decomp_lz4_checksum_en = MLX5_GET(cmd_hca_cap, hcattr, + decompress_lz4_checksum_v2); attr->cqe_compression = MLX5_GET(cmd_hca_cap, hcattr, cqe_compression); attr->mini_cqe_resp_flow_tag = MLX5_GET(cmd_hca_cap, hcattr, mini_cqe_resp_flow_tag); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 045ff404e9..96c4c1a819 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -271,6 +271,9 @@ struct mlx5_hca_attr { uint32_t log_max_mmo_dma:5; uint32_t log_max_mmo_compress:5; uint32_t log_max_mmo_decompress:5; + uint32_t decomp_lz4_data_only_en:1; + uint32_t decomp_lz4_no_checksum_en:1; + uint32_t decomp_lz4_checksum_en:1; uint32_t umr_modify_entity_size_disabled:1; uint32_t umr_indirect_mkey_disabled:1; uint32_t log_min_stride_wqe_sz:5; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index b33c55c257..75af636f59 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -584,9 +584,19 @@ struct mlx5_rdma_write_wqe { #define MLX5_OPC_MOD_MMO_DECOMP 0x3u #define MLX5_OPC_MOD_MMO_DMA 0x1u +#define WQE_GGA_DECOMP_DEFLATE 0x0u +#define WQE_GGA_DECOMP_LZ4 0x2u + +#define MLX5_GGA_DECOMP_LZ4_BLOCK_WITHOUT_CHECKSUM 0x1u +#define MLX5_GGA_DECOMP_LZ4_BLOCK_WITH_CHECKSUM 0x2u + #define WQE_GGA_COMP_WIN_SIZE_OFFSET 12u #define WQE_GGA_COMP_BLOCK_SIZE_OFFSET 16u #define WQE_GGA_COMP_DYNAMIC_SIZE_OFFSET 20u +#define WQE_GGA_DECOMP_PARAMS_OFFSET 20u +#define WQE_GGA_DECOMP_TYPE_OFFSET 8u +#define WQE_GGA_DECOMP_BLOCK_INDEPENDENT_OFFSET 22u + #define MLX5_GGA_COMP_WIN_SIZE_UNITS 1024u #define MLX5_GGA_COMP_WIN_SIZE_MAX (32u * MLX5_GGA_COMP_WIN_SIZE_UNITS) #define MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX 15u @@ -605,7 +615,7 @@ struct mlx5_gga_wqe { uint32_t opcode; uint32_t sq_ds; uint32_t flags; - uint32_t gga_ctrl1; /* ws 12-15, bs 16-19, dyns 20-23. */ + uint32_t gga_ctrl1; uint32_t gga_ctrl2; uint32_t opaque_lkey; uint64_t opaque_vaddr; @@ -1438,7 +1448,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_dma_mmo_size[0x5]; u8 reserved_at_70[0x3]; u8 log_compress_mmo_size[0x5]; - u8 reserved_at_78[0x3]; + u8 decompress_lz4_data_only_v2[0x1]; + u8 decompress_lz4_no_checksum_v2[0x1]; + u8 decompress_lz4_checksum_v2[0x1]; u8 log_decompress_mmo_size[0x5]; u8 log_max_srq_sz[0x8]; u8 log_max_qp_sz[0x8]; From patchwork Tue Feb 21 07:07:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 124280 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D120D41CFA; Tue, 21 Feb 2023 08:09:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA580431A9; Tue, 21 Feb 2023 08:08:41 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2058.outbound.protection.outlook.com [40.107.94.58]) by mails.dpdk.org (Postfix) with ESMTP id 08FCA43175 for ; Tue, 21 Feb 2023 08:08:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dq1/2vrJjLN72DU3VRDnfscQq9RuTIt5806fSXYGwrUMSxrQKtIdcGyptbMqqGHWKzh6ccd0ci9+RuHsJqNBPTM7w8MBXzlXpRyusLSzPfxeMMTXf6Bph5sv6QcfHGo03VCLf3nUoz9bke2sX0eiRZhTOA/D1SzcFORXBFn8NC9SlAijAZqh1w0NNsFq88i5bjsdYX0OjEST0dOtb112zM0L6kkCF6Ls1GT0Au8QKR8c6rt5q44h10Ucqw61/zhgQl0b6lwmOR5viYPULK1qDF2Jamj/5VnGXOqKSNNy+knJJIEoqWqhT1iZtQJtgPPjAWus5FLt1D+t0IvxbPAN0g== 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=U0I2pmU9R9WdVCFiHNp8bsAZPP6FZ1Dkvg+k4pnrLWM=; b=gHUIlEEJ+7hDD456zaXFjDNbICjGM04Ccr8ANh8caHa4am+JVOJ56h+DtaAtveaPZXcZS1+10gSHYVpeK0OLxqr0n7ksNtzeLmxWELRdGB7p4cTVx0Hj9pJQCw4AGbK2OroioMsz5IQFLe9SvieLBISA1wCZ1nTj0SmLcMuNQpdCCXx+u+uMdiaXbqxoc7SCh3LhtOZxzdn6sILHyv0hZOSDshL6hVLtxXenmKKv6ggUTSXx9OYmxloDt7U1kZm0WuwxKoizeHuRqCb0Pc280TdJDL6TGZHLBdpnd3k8VjWqnbyD/Br9KiefNcH1KKpc2PvvHJeWNvCgVqDMmkp78g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=U0I2pmU9R9WdVCFiHNp8bsAZPP6FZ1Dkvg+k4pnrLWM=; b=lNRnuJJszVhfJ1mApotIuATEv6b4xffgBtWdUfKz5ftkmRQ0yciP8hCB+Eyd+n56/GuNXeswkq7fbsQgrz2PbF13OUHNZeq57CphADEiPmBxLTaZEQNWjbt0HjQdPvpdVB9NwIMnhSWk92Yz9D9hag+wjijUg1i2KHB1bHG55XgoXQWnip3MC7zM40rZqZ5byvl9QnMzNK/3usDlfCoDKsmE2uzpURMreh4GTNWwrFcg87PXo+p8wTfXlnWvggn75AYt4tezu7HuZNqg8PIv/mXUZTM2bnOfIN/yg+M0tSGRx8sPZlI/PMJYZo+T7woNrsKWjDe54KPElf7gy7/REA== Received: from BN0PR03CA0056.namprd03.prod.outlook.com (2603:10b6:408:e7::31) by PH7PR12MB7115.namprd12.prod.outlook.com (2603:10b6:510:1ee::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.19; Tue, 21 Feb 2023 07:08:34 +0000 Received: from BN8NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::7) by BN0PR03CA0056.outlook.office365.com (2603:10b6:408:e7::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Tue, 21 Feb 2023 07:08:34 +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 BN8NAM11FT081.mail.protection.outlook.com (10.13.177.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.17 via Frontend Transport; Tue, 21 Feb 2023 07:08:34 +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; Mon, 20 Feb 2023 23:08:18 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.36; Mon, 20 Feb 2023 23:08:17 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Mon, 20 Feb 2023 23:08:16 -0800 From: Michael Baum To: CC: Matan Azrad , Akhil Goyal , "Thomas Monjalon" Subject: [PATCH v3 8/8] compress/mlx5: add support for LZ4 algorithm Date: Tue, 21 Feb 2023 09:07:56 +0200 Message-ID: <20230221070756.3070819-9-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230221070756.3070819-1-michaelba@nvidia.com> References: <20230202162537.1067595-1-michaelba@nvidia.com> <20230221070756.3070819-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT081:EE_|PH7PR12MB7115:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cf9d7e8-f861-4f27-857a-08db13da7240 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Py4gKit9ITLEU3kwgy/dV9IvWKpWA4Bns6gx7a5IbE8FQUDzr6fTg5hlNOx+dZB+iTBoQ4sYwJNI0HsheCdhznu5n1JrWgtOKN9aCZIurbbahUGlWex1gxER43LxorhSmuX6iHYcIoif6OQHZBb40r9bDyfuK+D/d16CqnxRGuDH0eBFwiYENxorF4FNq4HmS4aIJfZ8aR9ciO+9jCNwQD5u1wACxpRpbGIXQGKvGMsIxDjzjLZuOmGonoaxrxCBvgbZuMliomjF8osvlA+Pn+bDgNAmA+VXQlU8VQ5DlDc7ToB0D9d4pEdHNZuiokerHR0IOCX4kOB+X2fLX3u8Fu47wxQpKofN40lUQhQMI7PnaWqCnCPz28CYuiZU5a+VvpTWaFCYextK6eFV+Y8KVSchRZ3gh8D6pPl1DRIbQIOMWtIRA/UkwlHxIzAmyR1u9EOWEwMJvnLgE5woTy6md1FoRCx+El1sPBc16X1g0BbRTSm2YSe2e3XsqXugxwCjc1RH6h9vONu6ROQH7yfBv9VRNsv4xeRl++f0Vp48X/iGu/i1tKntSJJTodUBMs3TdHH4N4mzukMnPUjKYNeL35j+l/AbSmjZJ1A2WJrGv0gB91qynGB5mTokCHMzK5qYgfYXAGJ0dEaFzmimUt/ItkPMdPcVG7np3cZ0OXcANVzFQ6bRkMZKreJsJ5r/t7nEKBo3ANoHUssNfhtwlRoy7g== 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)(39860400002)(376002)(396003)(136003)(451199018)(40470700004)(36840700001)(46966006)(2906002)(316002)(7636003)(82740400003)(36756003)(86362001)(5660300002)(40460700003)(30864003)(55016003)(8936002)(8676002)(41300700001)(356005)(4326008)(6916009)(70586007)(70206006)(40480700001)(36860700001)(54906003)(82310400005)(83380400001)(47076005)(336012)(6666004)(426003)(1076003)(6286002)(26005)(7696005)(2616005)(186003)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 07:08:34.1655 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cf9d7e8-f861-4f27-857a-08db13da7240 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: BN8NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7115 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 Add support for decompress LZ4 algorithm for mlx5 PMD. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- doc/guides/compressdevs/features/mlx5.ini | 18 ++- doc/guides/compressdevs/mlx5.rst | 44 +++++- doc/guides/rel_notes/release_23_03.rst | 4 + drivers/compress/mlx5/mlx5_compress.c | 157 ++++++++++++++++++---- 4 files changed, 184 insertions(+), 39 deletions(-) diff --git a/doc/guides/compressdevs/features/mlx5.ini b/doc/guides/compressdevs/features/mlx5.ini index 891ce47936..28b050144a 100644 --- a/doc/guides/compressdevs/features/mlx5.ini +++ b/doc/guides/compressdevs/features/mlx5.ini @@ -4,10 +4,14 @@ ; Supported features of 'MLX5' compression driver. ; [Features] -HW Accelerated = Y -Deflate = Y -Adler32 = Y -Crc32 = Y -Adler32&Crc32 = Y -Fixed = Y -Dynamic = Y +HW Accelerated = Y +Deflate = Y +LZ4 = Y +Adler32 = Y +Crc32 = Y +Adler32&Crc32 = Y +xxHash32 = Y +Fixed = Y +Dynamic = Y +LZ4 Block Checksum = Y +LZ4 Block Independence = Y diff --git a/doc/guides/compressdevs/mlx5.rst b/doc/guides/compressdevs/mlx5.rst index 8bf4423882..751fae7184 100644 --- a/doc/guides/compressdevs/mlx5.rst +++ b/doc/guides/compressdevs/mlx5.rst @@ -39,11 +39,27 @@ Features Compress mlx5 PMD has support for: -Compression/Decompression algorithm: +- Compression +- Decompression +- DMA -* DEFLATE. +Algorithms +---------- -NULL algorithm for DMA operations. +NULL algorithm +~~~~~~~~~~~~~~ + +NULL algorithm is the way to perform DMA operations. +It works through either compress or decompress operation. + +Shareable transformation. + +Checksum generation: + +* CRC32, Adler32 and combined checksum. + +DEFLATE algorithm +~~~~~~~~~~~~~~~~~ Huffman code type: @@ -60,11 +76,31 @@ Checksum generation: * CRC32, Adler32 and combined checksum. +LZ4 algorithm +~~~~~~~~~~~~~ + +Support for flags: + +* ``RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM`` +* ``RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE`` + +Window size support: + +1KB, 2KB, 4KB, 8KB, 16KB and 32KB. + +Shareable transformation. + +Checksum generation: + +* xxHash-32 checksum. + Limitations ----------- * Scatter-Gather, SHA and Stateful are not supported. * Non-compressed block is not supported in compress (supported in decompress). +* Compress operation is not supported by BlueField-3. +* LZ4 algorithm is not supported by BlueField-2. Driver options -------------- @@ -75,7 +111,7 @@ for an additional list of options shared with other mlx5 drivers. - ``log-block-size`` parameter [int] Log of the Huffman block size in the Deflate algorithm. - Values from [4-15]; value x means block size is 2^x. + Values from [4-15]; value x means block size is 2\ :sup:`x`. The default value is 15. diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst index 49c18617a5..8b9c47fd63 100644 --- a/doc/guides/rel_notes/release_23_03.rst +++ b/doc/guides/rel_notes/release_23_03.rst @@ -183,6 +183,10 @@ New Features Added LZ4 compression algorithm with xxHash-32 for the checksum. +* **Updated NVIDIA mlx5 compress PMD.** + + Added LZ4 algorithm support for decompress operation. + * **Updated the eventdev reconfigure logic for service based adapters.** * eventdev reconfig logic is enhanced to increment the diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 3ea3447f11..41d9752833 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -24,6 +24,7 @@ #define MLX5_COMPRESS_DRIVER_NAME mlx5_compress #define MLX5_COMPRESS_MAX_QPS 1024 #define MLX5_COMP_MAX_WIN_SIZE_CONF 6u +#define MLX5_COMP_NUM_SUP_ALGO 4 struct mlx5_compress_devarg_params { uint32_t log_block_sz; @@ -43,6 +44,7 @@ struct mlx5_compress_priv { struct mlx5_common_device *cdev; /* Backend mlx5 device. */ struct mlx5_uar uar; struct rte_compressdev_config dev_config; + struct rte_compressdev_capabilities caps[MLX5_COMP_NUM_SUP_ALGO]; LIST_HEAD(xform_list, mlx5_compress_xform) xform_list; rte_spinlock_t xform_sl; uint32_t log_block_sz; @@ -70,36 +72,16 @@ static pthread_mutex_t priv_list_lock = PTHREAD_MUTEX_INITIALIZER; int mlx5_compress_logtype; -static const struct rte_compressdev_capabilities mlx5_caps[] = { - { - .algo = RTE_COMP_ALGO_NULL, - .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM | - RTE_COMP_FF_CRC32_CHECKSUM | - RTE_COMP_FF_CRC32_ADLER32_CHECKSUM | - RTE_COMP_FF_SHAREABLE_PRIV_XFORM, - }, - { - .algo = RTE_COMP_ALGO_DEFLATE, - .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM | - RTE_COMP_FF_CRC32_CHECKSUM | - RTE_COMP_FF_CRC32_ADLER32_CHECKSUM | - RTE_COMP_FF_SHAREABLE_PRIV_XFORM | - RTE_COMP_FF_HUFFMAN_FIXED | - RTE_COMP_FF_HUFFMAN_DYNAMIC, - .window_size = {.min = 10, .max = 15, .increment = 1}, - }, - RTE_COMP_END_OF_CAPABILITIES_LIST() -}; - static void mlx5_compress_dev_info_get(struct rte_compressdev *dev, struct rte_compressdev_info *info) { - RTE_SET_USED(dev); - if (info != NULL) { + if (dev != NULL && info != NULL) { + struct mlx5_compress_priv *priv = dev->data->dev_private; + info->max_nb_queue_pairs = MLX5_COMPRESS_MAX_QPS; info->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED; - info->capabilities = mlx5_caps; + info->capabilities = priv->caps; } } @@ -236,6 +218,8 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, qp_attr.num_of_receive_wqes = 0; qp_attr.num_of_send_wqbbs = RTE_BIT32(log_ops_n); qp_attr.mmo = attr->mmo_compress_qp_en || attr->mmo_dma_qp_en || + attr->decomp_lz4_checksum_en || + attr->decomp_lz4_no_checksum_en || attr->decomp_deflate_v1_en || attr->decomp_deflate_v2_en; ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp, qp_attr.num_of_send_wqbbs * @@ -280,7 +264,11 @@ mlx5_compress_xform_validate(const struct rte_comp_xform *xform, return -ENOTSUP; } else if (!attr->mmo_compress_qp_en && !attr->mmo_compress_sq_en) { - DRV_LOG(ERR, "Not enough capabilities to support compress operation, maybe old FW/OFED version?"); + DRV_LOG(ERR, "Not enough capabilities to support compress operation."); + return -ENOTSUP; + } + if (xform->compress.algo == RTE_COMP_ALGO_LZ4) { + DRV_LOG(ERR, "LZ4 compression is not supported."); return -ENOTSUP; } if (xform->compress.level == RTE_COMP_LEVEL_NONE) { @@ -291,6 +279,10 @@ mlx5_compress_xform_validate(const struct rte_comp_xform *xform, DRV_LOG(ERR, "SHA is not supported."); return -ENOTSUP; } + if (xform->compress.chksum == RTE_COMP_CHECKSUM_XXHASH32) { + DRV_LOG(ERR, "xxHash32 checksum isn't supported in compress operation."); + return -ENOTSUP; + } break; case RTE_COMP_DECOMPRESS: switch (xform->decompress.algo) { @@ -307,6 +299,44 @@ mlx5_compress_xform_validate(const struct rte_comp_xform *xform, DRV_LOG(ERR, "Not enough capabilities to support decompress DEFLATE algorithm, maybe old FW/OFED version?"); return -ENOTSUP; } + switch (xform->decompress.chksum) { + case RTE_COMP_CHECKSUM_NONE: + case RTE_COMP_CHECKSUM_CRC32: + case RTE_COMP_CHECKSUM_ADLER32: + case RTE_COMP_CHECKSUM_CRC32_ADLER32: + break; + case RTE_COMP_CHECKSUM_XXHASH32: + default: + DRV_LOG(ERR, "DEFLATE algorithm doesn't support %u checksum.", + xform->decompress.chksum); + return -ENOTSUP; + } + break; + case RTE_COMP_ALGO_LZ4: + if (!attr->decomp_lz4_no_checksum_en && + !attr->decomp_lz4_checksum_en) { + DRV_LOG(ERR, "Not enough capabilities to support decompress LZ4 algorithm, maybe old FW/OFED version?"); + return -ENOTSUP; + } + if (xform->decompress.lz4.flags & + RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM) { + if (!attr->decomp_lz4_checksum_en) { + DRV_LOG(ERR, "Not enough capabilities to support decompress LZ4 block with checksum param, maybe old FW/OFED version?"); + return -ENOTSUP; + } + } else { + if (!attr->decomp_lz4_no_checksum_en) { + DRV_LOG(ERR, "Not enough capabilities to support decompress LZ4 block without checksum param, maybe old FW/OFED version?"); + return -ENOTSUP; + } + } + if (xform->decompress.chksum != + RTE_COMP_CHECKSUM_XXHASH32 && + xform->decompress.chksum != + RTE_COMP_CHECKSUM_NONE) { + DRV_LOG(ERR, "LZ4 algorithm supports only xxHash32 checksum."); + return -ENOTSUP; + } break; default: DRV_LOG(ERR, "Algorithm %u is not supported.", @@ -383,6 +413,27 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, case RTE_COMP_ALGO_DEFLATE: xfrm->opcode += MLX5_OPC_MOD_MMO_DECOMP << WQE_CSEG_OPC_MOD_OFFSET; + xfrm->gga_ctrl1 += WQE_GGA_DECOMP_DEFLATE << + WQE_GGA_DECOMP_TYPE_OFFSET; + break; + case RTE_COMP_ALGO_LZ4: + xfrm->opcode += MLX5_OPC_MOD_MMO_DECOMP << + WQE_CSEG_OPC_MOD_OFFSET; + xfrm->gga_ctrl1 += WQE_GGA_DECOMP_LZ4 << + WQE_GGA_DECOMP_TYPE_OFFSET; + if (xform->decompress.lz4.flags & + RTE_COMP_LZ4_FLAG_BLOCK_CHECKSUM) + xfrm->gga_ctrl1 += + MLX5_GGA_DECOMP_LZ4_BLOCK_WITH_CHECKSUM << + WQE_GGA_DECOMP_PARAMS_OFFSET; + else + xfrm->gga_ctrl1 += + MLX5_GGA_DECOMP_LZ4_BLOCK_WITHOUT_CHECKSUM + << WQE_GGA_DECOMP_PARAMS_OFFSET; + if (xform->decompress.lz4.flags & + RTE_COMP_LZ4_FLAG_BLOCK_INDEPENDENCE) + xfrm->gga_ctrl1 += 1u << + WQE_GGA_DECOMP_BLOCK_INDEPENDENT_OFFSET; break; default: goto err; @@ -390,7 +441,7 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, xfrm->csum_type = xform->decompress.chksum; break; default: - DRV_LOG(ERR, "Algorithm %u is not supported.", xform->type); + DRV_LOG(ERR, "Operation %u is not supported.", xform->type); goto err; } DRV_LOG(DEBUG, "New xform: gga ctrl1 = 0x%08X opcode = 0x%08X csum " @@ -657,6 +708,10 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops, ((uint64_t)rte_be_to_cpu_32 (opaq[idx].data[crc32_idx + 1]) << 32); break; + case RTE_COMP_CHECKSUM_XXHASH32: + op->output_chksum = (uint64_t)rte_be_to_cpu_32 + (opaq[idx].v2.xxh32); + break; default: break; } @@ -720,6 +775,49 @@ mlx5_compress_handle_devargs(struct mlx5_kvargs_ctrl *mkvlist, return 0; } +static void +mlx5_compress_fill_caps(struct mlx5_compress_priv *priv, + const struct mlx5_hca_attr *attr) +{ + struct rte_compressdev_capabilities caps[] = { + { + .algo = RTE_COMP_ALGO_NULL, + .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM | + RTE_COMP_FF_CRC32_CHECKSUM | + RTE_COMP_FF_CRC32_ADLER32_CHECKSUM | + RTE_COMP_FF_SHAREABLE_PRIV_XFORM, + }, + { + .algo = RTE_COMP_ALGO_DEFLATE, + .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM | + RTE_COMP_FF_CRC32_CHECKSUM | + RTE_COMP_FF_CRC32_ADLER32_CHECKSUM | + RTE_COMP_FF_SHAREABLE_PRIV_XFORM | + RTE_COMP_FF_HUFFMAN_FIXED | + RTE_COMP_FF_HUFFMAN_DYNAMIC, + .window_size = {.min = 10, .max = 15, .increment = 1}, + }, + { + .algo = RTE_COMP_ALGO_LZ4, + .comp_feature_flags = RTE_COMP_FF_XXHASH32_CHECKSUM | + RTE_COMP_FF_SHAREABLE_PRIV_XFORM | + RTE_COMP_FF_LZ4_BLOCK_INDEPENDENCE, + .window_size = {.min = 1, .max = 15, .increment = 1}, + }, + RTE_COMP_END_OF_CAPABILITIES_LIST() + }; + priv->caps[0] = caps[0]; + priv->caps[1] = caps[1]; + if (attr->decomp_lz4_checksum_en || attr->decomp_lz4_no_checksum_en) { + priv->caps[2] = caps[2]; + if (attr->decomp_lz4_checksum_en) + priv->caps[2].comp_feature_flags |= + RTE_COMP_FF_LZ4_BLOCK_WITH_CHECKSUM; + priv->caps[3] = caps[3]; + } else + priv->caps[2] = caps[3]; +} + static int mlx5_compress_dev_probe(struct mlx5_common_device *cdev, struct mlx5_kvargs_ctrl *mkvlist) @@ -740,7 +838,8 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, rte_errno = ENOTSUP; return -rte_errno; } - if (!attr->decomp_deflate_v1_en && !attr->decomp_deflate_v2_en && + if (!attr->decomp_lz4_checksum_en && !attr->decomp_lz4_no_checksum_en && + !attr->decomp_deflate_v1_en && !attr->decomp_deflate_v2_en && !attr->mmo_decompress_sq_en && !attr->mmo_compress_qp_en && !attr->mmo_compress_sq_en && !attr->mmo_dma_qp_en && !attr->mmo_dma_sq_en) { @@ -763,7 +862,8 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, compressdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED; priv = compressdev->data->dev_private; priv->log_block_sz = devarg_prms.log_block_sz; - if (attr->decomp_deflate_v2_en) + if (attr->decomp_deflate_v2_en || attr->decomp_lz4_checksum_en || + attr->decomp_lz4_no_checksum_en) crc32_opaq_offset = offsetof(union mlx5_gga_compress_opaque, v2.crc32); else @@ -773,6 +873,7 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev, priv->crc32_opaq_offs = crc32_opaq_offset / 4; priv->cdev = cdev; priv->compressdev = compressdev; + mlx5_compress_fill_caps(priv, attr); if (mlx5_devx_uar_prepare(cdev, &priv->uar) != 0) { rte_compressdev_pmd_destroy(priv->compressdev); return -1;