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 DB39741D49; Thu, 23 Feb 2023 08:07:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A87E3430E4; Thu, 23 Feb 2023 08:07:22 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id C56FB430A3 for ; Thu, 23 Feb 2023 08:07:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OuDdWeVx1x4kxnlf8QoOknAjelAc5ZitnLxNYtSYv+NiIAD+4XeXVNl2CAFFt+2v69AUny06GVNOcsRcSwBaZJH75uhEOvNijlzBLTeYCsZKpgJ0Re37J9rYqngsUrOdQoYK3M8VAp/BUlgDTG/H4UAbIT6RR0BB0VkUxxNGBOTF69r4V8CBE8Cys8VjlR5KrTiDZV08qK8UrMzwMAbpFL/RKXGAahFOwH97zbaBXbv6acwxHHaT/B0GN5aNqF9cF+PtFJQcQi248b6eVLAz2JuqywIa56jjQeEseWUjlJ7IUcuQcyM04dVWQgcoXnCodVjhTq9HFoqUnI2dMADn6w== 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=wltsPlIlL4lAEqelg2EYlQWUadGtXkOAosUsar2Y4Ms=; b=dp0wpAotfqpt/NsNBEJa91ZCQvV2XJWcRdJhQ8aVz4EnmBVgl6uOJgrIq758hjEX0pBYF0DOr76/AE9PjUpirtIO8tNxafVXd+UXQQ4ijYi5oWWqbYsZ58hzPb2zlB2K9AHmkJBxi2FJznVXi7FU1bKikHDQp2TJvSlqOi4+Io0uxU3OTZVl9Tj7F5QbhNycc2mxq/auo1NGGNGNDjvG+XSXC1CK7mTs32tZMS4j9U+HzkX2U1TU6LXLZI/by/vEWDeQD3iua55BvR1HM3qNvwBnDCR/ZCvXcoMj0aUgLPC8QyTI9vxqPYP3LaWW/BjYWehOabp6b5mESOQZsQuo8A== 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=wltsPlIlL4lAEqelg2EYlQWUadGtXkOAosUsar2Y4Ms=; b=qz6/pSWzL81cBdz0+TvvlLMF71I8x3aLkm+uEIEbyL/DHQzooiEy8v/pZ3DflmEUmfEaR1GHttEzP8cobeOjOeFdnEVJvGRL160XVBL+BkGtdLpzGYNaT3VowTEQvswLVbe3PiHgrbFJOtH9eRCjBUDBcmkiqFyFIRK67zSrNWAeVaIeG++H1RGH0NJvYY8nW2pBDSpaqoHvg7TKvyosAbA95vSwnEoGCLXCKvpOQTN8N/DMaJmu+Us7q5+Ni05fpNHAyA3MhFqlcM3YFTvFyXPEcS3ZdxDovY/YPdctdlQtxnaAnErRfpInJTZN0/byfgoP1RPpK4oj6DcmCqPO3A== Received: from CY5PR19CA0059.namprd19.prod.outlook.com (2603:10b6:930:1a::9) by SN7PR12MB7451.namprd12.prod.outlook.com (2603:10b6:806:29b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Thu, 23 Feb 2023 07:07:17 +0000 Received: from CY4PEPF0000C97A.namprd02.prod.outlook.com (2603:10b6:930:1a:cafe::44) by CY5PR19CA0059.outlook.office365.com (2603:10b6:930:1a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Thu, 23 Feb 2023 07:07: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 CY4PEPF0000C97A.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.16 via Frontend Transport; Thu, 23 Feb 2023 07:07:16 +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; Wed, 22 Feb 2023 23:07:04 -0800 Received: from nvidia.com (10.126.230.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; Wed, 22 Feb 2023 23:07:02 -0800 From: Rongwei Liu To: , , , , CC: Subject: [PATCH v3 7/7] net/mlx5: add error message Date: Thu, 23 Feb 2023 09:06:33 +0200 Message-ID: <20230223070633.946328-8-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230223070633.946328-1-rongweil@nvidia.com> References: <20230215115251.3924578-7-rongweil@nvidia.com> <20230223070633.946328-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C97A:EE_|SN7PR12MB7451:EE_ X-MS-Office365-Filtering-Correlation-Id: 04d3ac03-0e95-4e93-dd77-08db156c98c6 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: yH7Cndu91hM7ZiQ/5e+fHmcYMQ1Y+iO50rEedIzzLXI5a1+LyvOpI2x51vtSLIxyPcZL3zMkyEH9UmYKHt2FCvFVOWoaPRGMlAe6QPcOM6sr8DFpqDo1X5iDY4DM0/XJEIwmQOX5HDepr/60x6S/N0IR0r6sgxv+ndxdWJV43Iewe47lB1iu34fUpOUSYIQEJcbim6CE43mPfDoLv8jYu6nzepvMfFrZwT6SbrWLa18cwPObT7jUSgP5cQG7ZZU36tiT2inFdB7RXfC9C6jZsdnbMpM7PDiMZFZNww/qshikLcpypshkngu00FnaebJCkKdVeaI32TlcktHVIYgPBLFyugYimJYG/EXQIRLlJymeB/FCRenGV82SlnHUSSej1mmmF2e6I685tkBNgj5nGgzNvxQUbsCUCE9ngcJeC/kiUG0AwlhJFoljou21cvlpIPIuUSpWABMl32PHkqcNKtPlSNGQSjquQDjgNiVCm739Pcd2Y/nTyFxwqOx4WfV4caYlTKAA25f4zcouBaYyvHiejV+WyF9Q6lvwW+oywi+VzVrJ1F7cbDqeKa/Ct84nJ7aROSNVkMVSFwXw7Mnv+J/SXiRkh0+bswt/8upddPu79GbJwG5liX+P3ccouaV+9qNLXcW1b0rhC+534EZ+ltgqgyFWN+yryL3e7oKyYZpPO3pyUpB2ad6V2cLTp1LiyqNIXgx7b5t/xt/pNS/BJw== 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)(39860400002)(346002)(136003)(376002)(396003)(451199018)(46966006)(36840700001)(40470700004)(41300700001)(8936002)(2906002)(186003)(5660300002)(6286002)(16526019)(1076003)(6666004)(36860700001)(26005)(40480700001)(316002)(478600001)(70206006)(70586007)(7696005)(110136005)(4326008)(107886003)(8676002)(55016003)(83380400001)(40460700003)(36756003)(47076005)(426003)(2616005)(336012)(7636003)(82310400005)(86362001)(82740400003)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2023 07:07:16.5316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04d3ac03-0e95-4e93-dd77-08db156c98c6 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: CY4PEPF0000C97A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7451 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..38b9d55f3a 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 accquire flex item"); return NULL; } } -- 2.27.0