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 166FC42C9E; Tue, 13 Jun 2023 07:28:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D1F040A8A; Tue, 13 Jun 2023 07:28:54 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2073.outbound.protection.outlook.com [40.107.93.73]) by mails.dpdk.org (Postfix) with ESMTP id 695C840698 for ; Tue, 13 Jun 2023 07:28:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bfgttu9KLChWKgmcVYMjk0J1r7uCbuDXhLsvEsr4iK3efoF4i3ia0lWflU8k1Di94lPCGebFvKCOsTEZiZfxHS34cCwT5EcOkmUN5lic5RwXqbgBBJtutRWE7BzkVX4IDVP0hqsH8PXY9ITHLFqn3/qUqPElPin6mbSWao9wnc57s8ZDhkxnbrzahBF6x2Z10kTm9Gep2HGvHIrSzpS7y6C9nFtBjoRXls5IWHSY5dSkZoGKDw2IW4oT20mr7mufiBPaSWpu4ZcJiT5bB7BqR/4mo2Stt9rrqvZ8p2aSZR3VqhjDLoxwTNT2hkBZR+uPx3WY5sSbQdCSZ4a6rYx28A== 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=Fi1cgYesTUyt65gaQuqm/fkv63N4GAHl8SzhG7fSGxs=; b=bjLK44UiPHtNrftEbSf9rflk/otG2YszSIDU5nluUMayzpS38twoeIxIQCNIbYb3tolgOjaSUrDOKeYf9gf1QK+PIH3mqOPbOl9O+w76RlWrvabYxQ3Qf32p6NZ4HYPbi4SlucvyfwqUwkfLEgQyywx2nQapCcadxYIAfmGIl/tzyJbG5eTwPibGaXFZrH2+VB9XnSrsbZZGoThLUQe9PTDJrPC2YFd2n8j4bpY/qeOt3XR+gjTiLclx5aLc3T+MiSTQpaf3o8nAUwxMeuA1Y2ohoXLqvSkNsOwSXYKr0s+tlvLrjfcQT4U/UcMA6NgLYqsly9lHNFJa22o74cOkgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=Fi1cgYesTUyt65gaQuqm/fkv63N4GAHl8SzhG7fSGxs=; b=oX8dUXb2Jnfa1zsf7c5c2Edr+Duv7f/5xVbLf53fXoJG6yGPMQbaIQciMV5It72gDpHnTCVM0ij9V6wKCZMFNWQuSVPDCwyCpgBVstM7L3dP8KqTOAd7qRlEbNybhNYFlOdch7io7rehkMJC1PnKbjIa34gDOnEnpe/whTDdpptYcRvOpziylW8FVdgls8q0SJJcjz8zH9pLqDrxGfOZsXSsYK+DtsnchG0anzxGJusfA7PqsD2GrpgRtBQ3+iBWJNEzp1TIgxNTqPPOFAh55M6JQkBq1iUL1C5Ej7rHT5wsj4cA/2GtDbi2eUVFTC829CuiC8B0At1g3yvE/E4onQ== Received: from DM5PR07CA0068.namprd07.prod.outlook.com (2603:10b6:4:ad::33) by BY5PR12MB4999.namprd12.prod.outlook.com (2603:10b6:a03:1da::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29; Tue, 13 Jun 2023 05:28:49 +0000 Received: from DM6NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ad:cafe::1d) by DM5PR07CA0068.outlook.office365.com (2603:10b6:4:ad::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.34 via Frontend Transport; Tue, 13 Jun 2023 05:28:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DM6NAM11FT066.mail.protection.outlook.com (10.13.173.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.22 via Frontend Transport; Tue, 13 Jun 2023 05:28:49 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 12 Jun 2023 22:28:46 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 12 Jun 2023 22:28:45 -0700 Received: from nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Mon, 12 Jun 2023 22:28:44 -0700 From: Bar Neuman To: CC: , , , , , Itamar Gozlan Subject: [PATCH 1/2] net/mlx5/hws: removing the table name from dest root table Date: Tue, 13 Jun 2023 05:28:09 +0000 Message-ID: <20230613052810.4052102-1-bneuman@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT066:EE_|BY5PR12MB4999:EE_ X-MS-Office365-Filtering-Correlation-Id: e09ff0f1-474e-4093-adf7-08db6bcf1134 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/fX368k3rWEupSrqCqhyJ6Rk2ZL/4KOR8c5bzcUSuzlUIDSQeUNi4R1llJ/QrMkLzLGBR9XUaJNWt122W3THR8sfJLT2H9W7uVs2lkedSWxXG7/g6Q3BqljzF3w7noNX9WbMCZqC0PaBsxFsgO3x8vVwpReCdGDSxdA2xKvrIlNaKKNU2wNLT5PSIF85GJ58/2N8tmpVLdsOYIX5f8XMS9n3UTfotW5NnWPQ2Hj2uzeXKAo4iA3d97YQDsjfIbtFF57au3ISM5cZq7KCi7bLc86zm7GOKB3qhEBMT9+k4k4P9MLdZAVYfzBk+PegwoRdrMNgSt7bKneng4qAUtcbNKnVyoIifLZA9b6bUikwkWCh+HzKh+ngEwFT5UGgUjrUhdZvG6qSm09zD0u3oJ7Sz1jnrRSrUaJVEqb1N3xhBwgZ+op2kSzSfk7DENiO/CwaS6Sib27LU6aP+DSdGOpKY+AeHHkj0LZ2Mhakzk/ycwHoUd3mAeUxR0EsEN53EL4/zA87GMMgkXnfl0+IweKeuNy+WBx5t29dg8porGc17TsDbrQwfsBDhRtLCJzzD3Ztg5yHjGiFY5udTXIs4PYuApyYkSZFf8O15Ljfn9fV1fcgbdUO5EQO+gO8dDbjy2XGOWk28Ez7VXuku7iXFBGBxweZjUaaL4WyJWk2/WC2NqZeZi1M7O4DWNd0LxxRYRPCXamjXfjL4ExzB57Wz1KEDjHDKrlZ8YXg0coOFA9/wkTKXNn+i/LN5JYu4cGy942 X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199021)(36840700001)(40470700004)(46966006)(6286002)(47076005)(6916009)(426003)(70206006)(4326008)(70586007)(336012)(36756003)(186003)(54906003)(478600001)(2616005)(2906002)(8676002)(316002)(41300700001)(82310400005)(107886003)(86362001)(7696005)(40460700003)(6666004)(356005)(36860700001)(1076003)(7636003)(8936002)(5660300002)(83380400001)(82740400003)(26005)(40480700001)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 05:28:49.2562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e09ff0f1-474e-4093-adf7-08db6bcf1134 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4999 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 From: Itamar Gozlan Jumping to root (group 0) does not behave the same as jumping to groups with level > 0. To better emphasize that it is not the same action, a rename is made to drop the name table. Signed-off-by: Itamar Gozlan --- drivers/net/mlx5/hws/mlx5dr.h | 11 ++++------- drivers/net/mlx5/hws/mlx5dr_action.c | 27 ++++++++++----------------- drivers/net/mlx5/hws/mlx5dr_debug.c | 2 +- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h index c14fef7a6b..512d6095b9 100644 --- a/drivers/net/mlx5/hws/mlx5dr.h +++ b/drivers/net/mlx5/hws/mlx5dr.h @@ -45,7 +45,7 @@ enum mlx5dr_action_type { MLX5DR_ACTION_TYP_PUSH_VLAN, MLX5DR_ACTION_TYP_ASO_METER, MLX5DR_ACTION_TYP_ASO_CT, - MLX5DR_ACTION_TYP_DEST_ROOT_TABLE, + MLX5DR_ACTION_TYP_DEST_ROOT, MLX5DR_ACTION_TYP_MAX, }; @@ -570,8 +570,6 @@ mlx5dr_action_create_push_vlan(struct mlx5dr_context *ctx, uint32_t flags); * the given priority. * @param[in] ctx * The context in which the new action will be created. - * @param[in] tbl - * The root table to jump to. * @param[in] priority * The priority of matcher in the root table to jump to. * @param[in] flags @@ -579,10 +577,9 @@ mlx5dr_action_create_push_vlan(struct mlx5dr_context *ctx, uint32_t flags); * @return pointer to mlx5dr_action on success NULL otherwise. */ struct mlx5dr_action * -mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx, - struct mlx5dr_table *tbl, - uint16_t priority, - uint32_t flags); +mlx5dr_action_create_dest_root(struct mlx5dr_context *ctx, + uint16_t priority, + uint32_t flags); /* Destroy direct rule action. * diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index df39be47da..01d30b8442 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -34,7 +34,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_ BIT(MLX5DR_ACTION_TYP_MISS) | BIT(MLX5DR_ACTION_TYP_TIR) | BIT(MLX5DR_ACTION_TYP_DROP) | - BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE), + BIT(MLX5DR_ACTION_TYP_DEST_ROOT), BIT(MLX5DR_ACTION_TYP_LAST), }, [MLX5DR_TABLE_TYPE_NIC_TX] = { @@ -51,7 +51,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_ BIT(MLX5DR_ACTION_TYP_FT) | BIT(MLX5DR_ACTION_TYP_MISS) | BIT(MLX5DR_ACTION_TYP_DROP) | - BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE), + BIT(MLX5DR_ACTION_TYP_DEST_ROOT), BIT(MLX5DR_ACTION_TYP_LAST), }, [MLX5DR_TABLE_TYPE_FDB] = { @@ -71,7 +71,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_ BIT(MLX5DR_ACTION_TYP_MISS) | BIT(MLX5DR_ACTION_TYP_VPORT) | BIT(MLX5DR_ACTION_TYP_DROP) | - BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE), + BIT(MLX5DR_ACTION_TYP_DEST_ROOT), BIT(MLX5DR_ACTION_TYP_LAST), }, }; @@ -524,7 +524,7 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; attr->dest_table_id = obj->id; break; - case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE: + case MLX5DR_ACTION_TYP_DEST_ROOT: attr->action_type = MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT; attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; attr->dest_table_id = action->root_tbl.sa->id; @@ -1648,10 +1648,9 @@ mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx, } struct mlx5dr_action * -mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx, - struct mlx5dr_table *tbl, - uint16_t priority, - uint32_t flags) +mlx5dr_action_create_dest_root(struct mlx5dr_context *ctx, + uint16_t priority, + uint32_t flags) { struct mlx5dv_steering_anchor_attr attr = {0}; struct mlx5dv_steering_anchor *sa; @@ -1664,12 +1663,6 @@ mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx, return NULL; } - if (!mlx5dr_table_is_root(tbl)) { - DR_LOG(ERR, "Non root table cannot be set as destination"); - rte_errno = ENOTSUP; - return NULL; - } - if (mlx5dr_context_shared_gvmi_used(ctx)) { DR_LOG(ERR, "Cannot use this action in shared GVMI context"); rte_errno = ENOTSUP; @@ -1687,7 +1680,7 @@ mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx, return NULL; } - action = mlx5dr_action_create_generic(ctx, flags, MLX5DR_ACTION_TYP_DEST_ROOT_TABLE); + action = mlx5dr_action_create_generic(ctx, flags, MLX5DR_ACTION_TYP_DEST_ROOT); if (!action) goto free_steering_anchor; @@ -1725,7 +1718,7 @@ static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action) case MLX5DR_ACTION_TYP_PUSH_VLAN: mlx5dr_action_destroy_stcs(action); break; - case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE: + case MLX5DR_ACTION_TYP_DEST_ROOT: mlx5dr_action_destroy_stcs(action); mlx5_glue->destroy_steering_anchor(action->root_tbl.sa); break; @@ -2216,7 +2209,7 @@ int mlx5dr_action_template_process(struct mlx5dr_action_template *at) case MLX5DR_ACTION_TYP_DROP: case MLX5DR_ACTION_TYP_TIR: case MLX5DR_ACTION_TYP_FT: - case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE: + case MLX5DR_ACTION_TYP_DEST_ROOT: case MLX5DR_ACTION_TYP_VPORT: case MLX5DR_ACTION_TYP_MISS: /* Hit action */ diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c index c49b504317..d249f8d869 100644 --- a/drivers/net/mlx5/hws/mlx5dr_debug.c +++ b/drivers/net/mlx5/hws/mlx5dr_debug.c @@ -22,7 +22,7 @@ const char *mlx5dr_debug_action_type_str[] = { [MLX5DR_ACTION_TYP_PUSH_VLAN] = "PUSH_VLAN", [MLX5DR_ACTION_TYP_ASO_METER] = "ASO_METER", [MLX5DR_ACTION_TYP_ASO_CT] = "ASO_CT", - [MLX5DR_ACTION_TYP_DEST_ROOT_TABLE] = "DEST_ROOT_TABLE", + [MLX5DR_ACTION_TYP_DEST_ROOT] = "DEST_ROOT", }; static_assert(ARRAY_SIZE(mlx5dr_debug_action_type_str) == MLX5DR_ACTION_TYP_MAX, -- 2.25.1