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 48A73A0C53; Wed, 1 Sep 2021 10:20:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E41C540E09; Wed, 1 Sep 2021 10:20:20 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2051.outbound.protection.outlook.com [40.107.244.51]) by mails.dpdk.org (Postfix) with ESMTP id 77EFB40698 for ; Wed, 1 Sep 2021 10:20:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lx1f78OoqwNzX0aTDPVbaH0zXPulwq05D0afD4RkAP4x90qL6PONls2yKpKiHCRDaXySCt6LhKU9sgdAu9w6qJ8/Ciw7Bw6nsPSkjHITO9S/eH3JTfj+2EpZasAXIip2rn5sGCj/GxOZWiyBRbnWIzQC9HX4ksAX/WvWx5KmfIMl3C7w/5DziW8JgXvl3a6m1CY41azuASPNcHordSqUrPDarOKlfR15C0e3+o/Y20xduey672KtboPKNJZ1KQxqdKYd7N1tqGxp+Up3jw5abuagEaGsVZdXZgZRtmslgUJ+tfBdGv4sFPeb3pIpKPa4tLPOiyoQkaNAu2tNGviH1g== 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-SenderADCheck; bh=6K9bn23NDCt0oTDeTUj3Otm/9jxDMi1uPQLyC9WLG9U=; b=dMJu5txRFnIJ8KeoKFstyDq7UGWy7cfcWEpT/MlxMWLL9YUzzA9zcCXjL5Sdr8r2cBl9wX/PC+p3obxr15LnQewAo4o+oXUGV4tiJrvwLxzlMH70V8Ns0MAC9+GHe5SHG4VIVYwoQ1G06HGMxdMjXkedWU1FUMEZSY/voLJMzkqUWKppoSro+cYQOahm5CF3Qu4mGeMmziA9gqdX7ofm74S/17f7OhShqTi7HSeBYcsGRN6RdOnQZIEgNVohwDZy++hhcMsvExFJapNH6DU5TWQlX7pAkBEvKIEDbBw2fb7DPJjO4CDpfTkEIY+JuXrUEUYoYljNeIKGOn9Qv5/Xtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=6K9bn23NDCt0oTDeTUj3Otm/9jxDMi1uPQLyC9WLG9U=; b=J9Je9PxTIDzPiXE/1j+cYemZOgpdzhDzsIbweR8o0hKVC8M2Yv/143JIEMdud8342glQ5OjLIOPgwM1QuYUI+m7nSbWX75d4QCg8xi1jFUeN3MiOlu4TaPeChtdczwOSF46t6v+Ltb1Hovk4lK82XHRDpg4L/f/fdUKC2uJpSQnLFaiRdXz+f5dyQJ8D+CN3b9kfzVkMkqRxkZAnzw6VikKWAmVyBXxR7T98WQ18A4iQzgJPlZK+A+B0D8dhRvrweZPzBKQxRlPBy1UanC7rkofPq0Tqdv2S7hJKAg+MENwXeQ/L9ONHvLxYxWYTy4rdL3f+s2bpV+Ju6xgdUhdurw== Received: from BN8PR15CA0030.namprd15.prod.outlook.com (2603:10b6:408:c0::43) by MWHPR1201MB0048.namprd12.prod.outlook.com (2603:10b6:301:59::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 1 Sep 2021 08:20:17 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:c0:cafe::13) by BN8PR15CA0030.outlook.office365.com (2603:10b6:408:c0::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.21 via Frontend Transport; Wed, 1 Sep 2021 08:20:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 08:20:17 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 01:20:16 -0700 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 08:20:14 +0000 From: Dmitry Kozlyuk To: CC: , Viacheslav Ovsiienko , "Matan Azrad" , Shahaf Shuler Date: Wed, 1 Sep 2021 11:19:57 +0300 Message-ID: <20210901081958.3643375-2-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210901081958.3643375-1-dkozlyuk@nvidia.com> References: <20210901081958.3643375-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b61c72ae-3b18-4d15-7203-08d96d2154bc X-MS-TrafficTypeDiagnostic: MWHPR1201MB0048: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0uBaxx3YuIB2zMs+ONZozJP/dGjAMCh3qoNjyRjqFO/rTBNeadkRUtII6TVT4fPNdspM9MZ4qD83SCOC5yqUzR+e5Jw4xj6tc9wPD3SMeoJBhpwcwsEQXmOGKfJu6519+orRisf3e8BnS1u7m+leSL4XJkhR8tGbTaRves1dsEHTNEQwtEJJWDE709/Wdn40EHILoVBkpUjDbosr8YbZVjpc2PDVs4qTh1grRPEO0RCOqBCGHqA0IN8sAaoSTDN8G6l7u9AYnek2tb6ck7pFxeGwvK8pU9C03RuamqZe4xQuY6k0T4uJ1wRXsJKYZI5sNICOkXVeGebvubnyJJ5t3RT7avB6CaSrY6YU6yammO/PBW7SXMfXGe7uU1amFHgTvBj4scZapS6VDAdcKXcpaBXOYv+QjrGuYRckMLPqDXlNGHxoUK7BSFuqoSBMbICnugirYTx5a2iedeKKffK5MjjeVAhsILJ+Jnu/vL6nlemJu0LXobA/ns+UMOMDi8b9MJRzRzbnklM3zfOFX8XYAGoqSq9czSGWn9+UQ34JAsfZceL4Qe+jOzJtLM2aIYxpatdB9ACH5r2a0/fvlQgmX1WQS3JJHG3cMgM71vdEag0WbSE0tXeTrqNQngPiqHGIaWzQfZLCaTGrM1jrxgVqbUff8xYEfWo4sXuLqgkgYfVW4P/GObr0VCtqLL0MqS0WQztDFrCasBkjLFOPqOuSsA== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(39860400002)(376002)(396003)(346002)(36840700001)(46966006)(356005)(2906002)(82740400003)(70586007)(478600001)(426003)(1076003)(26005)(4326008)(82310400003)(5660300002)(316002)(55016002)(336012)(6286002)(70206006)(7636003)(36756003)(86362001)(54906003)(7696005)(2616005)(107886003)(16526019)(6916009)(83380400001)(36860700001)(47076005)(6666004)(8936002)(186003)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2021 08:20:17.0991 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b61c72ae-3b18-4d15-7203-08d96d2154bc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0048 Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: report error on indirect CT action destroy 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 Sender: "dev" When an indirect CT action of mlx5 PMD could not be destroyed, rte_action_handle_destroy() was returning (-1), but the error structure was not filled. This lead to a segfault in testpmd on an attempt to print it. Fill the details for each possible cause of this error. Fixes: c5a49265fc23 ("net/mlx5: add ASO connection tracking destroy") Cc: bingz@nvidia.com Signed-off-by: Dmitry Kozlyuk Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 3f6f5dcfba..b769ae4007 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -12304,17 +12304,27 @@ flow_dv_aso_ct_dev_release(struct rte_eth_dev *dev, uint32_t idx) } static inline int -flow_dv_aso_ct_release(struct rte_eth_dev *dev, uint32_t own_idx) +flow_dv_aso_ct_release(struct rte_eth_dev *dev, uint32_t own_idx, + struct rte_flow_error *error) { uint16_t owner = (uint16_t)MLX5_INDIRECT_ACT_CT_GET_OWNER(own_idx); uint32_t idx = MLX5_INDIRECT_ACT_CT_GET_IDX(own_idx); struct rte_eth_dev *owndev = &rte_eth_devices[owner]; - RTE_SET_USED(dev); + int ret; MLX5_ASSERT(owner < RTE_MAX_ETHPORTS); if (dev->data->dev_started != 1) - return -1; - return flow_dv_aso_ct_dev_release(owndev, idx); + return rte_flow_error_set(error, EAGAIN, + RTE_FLOW_ERROR_TYPE_ACTION, + NULL, + "Indirect CT action cannot be destroyed when the port is stopped"); + ret = flow_dv_aso_ct_dev_release(owndev, idx); + if (ret < 0) + return rte_flow_error_set(error, EAGAIN, + RTE_FLOW_ERROR_TYPE_ACTION, + NULL, + "Current state prevents indirect CT action from being destroyed"); + return ret; } /* @@ -14365,7 +14375,7 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow) } /* Keep the current age handling by default. */ if (flow->indirect_type == MLX5_INDIRECT_ACTION_TYPE_CT && flow->ct) - flow_dv_aso_ct_release(dev, flow->ct); + flow_dv_aso_ct_release(dev, flow->ct, NULL); else if (flow->age) flow_dv_aso_age_release(dev, flow->age); if (flow->geneve_tlv_option) { @@ -14900,7 +14910,7 @@ flow_dv_action_destroy(struct rte_eth_dev *dev, " released with references %d.", idx, ret); return 0; case MLX5_INDIRECT_ACTION_TYPE_CT: - ret = flow_dv_aso_ct_release(dev, idx); + ret = flow_dv_aso_ct_release(dev, idx, error); if (ret < 0) return ret; if (ret > 0) -- 2.25.1