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 BCF82A034C; Wed, 23 Feb 2022 14:31:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58E3741226; Wed, 23 Feb 2022 14:31:57 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2084.outbound.protection.outlook.com [40.107.93.84]) by mails.dpdk.org (Postfix) with ESMTP id 66415411B2; Wed, 23 Feb 2022 14:31:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d8XdgqCjoBS8YHqkSTcEA9Chnoq2ALEejIpHXc6nBBD6Y29my0qMzy7xJ7a591qRFuWUoqavwJ2+wjxQvwYB82J8LgGkIL3RNLmstcWHVpqNV4SOlPCKVaHJ+5vcDZKzk8wQbIV55O5mZKObBjBlG6K0C6nX6DUMyOzutyIyAwTjI7r/fmzxEKoUtioDgCcCbc6xYunBqE7gT8qUzm2yxUxBOFvab1Gjg5g8K/9GxHFZCaqp1kzE4Mv3CEruLJY3oNJAjCOvK6o9SSZQ14Osr66d1zWvMl6RqssgJGlNo1mY3HTTt4z/mQ2hYRHcxHY92TXA1SDYyU7vOdToBjG1bQ== 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=EkHYQ7T+RVVeY4rJb5TejadDMwnfT+ImwLvjThan8es=; b=NfTZB6o7KszafKeAFDIUmoW2b9yuR+rkb0fh8WEAeTyykM6tXAsCHrt5EaOg26s2Uww6tQDH77VHYe2uuMq5hEgjrvW3/mmp+kU9blKpUjBMJe1YTtQX4vBxu5N66RSuaZobspEDBpZKSAUJCtU3Vp7had6F+16YGLQktkOxdO+2y5SdXNva6rA/NQ9oVCfxJwRmDC9uOhbp9kNmCbnIrdwNVfwgxk8Ym/xu2qo8oBio22yOXOpY6qIQMReHzYgtpFCxYenp5IRfFNq7buixbrH7G7/aRdlRLJbiNW+wfUWhQp73ICrTm5SuFia0ryveoDVmPhOpLcddQU6qsq6I0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=EkHYQ7T+RVVeY4rJb5TejadDMwnfT+ImwLvjThan8es=; b=fG9qsBXk8RCqTLq30/+G/theZpb8ZCqRtMWbCDWd5/yR/3KEadvZMF9+EqpA0Ggt/ZLCBBlLz/Cz8cb5NYxupaMeCUbCfJVrhefglIRx80fR/mr/1cE7fF1XA1Or8Kf055Nd9GmoqNjaQscW/d8Dhj2BCw2fYdGw5uRgs9RttQNTh0sI7XU6rP0VHzQu9IymhmjycWAnjlJnEMqFZOg8nTp1aO/eDug97MyKNdG/olScC0KrUMZCipHqUzO/WnYZmRLzerGvXP8JwEcrp4AbEjXRqA3fa802cesl6/1G+ilqJqr1O8ZCLorihtFqTEv4fgySEIefwpambwiq6roSVw== Received: from DM5PR04CA0043.namprd04.prod.outlook.com (2603:10b6:3:12b::29) by DM5PR1201MB0076.namprd12.prod.outlook.com (2603:10b6:4:55::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 23 Feb 2022 13:31:53 +0000 Received: from DM6NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:3:12b:cafe::46) by DM5PR04CA0043.outlook.office365.com (2603:10b6:3:12b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21 via Frontend Transport; Wed, 23 Feb 2022 13:31:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT019.mail.protection.outlook.com (10.13.172.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Wed, 23 Feb 2022 13:31:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 23 Feb 2022 13:31:52 +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; Wed, 23 Feb 2022 05:31:50 -0800 From: Raja Zidane To: CC: , Subject: [PATCH] compress/mlx5: support out-of-space status Date: Wed, 23 Feb 2022 15:31:42 +0200 Message-ID: <20220223133142.13407-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.21.0 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: 888e3fc9-f7d8-495b-1886-08d9f6d0dacc X-MS-TrafficTypeDiagnostic: DM5PR1201MB0076: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: lZlRP2HYxJcddxpmuBxzI1F7z9rUj4PtjzlLz362FpsVUqvCTKPj9EUmiSdkk0DwMEA6fm022RQpXFmoA6uXRb4mLbeyiFP3kUf5mXuaLkdOV9BXZW+zSWezk2T2xxtgKBrXD4P4r+bZFwntUDSWqWQ+wPd8efbCWJxjVRt8/l9vriBkrW2AoVu4vBA4qi0iveK9lSVcjMxbsYGHCPcBucgD/im+yuBiZFlsumnGidzKekHsWfkSROOHQlDUy40Gk8diggoLFnwgm/BrerGcvJd2u6sdk5HSQi3UnvuhXruEiJ11iDrqGpXI8xirJCFqMs7/oT54Oeb/yMqKuofEVuMS6oVAC+gVcmVKOkSgN0+8o8m4DTumdh2yOR6lQf3UDYzqWN4a7ppwGJ7kIU0QSJtjtSKu8LI7NQD+AMXqD7S7b5N4j2ILelvi7JgEdFt8bCXaxTRIum0LQx/5cxRF6GnXBSDcu2JrcV7yd0S5R5RObgz50ZdW21hE8XROsEucVWRDU3BpDCj2m0cMG7ojaL7T86ahLGq31TLPfwBjkfl8KjCkty+IJ/Q6vMIvAYXijyrgAr+Z3VEO6rn/U38gNF3OYNmHn7YkRVawz13OKZofqOr6uDcdM+PwhoursC2dgXGz0wpA6GnMcn7d3Lq0v58cndu8FeBKYYr16pMEMAWLLCuKecfqvCdU3OTGHo73nrDhViVMgonm4fIAnjvf1Q== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(6916009)(82310400004)(1076003)(54906003)(316002)(86362001)(40460700003)(47076005)(55016003)(508600001)(36756003)(36860700001)(83380400001)(70586007)(70206006)(426003)(336012)(4326008)(6286002)(186003)(450100002)(16526019)(26005)(8936002)(5660300002)(6666004)(2906002)(2616005)(8676002)(81166007)(356005)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 13:31:53.2981 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 888e3fc9-f7d8-495b-1886-08d9f6d0dacc 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0076 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 matan@nvidia.com drivers/common/mlx5/mlx5_prm.h | 5 +++++ drivers/compress/mlx5/mlx5_compress.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 495b63191a..fc05734ecd 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -249,6 +249,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 @@ -559,6 +562,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..fc50b5bde9 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -562,7 +562,17 @@ 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?"); + default: + op->status = RTE_COMP_OP_STATUS_ERROR; + } op->consumed = 0; op->produced = 0; op->output_chksum = 0; -- 2.21.0