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 E6A4743AFD; Sun, 18 Feb 2024 06:12:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1247B42DC1; Sun, 18 Feb 2024 06:12:27 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2054.outbound.protection.outlook.com [40.107.94.54]) by mails.dpdk.org (Postfix) with ESMTP id D742C42D97 for ; Sun, 18 Feb 2024 06:12:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzSwEVcSK+sxLQjc/HbUezj+nDGBGeR7hXxL91LPyJEB2WKcm582f1AG9ZPpi4+g1jkTzt2qEakTLiKvHL1NU88P2Cijy2i6jGi7/TPKIi1fuG8oU9CeXI+jkMZ01wlbf3Zwi1S5I0Uo9urP2uelBtiMgk5DHGzQ1iGnJkmvf08Tf8XtefDMPF7ZXBsHiAO1yIgwgq1cGuNX2Xh0VWK0IR1KauaETIUpmU4ginlUf4uB/vXeY/2DPI9mXm4Ze9B5r/6AvCw/8CEAJoUAlgvA982DlKoxdHeyC11r9dX7IRE5Eu2p4QTa11yZtzei0uPntvRKy+4bO+/yahnfNLAbKw== 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=NRKKHAThI8K5KSGim0KNyQY4j4t1tZ2Pa1s6lTQ31L8=; b=Oungs+OgefKN8aMlRwoqVCZrEemIA/vyiU9dz/KNXU7EvkAKa06JifHkovt+GhmvH7SPNAPgo8yfUQgVWdaxdO0KUJV0ONNF9JQbMngzO2eIeXdAThOVzdLC/BiRATRhMDwoL/dt8sH31/WRvLfgAWteTRMlmqCtQPJijU5dVrwyNDww0uwB6OFDY2m+dpFYjDvbAsyTs6PK+0U2ImWmf48wumbY06f9Tlw3JhOJYXb28LJNkyHw1dr7LLm+OTRgu0+pOqu8kMEfiam48taeMsNQkVS2m7WhtMWv0gK9nvg3bkEGEfklIWt0WU1ERj1jzkArV5I/fwlsiNcsU8+Xkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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 (0) 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=NRKKHAThI8K5KSGim0KNyQY4j4t1tZ2Pa1s6lTQ31L8=; b=EvGYgc3WLBUa2G78qqRYoXxZ+nD2FWXVxo8psyjS3p8VTK8S147Oggpky8cuGPUGiMqaTn6Kzpmev9yvaasn9AZaaq3BFA/czkdeYspgpNG1Er/9gYM0ITdfuQGUf42bmqR/MaWv7uJyhGVto2mEgNcrz2yVLpKYRmSQ6v0RYJBmRUoYFRx73epEP3z+io/zb2wF5p63z/p8GKHcOKC84MRwojdW82bNPGv1wFqub5x9dI+2Xmu51aPRaXnRSZulW234WWj5isgPoHPoKHN8wF5JJ6qvV7KbfwV+hRXBrGtla/CMQ/QEjs1SectxruzPa5/+0xspRFsyAVGk3M7+XQ== Received: from CH0PR03CA0208.namprd03.prod.outlook.com (2603:10b6:610:e4::33) by MN2PR12MB4191.namprd12.prod.outlook.com (2603:10b6:208:1d3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.15; Sun, 18 Feb 2024 05:12:21 +0000 Received: from CH3PEPF0000000A.namprd04.prod.outlook.com (2603:10b6:610:e4:cafe::57) by CH0PR03CA0208.outlook.office365.com (2603:10b6:610:e4::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32 via Frontend Transport; Sun, 18 Feb 2024 05:12:20 +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 CH3PEPF0000000A.mail.protection.outlook.com (10.167.244.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Sun, 18 Feb 2024 05:12:20 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) 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.41; Sat, 17 Feb 2024 21:12:08 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Sat, 17 Feb 2024 21:12:08 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12 via Frontend Transport; Sat, 17 Feb 2024 21:12:05 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad CC: Subject: [v2 09/10] net/mlx5/hws: support push_esp flag for insert header action Date: Sun, 18 Feb 2024 07:11:23 +0200 Message-ID: <20240218051125.717011-9-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240218051125.717011-1-igozlan@nvidia.com> References: <20240213095038.451299-9-igozlan@nvidia.com> <20240218051125.717011-1-igozlan@nvidia.com> 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: CH3PEPF0000000A:EE_|MN2PR12MB4191:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e60be10-17c8-41b9-1bb9-08dc30402f49 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: EhSlnFDA2sEkhKMsrcdhEe8R3MykP7iUhrjCiDIZ9jcISMOOEsB4siB3bH0HNDlqrm0H9BwwqXb22CqNsUiX2VXVDdENl7nT3+H95t4jqfjERkkxKFHIkIjQfvGfrwenZYKVmMRYSEUOV1IfYzC/WdgQBze70zzT4DemdyVEvvpf4fx8Iz06Ag19ePUz5sSS0PtlkH22lGrxBXJUaiXl6XhD8yLpg1IMFuxrGQxjtms16UpU679IhwsUf47kG2RbQAqKn3FHPBgPsN8HhHG3xC83N4/Y7hqxWU7o9GB3QZhQfcndj++xLLr++nCCOKlMQh1zuoFfQUoASeZ18HRiwGQd13kNcj8ByPb1OEFACSDFZca32Tqzjih1gsdMBJEkYbK6BaZSS9FQayySPtnHb1Rj2K8mREPyxcn/Fz/8BGCvYy2N4LaUVv94TXKdVDHOI270phjFxfEAL9sF8VYGYNiq5uByP2q4nf/qdg8L+hd8sl9exaWzR0NFr+fw2ao6Ug9ihx8uneB+m9ETZk6X9gUm+9aEno4Kfn3WPsa/elFee/RFARfPqjrrTKeLhZBTVbS/4IafSNO567tU2p+c0AePQDJgOGgcybqwpkeufBir5Eup+JSCRPPdj/GmUxZC7m5XpOe0xpyeqsocbzH+Drv7Dvt+Dj17iFoTgWMxS5I= 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:(13230031)(4636009)(396003)(136003)(346002)(39860400002)(376002)(230922051799003)(36860700004)(1800799012)(64100799003)(186009)(82310400011)(451199024)(40470700004)(46966006)(2906002)(55016003)(5660300002)(26005)(6286002)(41300700001)(1076003)(426003)(336012)(2616005)(8676002)(8936002)(316002)(70586007)(4326008)(70206006)(83380400001)(921011)(82740400003)(6666004)(7696005)(6636002)(478600001)(110136005)(36756003)(7636003)(356005)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2024 05:12:20.7722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e60be10-17c8-41b9-1bb9-08dc30402f49 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: CH3PEPF0000000A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4191 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: Hamdan Igbaria support push_esp flag for insert header action, it must be set when inserting an ESP header, it's also sets the next_protocol field in the IPsec trailer. Signed-off-by: Hamdan Igbaria Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_prm.h | 3 ++- drivers/net/mlx5/hws/mlx5dr.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_action.c | 4 ++++ drivers/net/mlx5/hws/mlx5dr_action.h | 1 + drivers/net/mlx5/hws/mlx5dr_cmd.c | 2 ++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 1 + 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 787211c85c..282e59e52c 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -3616,7 +3616,8 @@ struct mlx5_ifc_stc_ste_param_insert_bits { u8 action_type[0x4]; u8 encap[0x1]; u8 inline_data[0x1]; - u8 reserved_at_6[0x4]; + u8 push_esp[0x1]; + u8 reserved_at_7[0x3]; u8 insert_anchor[0x6]; u8 reserved_at_10[0x1]; u8 insert_offset[0x7]; diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h index 3647e25cf2..d612f300c6 100644 --- a/drivers/net/mlx5/hws/mlx5dr.h +++ b/drivers/net/mlx5/hws/mlx5dr.h @@ -192,6 +192,10 @@ struct mlx5dr_action_insert_header { * requiring device to update offloaded fields (for example IPv4 total length). */ bool encap; + /* It must be set when adding ESP header. + * It's also sets the next_protocol value in the ipsec trailer. + */ + bool push_esp; }; enum mlx5dr_action_remove_header_type { diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 8589de5557..f55069c675 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -598,6 +598,7 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, attr->action_type = MLX5_IFC_STC_ACTION_TYPE_HEADER_INSERT; attr->action_offset = MLX5DR_ACTION_OFFSET_DW6; attr->insert_header.encap = action->reformat.encap; + attr->insert_header.push_esp = action->reformat.push_esp; attr->insert_header.insert_anchor = action->reformat.anchor; attr->insert_header.arg_id = action->reformat.arg_obj->id; attr->insert_header.header_size = action->reformat.header_size; @@ -635,6 +636,7 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, attr->action_offset = MLX5DR_ACTION_OFFSET_DW6; attr->reparse_mode = MLX5_IFC_STC_REPARSE_ALWAYS; attr->insert_header.encap = 0; + attr->insert_header.push_esp = 0; attr->insert_header.is_inline = 1; attr->insert_header.insert_anchor = MLX5_HEADER_ANCHOR_PACKET_START; attr->insert_header.insert_offset = MLX5DR_ACTION_HDR_LEN_L2_MACS; @@ -1340,6 +1342,7 @@ mlx5dr_action_handle_insert_with_ptr(struct mlx5dr_action *action, action[i].reformat.anchor = MLX5_HEADER_ANCHOR_PACKET_START; action[i].reformat.offset = 0; action[i].reformat.encap = 1; + action[i].reformat.push_esp = 0; } if (likely(reparse == MLX5DR_ACTION_STC_REPARSE_DEFAULT)) @@ -2087,6 +2090,7 @@ mlx5dr_action_create_insert_header_reparse(struct mlx5dr_context *ctx, action[i].reformat.anchor = hdrs[i].anchor; action[i].reformat.encap = hdrs[i].encap; + action[i].reformat.push_esp = hdrs[i].push_esp; action[i].reformat.offset = hdrs[i].offset; reformat_hdrs[i].sz = hdrs[i].hdr.sz; reformat_hdrs[i].data = hdrs[i].hdr.data; diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h index a8d9720c42..0c8e4bbb5a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.h +++ b/drivers/net/mlx5/hws/mlx5dr_action.h @@ -149,6 +149,7 @@ struct mlx5dr_action { uint8_t offset; bool encap; uint8_t require_reparse; + bool push_esp; } reformat; struct { struct mlx5dr_action diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index f77b194708..4676f65d60 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -486,6 +486,8 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr, MLX5_MODIFICATION_TYPE_INSERT); MLX5_SET(stc_ste_param_insert, stc_parm, encap, stc_attr->insert_header.encap); + MLX5_SET(stc_ste_param_insert, stc_parm, push_esp, + stc_attr->insert_header.push_esp); MLX5_SET(stc_ste_param_insert, stc_parm, inline_data, stc_attr->insert_header.is_inline); MLX5_SET(stc_ste_param_insert, stc_parm, insert_anchor, diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h index 694231e08f..ee4a61b7eb 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.h +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h @@ -122,6 +122,7 @@ struct mlx5dr_cmd_stc_modify_attr { uint8_t encap; uint16_t insert_anchor; uint16_t insert_offset; + uint8_t push_esp; } insert_header; struct { uint8_t aso_type; -- 2.39.3