From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 93F0CA00C3; Sun, 27 Feb 2022 15:01:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D6394068A; Sun, 27 Feb 2022 15:01:36 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) by mails.dpdk.org (Postfix) with ESMTP id 136B040683; Sun, 27 Feb 2022 15:01:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YyuCnBuYj3h3jlQQc+HCuK4qtqs7yIEu8raaiXo3ZuJenaOk2zT8W2Ybin2+fE/yIeHszwwb+keFvRCEBCol3UAd/XAZkYEg1/8m+gj6JMf3yNadbCYejIHEX40R66Wo0BcSGMOHtIvnOIPSJW7AcvOG9tthb4uui5alhNi1SJOiDh5exCVPenFTDgmeistHbmvyPIJO990J9ibBzFvdy0TBBN/7jzkCiKiGT6YAVOQqL8RRZ4w0nFRr7td5o8580aoBERBoP9ZNncmeivvJN5nDBx/U88WXCzqls55qtr8+xmclkF6SRJcGVjCnx/zvyTveidYyUoznSOHtVKcsrw== 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=T6eu49oMQoi2vmBTG5Y8P7lraPugnE65+WOksaGYX5M=; b=Lb/XT7l3bGm94+1xRCA+mB42PdIZ5PAKoqssFppPd2gG8iSVdJ+M4w4hk6/OwDW5zQbkmN8WxZsQp5qc72gvUDNsW8X5odr9+WuEQ4CWonVVcT8UMimJZ6SpOpl1E/3RDVnQsPK/IAODaAISDNxJTIgPBY20QYJzD1QSRQvbtloDMxIcyXdyUQeSeGHc8MmxgdDH8hVNbDLRPD2s8ssS3lVci6L7bN1lYoj3qlX3WUHHw+nVoxEp81/hGzCFQmm57M9oxx9YRNmp2wvp9FcCrzv3vN+SePKaCpKx6H7pDKJDjxJT7nBG/3JzUcJ1vuabAUct3BKM0yKRT2wxw0A+Eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=T6eu49oMQoi2vmBTG5Y8P7lraPugnE65+WOksaGYX5M=; b=Q+kIUCHbTtnpjUSzRNkS1pikFVjjE5nVu72tjcxo/qV3NqXis++5YzPUic/zxmoDCOk7UMxSA6wp3WA2YSXINx4ALDfHVCeyJMxV/mg6gzR5SHYljww4TsQnimYzqiobcG6NkYU5MnV7vYFloCT1I/JQ+CVZgLmvyBuwzJ731vOqjKavvI48zQObupPP1AS0w5DhVA1W+lyHqnugoll4kTPlJP7JsO0bTw8CRSqBZEav3YABqOYROa/VWPQsCkkBKu/3/hlxFWNI7LRXJfbTsmb0QJHfl5ZqXcoSTNv2GUZ0CodeM65f6+DYNVKTItbGwkH+P19dhztSHxWAOohcCQ== Received: from BN6PR16CA0039.namprd16.prod.outlook.com (2603:10b6:405:14::25) by CH2PR12MB4119.namprd12.prod.outlook.com (2603:10b6:610:aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Sun, 27 Feb 2022 14:01:32 +0000 Received: from BN8NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:405:14:cafe::27) by BN6PR16CA0039.outlook.office365.com (2603:10b6:405:14::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26 via Frontend Transport; Sun, 27 Feb 2022 14:01:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT018.mail.protection.outlook.com (10.13.176.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Sun, 27 Feb 2022 14:01:31 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 27 Feb 2022 14:01:05 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Sun, 27 Feb 2022 06:01:03 -0800 From: Raja Zidane To: CC: , Subject: [PATCH V2] compress/mlx5: support out-of-space status Date: Sun, 27 Feb 2022 16:00:52 +0200 Message-ID: <20220227140052.13212-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220223133142.13407-1-rzidane@nvidia.com> References: <20220223133142.13407-1-rzidane@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5f1fb5e-0994-4c5e-8543-08d9f9f9a88e X-MS-TrafficTypeDiagnostic: CH2PR12MB4119:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FnkImMfWBYmuq1mrQJThXrUvhycSUPLatDUbs/kAsdLXSWd4GL2MrbSV5m+kgMgKGtGfmSIulEubG4AaIR/xzQsB8KcGxRFAOBnFvdAAgS43S2hASPW5/1r4elEWBEMz0xhmbR6SA/clKyLbnBvfQrA/N1sDzZ8lKbuU9feX7sWIN3+gVON6sluL9/+UP6eq78VgQUS+yeXG0euFf1Ij+7DzR8jIYlKi3q7UqIj3BfKoZ1i+OItXLD7dXStkcMPOWnSlSix1x4e6CTU7LHV3PKDutwfkCVADn8zP/Uf1e5KxdrFDpe2K0OyM27QDmcOSpxYD2y7jZGuzqkFte1UA3+ceHOWn1CYri7Ye6EdszKfbwy3nx367A/3BqdjaqdOiaJqUsKRo7VnG88EaDgvLMHs2osNeJ3g6olWw9W/v5ELV8VOzk8uEcJManD+FBb3SRdmofmmOgW1Sifr0MCNdraGgEpcwcpYLYjCTkaAojAKrLWXOE+l4E0+OkCemYLW1i0WY+LFajMkYKEtKAfoFgncYF8BJxOg+6KH+K3+G8rYeU1pe61ornO1Hgw6OGJD2l7QcaogNRcFUk8TbVqlMiQcHx+Jb3r/0qxE6ODapzZ0IAlQ0ldla2b1ebwppvggxsOxtxaBtegoUvbGzQjbo+sWlUxjklvQ7poCnx2DcIrpYmNENyAIUQxOBXNxWos/zJ4mB4cTCbmhOQMwL3Su9Vw== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(16526019)(81166007)(508600001)(40460700003)(6286002)(356005)(6666004)(316002)(54906003)(450100002)(6916009)(1076003)(336012)(186003)(26005)(7696005)(2616005)(426003)(70206006)(70586007)(82310400004)(36860700001)(4326008)(47076005)(36756003)(2906002)(83380400001)(8936002)(8676002)(55016003)(5660300002)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2022 14:01:31.8002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5f1fb5e-0994-4c5e-8543-08d9f9f9a88e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4119 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 When trying to dequeue, an OP may fail due to insufficient space for the OP output, the compressdev API defines out-of-space for OP status. The driver can detect out-of-space errors and report them to the user. Check if hw_error_syndrome specifies out-of-space and set the OP status accordingly. Also added an error message for a case of missing B-final flag. Fixes: f8c97babc9f4 ("compress/mlx5: add data-path functions") Cc: stable@dpdk.org Signed-off-by: Raja Zidane --- Acked-by: Matan Azrad V2: fix implicit switch-case fallthrough drivers/common/mlx5/mlx5_prm.h | 5 +++++ drivers/compress/mlx5/mlx5_compress.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index ce3e47059f..44b18225f6 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -262,6 +262,9 @@ /* Maximum number of DS in WQE. Limited by 6-bit field. */ #define MLX5_DSEG_MAX 63 +/* The 32 bit syndrome offset in struct mlx5_err_cqe. */ +#define MLX5_ERROR_CQE_SYNDROME_OFFSET 52 + /* The completion mode offset in the WQE control segment line 2. */ #define MLX5_COMP_MODE_OFFSET 2 @@ -581,6 +584,8 @@ struct mlx5_rdma_write_wqe { #define MLX5_GGA_COMP_LOG_BLOCK_SIZE_MAX 15u #define MLX5_GGA_COMP_LOG_DYNAMIC_SIZE_MAX 15u #define MLX5_GGA_COMP_LOG_DYNAMIC_SIZE_MIN 0u +#define MLX5_GGA_COMP_OUT_OF_SPACE_SYNDROME_BE 0x29D0084 +#define MLX5_GGA_COMP_MISSING_BFINAL_SYNDROME_BE 0x29D0011 struct mlx5_wqe_metadata_seg { uint32_t mmo_control_31_0; /* mmo_control_63_32 is in ctrl_seg.imm */ diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 7a482c3fbb..d64a628c74 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -562,7 +562,18 @@ mlx5_compress_cqe_err_handle(struct mlx5_compress_qp *qp, qp->qp.wqes; volatile struct mlx5_gga_compress_opaque *opaq = qp->opaque_mr.addr; - op->status = RTE_COMP_OP_STATUS_ERROR; + volatile uint32_t *synd_word = RTE_PTR_ADD(cqe, MLX5_ERROR_CQE_SYNDROME_OFFSET); + switch (*synd_word) { + case MLX5_GGA_COMP_OUT_OF_SPACE_SYNDROME_BE: + op->status = RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED; + DRV_LOG(DEBUG, "OUT OF SPACE error, output is bigger than dst buffer."); + break; + case MLX5_GGA_COMP_MISSING_BFINAL_SYNDROME_BE: + DRV_LOG(DEBUG, "The last compressed block missed the B-final flag; maybe the compressed data is not complete or garbaged?"); + /* fallthrough */ + default: + op->status = RTE_COMP_OP_STATUS_ERROR; + } op->consumed = 0; op->produced = 0; op->output_chksum = 0; -- 2.21.0