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 6698D42DAE; Tue, 4 Jul 2023 18:06:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B16B242C54; Tue, 4 Jul 2023 18:06:34 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by mails.dpdk.org (Postfix) with ESMTP id 6A87542D31 for ; Tue, 4 Jul 2023 18:06:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PG6mP4k526y15In7rpg0v8VM7Z2kjBRMpssVS39+5mN90so9wps1c8lceidJfsz+jqFfemPW+qMDOcoKJ2sjXeXrta1hTpm6J1f7hOwe0+/0eeCVz7EsuHdvL5Qtz0AWHQjtFXDidB+CfzB3ijWbgfGQiLp36xnyv72XmXPLWZvuQKCXpeKfUySETf0X+ko2cfEhW/r/0m/xQD46rvjKWX131JeHyTj7zeuGW8aUDQ06Z5I14X8IrR5n/ExYPUaUQoNVHVDOSj3yUmBe1KvDom3dA+XZUsRb5iUPZmAdBCBhl1MYobzeOh9Ce34l/2pg64nndt5pihTy4eZszSp63Q== 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=+VoFDzi8ASKM6OvldCv5dyKY3OEw7zHyhhYx6lchfJ0=; b=KBAnVtvf8K1L2/HmrycFblvnNyR2dNrvmBNgj1Mm6RMIQ427ytgWWlG4Vx2kZ63YkpxCeHOrwQYgwTvgw4LlL7aB+5OoiFvIG0dkXPxDbN/KNfhmw+IQLJgyejGzoylEmXAs4bJqa2Ey67pSGG4KTvzoI6+ZATpUTOLPPN2wIqFqHjK7D9lTsjYrapv6B0RxhPCY3fsPgrr7cIePfrYskoe5vRyvlWZ9rNSWKHO7Jowk1hbyeV9EI6lBwjMWRuZpfL2GXUuUNUwemnpl0ujlXmOONPItBApizRWhCbOplk2wQQ+oNyIyORY5MiXcpUSmpKZN7xT8yVHtfex/tO6luQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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=+VoFDzi8ASKM6OvldCv5dyKY3OEw7zHyhhYx6lchfJ0=; b=S/WHwkX7KA5umhhPLReuyM9tkK/mRZbijwzV38loQR+4fao2R27Sg2zzNhaBLxe0ovNAJuJROx1giFtija1khRXAg0sTANjtt1w/LmNKFmv52sukN9L4sJwgvBrv0eQcIbZGTHq43eaawUdG3Ec9+SYc0CLjWHha6017dog0tJ7q8PVR+jCvYxOO/nL3dgn0XBvLaK1wHTlIiucmsdtzmp57ovsiNT2zVHwwfYC9kjG5YJH1uKIf9iqSN/+bwIEYzhKXqEzDtKA6uJXcxTgX97z5uEqegQ5RyCeoyea3iJHF/LQjM6L6E+I9KCVJMM0WBBDOPygBUiw60uFoKh9mhQ== Received: from DS7PR03CA0173.namprd03.prod.outlook.com (2603:10b6:5:3b2::28) by DS7PR12MB5981.namprd12.prod.outlook.com (2603:10b6:8:7c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 16:06:30 +0000 Received: from DM6NAM11FT077.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b2:cafe::ba) by DS7PR03CA0173.outlook.office365.com (2603:10b6:5:3b2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend Transport; Tue, 4 Jul 2023 16:06:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT077.mail.protection.outlook.com (10.13.173.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.44 via Frontend Transport; Tue, 4 Jul 2023 16:06:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 4 Jul 2023 09:06:20 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.37; Tue, 4 Jul 2023 09:06:20 -0700 Received: from nvidia.com (10.127.8.12) by mail.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.37 via Frontend Transport; Tue, 4 Jul 2023 09:06:18 -0700 From: Itamar Gozlan To: , , , , , Ori Kam CC: Subject: [v3 5/5] net/mlx5/hws: support default miss action on FDB Date: Tue, 4 Jul 2023 19:04:53 +0300 Message-ID: <20230704160454.4187-5-igozlan@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230704160454.4187-1-igozlan@nvidia.com> References: <20230704104645.19800-5-igozlan@nvidia.com> <20230704160454.4187-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT077:EE_|DS7PR12MB5981:EE_ X-MS-Office365-Filtering-Correlation-Id: db8049c8-a888-4ff4-ca0e-08db7ca8a130 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: /+b+dAh0bkfz4jDGkfg3XTkXlyHmqMgNQffoyCO75NvNZz9XX5oQvq1whGidoMwGnBKBdSVhNTQ8JKsEOEEiGtSDeXBHRf6T6Zpj5XoAkaxvE/DECIb1z0CUOfLkQN1Zsw51nO7OQiqX3AubH216e5v6B6FFpw+xp78WIBPxow7Tdk3f3Djw9XnV/NhL1Ai7oRMMlpuI5aOqJV+dX46vXmnncGBfmUJo7vQgATQSNnVqwqFz62OEWZPYVloKqowCBSKjmrlpL3kfyFnJ61XXeK0DvOZN8zh5fr0T4dKRIVYYUUsT5zwC7XdWBEGqc7YycJ/ackk3MzKyDLhMKNU3W3qAaWV8rFwmAkpYHu9YHLsRv4MkUVri/qIpekii5ZQnuDBPRGkZk9p4nbviFeAMJfHFqohDfGF0yW4mM0mrpWGt1+zVvtgUV7RY++Q+B9MMl5w3iDzAxrrMzHABfS48A86k6P5t9ZS6bukD/BKgH51sze6HL5k7f759ksuxocOhhFlgpXfMUIaoar6sO/R/XciGtS0eAjP+PJVgcJMi5qxFW4KL/gkXn5dkpWU6ZQsuR8OeudYcSqITH/NJcba6QlkfZSkevmZz7N38pQL2+ufi7RAK6LOHO8qGkmYVsMqtgG+zlNeTSVb/6CwD1wRE+LvYtwgcsbai08ZOupVOtx4TnvLjNFuwpS+SfLL/0DtN+eSwBZSIeMWO+F8oeKD0Muehf8YaDE5fpbHhfLCTd9VIP9gDO4IVUohutEqzZ3mT X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199021)(46966006)(40470700004)(36840700001)(8676002)(110136005)(8936002)(478600001)(26005)(6666004)(41300700001)(36756003)(5660300002)(2906002)(7696005)(86362001)(4326008)(316002)(40460700003)(55016003)(6636002)(70206006)(70586007)(82740400003)(7636003)(40480700001)(356005)(47076005)(2616005)(6286002)(186003)(83380400001)(82310400005)(336012)(426003)(1076003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 16:06:30.2173 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db8049c8-a888-4ff4-ca0e-08db7ca8a130 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT077.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5981 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: Alex Vesker Add the support for default miss on HWS FDB, this implementation was missing until now. Default miss can be used for more efficient miss flow instead of going to an empty matcher or some defecated empty table. Signed-off-by: Alex Vesker Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 27 ++++++++++++++++++++------- drivers/net/mlx5/hws/mlx5dr_table.c | 6 +----- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 74f4e60863..920099ba5b 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -322,10 +322,12 @@ int mlx5dr_action_root_build_attr(struct mlx5dr_rule_action rule_actions[], return 0; } -static bool mlx5dr_action_fixup_stc_attr(struct mlx5dr_cmd_stc_modify_attr *stc_attr, - struct mlx5dr_cmd_stc_modify_attr *fixup_stc_attr, - enum mlx5dr_table_type table_type, - bool is_mirror) +static bool +mlx5dr_action_fixup_stc_attr(struct mlx5dr_context *ctx, + struct mlx5dr_cmd_stc_modify_attr *stc_attr, + struct mlx5dr_cmd_stc_modify_attr *fixup_stc_attr, + enum mlx5dr_table_type table_type, + bool is_mirror) { struct mlx5dr_devx_obj *devx_obj; bool use_fixup = false; @@ -348,6 +350,17 @@ static bool mlx5dr_action_fixup_stc_attr(struct mlx5dr_cmd_stc_modify_attr *stc_ use_fixup = true; break; + case MLX5_IFC_STC_ACTION_TYPE_ALLOW: + if (fw_tbl_type == FS_FT_FDB_TX || fw_tbl_type == FS_FT_FDB_RX) { + fixup_stc_attr->action_type = MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT; + fixup_stc_attr->action_offset = stc_attr->action_offset; + fixup_stc_attr->stc_offset = stc_attr->stc_offset; + fixup_stc_attr->vport.esw_owner_vhca_id = ctx->caps->vhca_id; + fixup_stc_attr->vport.vport_num = ctx->caps->eswitch_manager_vport_number; + use_fixup = true; + } + break; + case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT: if (stc_attr->vport.vport_num != WIRE_PORT) break; @@ -397,7 +410,7 @@ int mlx5dr_action_alloc_single_stc(struct mlx5dr_context *ctx, devx_obj_0 = mlx5dr_pool_chunk_get_base_devx_obj(stc_pool, stc); /* According to table/action limitation change the stc_attr */ - use_fixup = mlx5dr_action_fixup_stc_attr(stc_attr, &fixup_stc_attr, table_type, false); + use_fixup = mlx5dr_action_fixup_stc_attr(ctx, stc_attr, &fixup_stc_attr, table_type, false); ret = mlx5dr_cmd_stc_modify(devx_obj_0, use_fixup ? &fixup_stc_attr : stc_attr); if (ret) { DR_LOG(ERR, "Failed to modify STC action_type %d tbl_type %d", @@ -411,7 +424,8 @@ int mlx5dr_action_alloc_single_stc(struct mlx5dr_context *ctx, devx_obj_1 = mlx5dr_pool_chunk_get_base_devx_obj_mirror(stc_pool, stc); - use_fixup = mlx5dr_action_fixup_stc_attr(stc_attr, &fixup_stc_attr, + use_fixup = mlx5dr_action_fixup_stc_attr(ctx, stc_attr, + &fixup_stc_attr, table_type, true); ret = mlx5dr_cmd_stc_modify(devx_obj_1, use_fixup ? &fixup_stc_attr : stc_attr); if (ret) { @@ -491,7 +505,6 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, case MLX5DR_ACTION_TYP_MISS: attr->action_type = MLX5_IFC_STC_ACTION_TYPE_ALLOW; attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; - /* TODO Need to support default miss for FDB */ break; case MLX5DR_ACTION_TYP_CTR: attr->id = obj->id; diff --git a/drivers/net/mlx5/hws/mlx5dr_table.c b/drivers/net/mlx5/hws/mlx5dr_table.c index c18ee7c552..f91f04d924 100644 --- a/drivers/net/mlx5/hws/mlx5dr_table.c +++ b/drivers/net/mlx5/hws/mlx5dr_table.c @@ -24,7 +24,6 @@ mlx5dr_table_up_default_fdb_miss_tbl(struct mlx5dr_table *tbl) struct mlx5dr_cmd_forward_tbl *default_miss; struct mlx5dr_context *ctx = tbl->ctx; uint8_t tbl_type = tbl->type; - uint32_t vport; if (tbl->type != MLX5DR_TABLE_TYPE_FDB) return 0; @@ -38,12 +37,9 @@ mlx5dr_table_up_default_fdb_miss_tbl(struct mlx5dr_table *tbl) ft_attr.level = tbl->ctx->caps->fdb_ft.max_level; /* The last level */ ft_attr.rtc_valid = false; - assert(ctx->caps->eswitch_manager); - vport = ctx->caps->eswitch_manager_vport_number; - fte_attr.action_flags = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; fte_attr.destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT; - fte_attr.destination_id = vport; + fte_attr.destination_id = ctx->caps->eswitch_manager_vport_number; default_miss = mlx5dr_cmd_forward_tbl_create(mlx5dr_context_get_local_ibv(ctx), &ft_attr, &fte_attr); -- 2.18.1