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 3C93741D50; Thu, 23 Feb 2023 13:50:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C04324322D; Thu, 23 Feb 2023 13:49:43 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2040.outbound.protection.outlook.com [40.107.94.40]) by mails.dpdk.org (Postfix) with ESMTP id 9B24E43230 for ; Thu, 23 Feb 2023 13:49:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVePbKohEiD04CetW+IWq/IzHtG0CZphfMAGofL13cdv8U2fU4Vda5VeTPEJHln8R9uJmC1JeDSBIdhf3DEvGswqit5LckgKjWqeDtBDRUHiPsnxyE7I0rVSBO0twY3f642nNkb1eXUYzpjBo4iHbZ149TLzSvG5xb5xu40uoUfIeMIwPrSHJCB8fuomNnKZHAoLaZfO5yDq6Hka2Oc2GQFpENQNNdy2SR31mC5rerbYSAwdmeSQLFq5qyTLTrghkDeP5Lz2+ems6ssmYw93q9K5t6XmFOKP+jbF83K+agvAJJ8lZyViy6VlWStoJCYY03qskE8qcyvk6kWIFK/gSA== 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=ec6BqG5l95X2xHeWUc5AIYedBWQFaMHSZDOE+C/4zMI=; b=YHiMzmSnBGdJOz+wgsFQ0EHC65uvjjaE2ibRWptMOSJhL283tQbCERvtpcf3A0DyLoxoufmJZCsf2mC9tdhCW3tLo2mxWeXHeK44VcEykCG818w6rXFT/kdRNYxSXQbptUaidzeNSzlgA/Y4u1o3ahuK+iLYeFDqVa4puUqEhYn7Wcgjboh1zhyNZLTPKqMK5dNPYp8sIaSItvITJH8bBNxw88j1AUBUnIuamR3A2ZyZR902rI4RrSfvYJTd+fC4yNuHbtrREDOd68cYC2SbHpRe+pDcHRadqm32e7dLpsgi/qYuUGDIR9YL21H/o7YTDrnXHWHf8VOWe+vYC+NhpA== 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=ec6BqG5l95X2xHeWUc5AIYedBWQFaMHSZDOE+C/4zMI=; b=pVMI3xEc7/f3MkGFV1u3zGYDflgbtC8e0GLJmwfrDRktowZQn12oRVokhMCmL3N8h5NFlxrlQTXCZYB1TGJ4Uf9CWuwYYSXKFo8tiUqMtizO/ioqCkg7+ZH6ddc3Gp26EsvE/m+4kxcEDHYBs8G9PIP2Pf4THKhvvyZ/UK62BYxB+ZefQy8dRyZRJTyUITWRx6r8x/8tfLXI5lPdST4D1NCqcGefX0TnLImY5HCVySZ3f+PcBsBNaaY4mtCObwDtZ2tWN2ffYCsnZApq0GPPPElaQJ2Zkn+KvjYxb8/A4QJ1UFueOEtUgr+wh2hRZ27tcjDP0NCbkpNkfVOYrc9ntw== Received: from BN9PR03CA0381.namprd03.prod.outlook.com (2603:10b6:408:f7::26) by PH0PR12MB7079.namprd12.prod.outlook.com (2603:10b6:510:21d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21; Thu, 23 Feb 2023 12:49:38 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f7:cafe::a8) by BN9PR03CA0381.outlook.office365.com (2603:10b6:408:f7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21 via Frontend Transport; Thu, 23 Feb 2023 12:49:38 +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 BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21 via Frontend Transport; Thu, 23 Feb 2023 12:49:37 +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; Thu, 23 Feb 2023 04:49:26 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 23 Feb 2023 04:49:24 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v4 6/6] net/mlx5: add error message Date: Thu, 23 Feb 2023 14:48:58 +0200 Message-ID: <20230223124858.1042097-7-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230223124858.1042097-1-rongweil@nvidia.com> References: <34229594.ATrlOLLGV9@thomas> <20230223124858.1042097-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT028:EE_|PH0PR12MB7079:EE_ X-MS-Office365-Filtering-Correlation-Id: edcb4444-3fd1-4155-009a-08db159c6c32 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: VwGzybfcyfMIvkUrClBb5Kt9ixYQk2Y+M7tg6MsCIPsN+wCFNwskhiMdmtSoeJBIwqhB6BaX3xDdF+EUoV9SKadCpwsk9IjMygykLFzKFQENm1s7TAye0cIWFugKJ8gjNtp/eawoV7gqESSzB5i5saqaXpPlKRx5b7z7+V77tOH/c0AmXCKsOmepqiVmA9X5uGStrwFmomudBHQEvoiYq7+ZRKg/xz2CxH6/l48CcVdfQBDhThaJqD/xxB3yeE92uTNTqiOMFvXLgZF4ZS4Ucg/5xqx9KujpTkseyctTpsittOjUVCV0FfUzLyqTUSwe9c9MjcN6m1CrkJ7MNkVHAwTg+Lkw2f6LyJB2TRmhcdqcRvld5S0gn4SdcsagPehxfvHzpoJ7AzV9HEadUe5iZfAEqZwiwNAuCvx+xNDZUn3XDULgwjV+VJgMgU2Z3DCA0mHJXxBb0A99wGKkT49mE394d2vBzelJ/VyfXuHGJvgCxJe6NBFfXeoEZjKUzhaPU6UDYWU/nFavHTXBogatdcBkOuHjK9VPaqTngSAZwb2He/GX6IX75idkfkXuuAAP5XqjEDOcQYZIMxZRBH7YY8HAXJps6EJ8Gn94zHkk3GOfVQXRb5DiVhFwAAXEBOJIRw79vMytct2tJRHCGE+3lEhdLNF+l0IdB2lYz9MQO3b49xq5U6a4ak9b5lW/dH+Z5CiDyEI15+s7KluFcf3uymGPYQr3e1rTTNJRTHqSQEA= 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)(39860400002)(396003)(376002)(451199018)(40470700004)(36840700001)(46966006)(40460700003)(70586007)(110136005)(83380400001)(70206006)(8676002)(316002)(8936002)(34020700004)(5660300002)(4326008)(41300700001)(1076003)(107886003)(2616005)(6666004)(16526019)(6286002)(26005)(47076005)(426003)(186003)(478600001)(336012)(7696005)(356005)(36756003)(40480700001)(82310400005)(55016003)(86362001)(2906002)(82740400003)(36860700001)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 12:49:37.5323 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: edcb4444-3fd1-4155-009a-08db159c6c32 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: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7079 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 pattern/action template creation fails the testpmd expects error details. The driver did not set the error structure and testpmd failed with a segmentation fault. Signed-off-by: Rongwei Liu Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_hw.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 907aab8bf3..b43661674f 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -4570,8 +4570,12 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev, &at->flex_item)) || (info->src.field == RTE_FLOW_FIELD_FLEX_ITEM && flow_hw_flex_item_acquire(dev, info->src.flex_handle, - &at->flex_item))) + &at->flex_item))) { + rte_flow_error_set(error, rte_errno, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "Failed to acquire flex item"); goto error; + } } } at->tmpl = flow_hw_dr_actions_template_create(at); @@ -4587,6 +4591,9 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev, mlx5dr_action_template_destroy(at->tmpl); mlx5_free(at); } + rte_flow_error_set(error, rte_errno, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "Failed to create action template"); return NULL; } @@ -4936,6 +4943,9 @@ flow_hw_pattern_template_create(struct rte_eth_dev *dev, (mlx5_alloc_srh_flex_parser(dev))) { claim_zero(mlx5dr_match_template_destroy(it->mt)); mlx5_free(it); + rte_flow_error_set(error, rte_errno, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "cannot create IPv6 routing extension support"); return NULL; } } @@ -4948,6 +4958,9 @@ flow_hw_pattern_template_create(struct rte_eth_dev *dev, if (flow_hw_flex_item_acquire(dev, handle, &it->flex_item)) { claim_zero(mlx5dr_match_template_destroy(it->mt)); mlx5_free(it); + rte_flow_error_set(error, rte_errno, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "Failed to acquire flex item"); return NULL; } } -- 2.27.0