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 C612443BDB; Mon, 26 Feb 2024 02:45:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7978242DAC; Mon, 26 Feb 2024 02:45:33 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2126.outbound.protection.outlook.com [40.107.101.126]) by mails.dpdk.org (Postfix) with ESMTP id 759F142831 for ; Mon, 26 Feb 2024 02:45:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuKHJQ4nzguhyCj4V/PoB7IJPPznWox6VpW4fwo/QSjFitKRhaUIPqLoZsa6f7KZqHoL+ujgvX2QhlOq8+doJ7wnPsue2gP9tC8Q5wCca+hivD9JRfW1Ctrd9b1vJIaQO3SWUqHfUwg5mEulil7sb2+6PxhAr2UxzDW0HC6BO4i//cBxUL+cuUI1GPPPPMJtE7BK+XQELhe3q2PiwhG6zqTdw2JB3M22ApYfsvRsoVkB0M9rUcHaTcnUnfuA6ev7ioXUOlahel/R5ahfH1sPhylg2I8s9kKJPB2oLMXlJ/1LTRQp9UAwgw08/SGN66WrniU+HcntcF9eTZZLw5VZTw== 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=RO5HermtBHjS0CUvkN24+frgnYUMJcga2+bXZ5KFmcQ=; b=fKIoex0yiG6+eAFySjYfloKedNiJLKhUHwWasz9B7yXCIYX9hdpJAtMoTuHhvF7X/RX2CHSsxP+ot1bIxzj0bf61c2eyPWUjMMadHdYYRzB2ZHu2ua6C8XQbbJaOdb4alz4MYXhp+swxnGXCmTd4acozx15cwrXCyE1ZgoigoxpJu/wShKLrRmgcIKVB+5S+lxRR8CRRjiIZryDlA5bKZ/OVRslP1uxVC/DxpEGgc6B7xFzYlSEBR8nm2nSsnQDUaBrNX8rHQy1bZ4952Q9Z/GTry4z+bdqL80ByuCJfwi2g3eh+TUeVvenKYbkEb5t6HkT69NvbGqTwyaikpfz8Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RO5HermtBHjS0CUvkN24+frgnYUMJcga2+bXZ5KFmcQ=; b=NRFIxAnS/xdBNwCNw7Oy4ANgzfJYAQxzkXSBZRMI2YAk8Y59uUCY7CSotJmo1pmvTlDG8omiGlqOt90C2YBRbBlCna3WRcdN/Aqj76CevTLsEKUi2yDH0zpdrWHPCUs9W+jIjRL50vgTYdh4ZiORuDBG1+kW7k/RRIrJRky/3QY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH0PR13MB5794.namprd13.prod.outlook.com (2603:10b6:510:11d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Mon, 26 Feb 2024 01:45:24 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa%7]) with mapi id 15.20.7316.032; Mon, 26 Feb 2024 01:45:24 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , Peng Zhang Subject: [PATCH v3 2/4] net/nfp: support MARK flow action Date: Mon, 26 Feb 2024 09:44:58 +0800 Message-Id: <20240226014500.3537561-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240226014500.3537561-1-chaoyong.he@corigine.com> References: <20240223024217.3052031-1-chaoyong.he@corigine.com> <20240226014500.3537561-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH8PR05CA0005.namprd05.prod.outlook.com (2603:10b6:510:2cc::14) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB5794:EE_ X-MS-Office365-Filtering-Correlation-Id: adbd9ac6-b846-4061-b829-08dc366c99db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6aaRH4/LG0FvTKNJSPIcUz2/Wl4gFLHT2H65zdYvbnqb5GjCt0mudTA+HDI5dnwrOcW1p2187F5wYY8xrnnMTlc0K3yuTI2fwSS8XiF1zXzHiqeNSCPI00/jQKHVP7nGFcLbqpBLn28U2AaIH9IsCDKqAtysACEV2W7pCXW2IL6AP5z6WP8yd/H+tEI39YgmE+u/TsXZmhqHLUrxIh6jlkQ6/vSLLlWe0pu7cK0o0RFX/vGW9JSc+LZo5bXWLaw0cHoXG2Ywpp+io0fLfQj1YAt2CJHpeyatV4B9+XSxhV9wv4oiatXFVRO29apr+VSvDWPPHBzzeqlIi2Lx2MqOas5FUlunM3sF6yTIg0WnSL0zmEmEkk2L9sOWEBj+7rYXdwwCYdqjWRnbEZr42/bUmo5Gg4rJrQyFLJPsxoL1YwONIQXYYEnLkKiz/KbyPF/NOuFatvmsPfwGrao5bXXiSqhQSiIU35GBjBK076VnosSXvH/UiJQ56WyNVWUWjoDz1UkzL/MLVrBjvb2KWuNTOMrhILuF1j2b+nT/S3yTO/W1ydSzrUwLk8LZK8yQmp0HPAyMSfpMqMsUizmeTStjf2xY0u1L88Q5qn5+TQz3cUA9SvdCj7TEXEb/7ISX0Z+g20kBTSLLoysvsLhwvGmMDjsQlIlZqZib4ZiwVZZzSwFhT/kOi+ee2Wk3mjuKEWmMaemfDD4csnlmW/zSQFPl8w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?p+eSerQZn2Pif29jng+63b+Y9YOhHvW/wJhU4pLos6T/PPawYTTp5OdwO/vA?= =?us-ascii?Q?XqRIS3Sy9TWahuVhPxEcV5ibWouxJjxMk+Lw4/PQWy3/6GFvd6OqWNo8zIji?= =?us-ascii?Q?sqqJwnCI71mrCX6Rqm9rP4JA+rlyZJBJEGuIsvZuhFalFNeX3FQ37iWOCh4q?= =?us-ascii?Q?Byt21lgyIAP94in/v8oq+8GQpHhIr35ot1T8HdAjwIdcyBaon+Iccfgcu8KA?= =?us-ascii?Q?sJdR5M5FJpFTqZx16eh6uVlinMcr8Cf19E9fz2Wf1C70ey38B9zYBK1dxaUC?= =?us-ascii?Q?6RlniTWV0uL/Dm088DgsLBIEwEngqf94BLIUAXdLPbnDoMm3XshBAIWdRkv9?= =?us-ascii?Q?6539eDq0opisPb7vupjpZpgs2W3HQbFPQJdxsDA6+JwoJKJEfwxhB9sP4fCh?= =?us-ascii?Q?VKb7n3hES7e3D1tQtOZd9TdFg1qJiIh2poj2vdwhsUpsA6TY33yLiwjQIZsT?= =?us-ascii?Q?giS20E0BoDrGheH5VpkStwKf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SEGXdFiEGLcjP5e3NhDHrXRvwjX3/7rIaGos5AJwMNRYK4xZTpc3HhpATU?= =?us-ascii?Q?+6sYb+nsXIMgPNPbrHGUdHKsT763oYEPZ6UIFsXPPVs0iYPZviJWi/gBr0eO?= =?us-ascii?Q?uzu6pSqyW+v6QvdHb+nUNYeSHGw7udXMSVogAX3SCsfJzsO0CfqpRBF8wDMu?= =?us-ascii?Q?6OctulIhK/m/GuhZgbfpXAA0teOKcaIyAVRZ0n0zkeE4mN16FMqTIp/5GwhO?= =?us-ascii?Q?dw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: adbd9ac6-b846-4061-b829-08dc366c99db X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 01:45:24.8160 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mK/feIsjFWj/Y3md0RDi1UAVVZQVZ413gC06Zi6lu+1WbQRqNTOq8QYeKKmTp4HR0EyciGU6GVml0FbLWt3hqMAvV9JKz46YVLq6utrEn5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5794 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: Long Wu Add the corresponding logics to support the offload of MARK action. Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_cmsg.h | 16 ++++++++++++++ drivers/net/nfp/flower/nfp_flower_flow.c | 27 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 8fb55f44a2..c94ea706bb 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -959,6 +959,22 @@ struct nfp_fl_act_meter { rte_be32_t profile_id; }; +/* + * Mark + * 3 2 1 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | res | opcode | res | len_lw| reserved | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Mark | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +struct nfp_fl_act_mark { + struct nfp_fl_act_head head; + rte_be16_t reserved; + rte_be32_t mark; +}; + int nfp_flower_cmsg_mac_repr(struct nfp_app_fw_flower *app_fw_flower); int nfp_flower_cmsg_repr_reify(struct nfp_app_fw_flower *app_fw_flower, struct nfp_flower_representor *repr); diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c index 501a8d87bd..b3a2c1cdaf 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -83,6 +83,7 @@ #define NFP_FL_ACTION_OPCODE_METER 24 #define NFP_FL_ACTION_OPCODE_CT_NAT_EXT 25 #define NFP_FL_ACTION_OPCODE_PUSH_GENEVE 26 +#define NFP_FL_ACTION_OPCODE_SET_MARK 27 #define NFP_FL_ACTION_OPCODE_NUM 32 #define NFP_FL_OUT_FLAGS_LAST RTE_BIT32(15) @@ -1138,6 +1139,10 @@ nfp_flow_key_layers_calculate_actions(const struct rte_flow_action actions[], case RTE_FLOW_ACTION_TYPE_CONNTRACK: PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_CONNTRACK detected"); break; + case RTE_FLOW_ACTION_TYPE_MARK: + key_ls->act_size += sizeof(struct nfp_fl_act_mark); + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_MARK detected"); + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -3487,6 +3492,23 @@ nfp_flow_action_meter(struct nfp_flower_representor *representor, return 0; } +static void +nfp_flow_action_mark(char *act_data, + const struct rte_flow_action *action) +{ + struct nfp_fl_act_mark *fl_mark; + const struct rte_flow_action_mark *mark; + size_t act_size = sizeof(struct nfp_fl_act_mark); + + mark = action->conf; + + fl_mark = (struct nfp_fl_act_mark *)act_data; + fl_mark->head.jump_id = NFP_FL_ACTION_OPCODE_SET_MARK; + fl_mark->head.len_lw = act_size >> NFP_FL_LW_SIZ; + fl_mark->reserved = 0; + fl_mark->mark = rte_cpu_to_be_32(mark->id); +} + static uint32_t nfp_flow_count_output(const struct rte_flow_action actions[]) { @@ -3734,6 +3756,11 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, case RTE_FLOW_ACTION_TYPE_CONNTRACK: PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_CONNTRACK"); break; + case RTE_FLOW_ACTION_TYPE_MARK: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_MARK"); + nfp_flow_action_mark(position, action); + position += sizeof(struct nfp_fl_act_mark); + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; -- 2.39.1