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 0D14542DA8; Mon, 3 Jul 2023 11:21:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED38E42D29; Mon, 3 Jul 2023 11:21:17 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) by mails.dpdk.org (Postfix) with ESMTP id 94A4C40DFD for ; Sun, 2 Jul 2023 06:58:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OxdxmEiLorPnvKoiVMr9dA68EnOuqabbf6Pr0/ljaYqU67KomsgGkWmLYbdeT/rv9nOWXDvW0oQk3pyROM658Q6YzB19op0JQkZVYMfS1kcHn8hOKDe7AIuxzsYmWtHTK+AFBGUmgtnB2Qt17jaZI2VZ6jC1Y7p3fOmSOzYtc6kB80MgYQjqqlqb9E9FS+9tu9CE97QS+tV5jETFb+R8kKwRjx2KOFcKGp9OTyyuXachkgLAeLjivpF6BlhLKnQdxtO3XW34/1qJ1+EPhNbZsZR8FIYvSc/Nno26+4azopCtbcM0wP5hdq7qIJ+9HXqOBEvyWmWBQaRzKaleq+Tf8w== 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=meMEw0XFsrY33uTWioXNPClS+49o0uTivq8WKlQqlhI=; b=IUJY5b4PNK2V0FgAgkQzmrOpJkw1cpz0IIdmLNiQwBGmDnka9dBOWOw5f52tY5cZBB2PB20MYTzy8Oh5w/XoUYSwMAeS8UnM/ik9MmPjLQfGAk7uNzcFUMMwXfk5J3EkMBOuy997QWFPRs+xyEq3Y5Dvh38IWldNVD0fdX3LSLoj6HZW8WhA4x5nTT25pU4zpABOFyqyltyvwI548lrF3lB+W0f2im9Atu0kuBlw2ma6mcr3a1lRPisjSJiUl2fNc94bgbXvhhqlBXiux7e0SuSNlTGDvxtPsDPWBawDmmU98PEguDsZkfVXMsS1qJ78gvqLqE7sMyzAfoJPu3ZCVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=meMEw0XFsrY33uTWioXNPClS+49o0uTivq8WKlQqlhI=; b=HxL3PeE53mdSK8yXtbJVIE7Rp9EHlY3uTLvRj9WOXwvCVIP71m4qvd30xvOSkitRVckYvKSgZafU+h0CA2iXlwf1e0miAMq4BIPK1bGQfuYvWPPthPuasXZgXwGXqY7vMHkauoDMgz74T2/+/tFLo9CSu1BJ/vg8E4y0W5t9R3tLhD38OCGAXjvnhlrGWrmhxkEVRY6fkEI8x+e4zFNdfyBAacy+IpR67oyi00AyuMggAu9HNm0AuIMRFrmZPeDoDCLvduJtbINi2nV7TKzK7MDeHf6Ce91sCdNonK8bLz+Gkqwdbyvw2W0x6lJmp3BlQfVa9AUDYa32jmsQdhW5VQ== Received: from DS7PR03CA0200.namprd03.prod.outlook.com (2603:10b6:5:3b6::25) by CH2PR12MB4890.namprd12.prod.outlook.com (2603:10b6:610:63::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Sun, 2 Jul 2023 04:58:32 +0000 Received: from DM6NAM11FT088.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::88) by DS7PR03CA0200.outlook.office365.com (2603:10b6:5:3b6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.26 via Frontend Transport; Sun, 2 Jul 2023 04:58:32 +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 DM6NAM11FT088.mail.protection.outlook.com (10.13.172.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.43 via Frontend Transport; Sun, 2 Jul 2023 04:58:31 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.5; Sat, 1 Jul 2023 21:58:18 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sat, 1 Jul 2023 21:58:18 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Sat, 1 Jul 2023 21:58:16 -0700 From: Itamar Gozlan To: , , , , CC: , Subject: [v2 5/5] net/mlx5/hws: support default miss action on FDB Date: Sun, 2 Jul 2023 07:57:58 +0300 Message-ID: <20230702045758.23244-5-igozlan@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230702045758.23244-1-igozlan@nvidia.com> References: <20230629072125.20369-5-igozlan@nvidia.com> <20230702045758.23244-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: DM6NAM11FT088:EE_|CH2PR12MB4890:EE_ X-MS-Office365-Filtering-Correlation-Id: 11d8b1ed-270b-48cb-a9b3-08db7ab8fbdc 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: 0rA+khJog3yQeJhc76J9jPStumVGJdaWoeHzsp7puXx/YMSz9zGwjyeD4iFpYtIIy2VXsBsVUCjEJNSGh29jke0+ip3HYPerCcMFzzRdep6byNgwJs4TsCtsoCjibT5PV4EXdS6GJBGxev8CqYnAqFxqRZ2/NbBMUQLZv0ryfnWhD78nl+CBph1uag/XvoDgYNbMo79EIDcsVYsdRU37djXYcAasRSUmY9W6Us1rJJuT/aANC0iKJDEBkn00EI58lDiiYxd/CJm+nFNDRv+fXt7jQ8knBZGlnCFdyHQ9AAqYeHA1IhnzKj3R/c13002xIuN8ODZ8rnliSVtQiu/iq4jZVMLEjdP7nhnAEe2hdBSZWmJ1u6XbWBOEREkjDnS1b9V/k2nhjNzY4T+8gZcm1k1d2kiF+KDAsSyFvzsC2AuvBDUYzmg6YC3NuWupKZMOmJibYSSzZyBQP+NcdLLDDbX2hccQr3vnZ0XpEESyenYk04HJ5V9ExJH09c4HUwh4UTEptlr8YlLNjnhaJCuvOJ7nQgHIE1UcgefShsoKMMQO8tYz7FmBHXoEKJ8N0C+X0vzvTgJrRRYRyjDISguBQBuBFjnVTc2cbTKD1hXWyI3oygkPaJRY0mQAzslWRaLtbe+uxTMgzNJx5np5BdGTafqmRvfJ78xeiuEHD8O6HIBKev8EcjJWizgZ8F3EYZLUqGJCyowYDWkSTTm6BhuD0rG3WI8fpN4wmbae9E+tNHFcD9IFRShuVGHHOcFSNUAL 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:(13230028)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(107886003)(26005)(478600001)(1076003)(82740400003)(6666004)(86362001)(2616005)(186003)(6286002)(36860700001)(7636003)(54906003)(6636002)(70586007)(4326008)(83380400001)(356005)(336012)(110136005)(426003)(7696005)(70206006)(316002)(47076005)(5660300002)(8676002)(8936002)(40460700003)(41300700001)(2906002)(40480700001)(55016003)(82310400005)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2023 04:58:31.9608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11d8b1ed-270b-48cb-a9b3-08db7ab8fbdc 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: DM6NAM11FT088.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4890 X-Mailman-Approved-At: Mon, 03 Jul 2023 11:21:13 +0200 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 --- drivers/net/mlx5/hws/mlx5dr_action.c | 27 ++++++++++++++++++++------- drivers/net/mlx5/hws/mlx5dr_table.c | 8 ++------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index a514b82fec..96c0c10cd9 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -327,10 +327,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; @@ -353,6 +355,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; @@ -402,7 +415,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", @@ -416,7 +429,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) { @@ -496,7 +510,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 46c2a47015..2c8b7a2b9e 100644 --- a/drivers/net/mlx5/hws/mlx5dr_table.c +++ b/drivers/net/mlx5/hws/mlx5dr_table.c @@ -25,8 +25,6 @@ mlx5dr_table_up_default_fdb_miss_tbl(struct mlx5dr_table *tbl) struct mlx5dr_cmd_set_fte_dest dest = {0}; struct mlx5dr_context *ctx = tbl->ctx; uint8_t tbl_type = tbl->type; - uint32_t vport; - if (tbl->type != MLX5DR_TABLE_TYPE_FDB) return 0; @@ -39,11 +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; - dest.destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT; - dest.destination_id = vport; + dest.destination_id = ctx->caps->eswitch_manager_vport_number; + fte_attr.action_flags = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; fte_attr.dests_num = 1; fte_attr.dests = &dest; -- 2.18.1