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 1DC11A0A02; Thu, 20 Oct 2022 04:21:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56EB442C79; Thu, 20 Oct 2022 04:21:13 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2120.outbound.protection.outlook.com [40.107.101.120]) by mails.dpdk.org (Postfix) with ESMTP id 55D3142C6E for ; Thu, 20 Oct 2022 04:21:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hhsfBtsHE8NE8BU0MGtkg3b0cDcYg/hIUrCgrQIn7PWoGNqe1b8K4q4PUbrLmJEqpb3SwvqNU0kaUQHw9kRHyZEWqDGlxI0w128s9vfoJjqF4rKmM1gj2o4q6qaiBj5/BdeSrj6ueXzTyEJwxXJJqgMfAdABbDTI0MLZtkdReJv7uxey92jO7zo9+aU+qVa8PI9VCDMNQmrh7EtNzEgergJ+deHgbfcAscVo5PKDDkc7pKzRIpLE0JIY4D7m5gaLRS31/BcOioxXuXpm4GicIvArZaTwaNsHYVd/jvAfln4rFSvl++D8rylNFFo7O9DbLy4N1foPFLRwbwxUTo+FdA== 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=omNbcfpg6HOBKacei1ESRemcdD1OZOD75I83vA6J1JA=; b=fg+N3kALZH8Veup3Lmrfw/F/zczym2/B4VEhccwZbh08EWh0ymzKcO5cO/pHPZxiZ4GrtITdYxj8l5PGER4qX5w+sGFx/aLi/dtSphy1WPtD7pEeRiMt1VZwwkzP+1aH/fUF6Aj1gm/tPlTM9AkWG1VX+rhRCHp+yzCKFnD8eAFYsULyG+xKS5NJ/abJGH0UzssN4aaaeXCXq+BZ7KVYSrvHKccjE8NyTDB0fs6C32M1kLhHsKMArHNocaPvdRWSdRSPzTrbatzvUQT7iYVVGrnDpI3aHBwnge8GBtoGR4s+ybDHAadnDpokmselk/U0aLTajGsptecdMiDnERe+sA== 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=omNbcfpg6HOBKacei1ESRemcdD1OZOD75I83vA6J1JA=; b=S9FA4gh+XERyucPTMqgtGFc+ezSA2OwBUHVRnBCq5UZ56pkB48G/7+9Kkqc6/36oe+IP71SXGAbif1e/CQ+2y7Cyq9vPlQguM0A/YkLCYcGDVFTaOp/DSj2CfFacAtsYjRHeAmX1iGBYPTaAjTKOiw41HHk9oyMC4mQumqDsBfw= 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 DM4PR13MB5906.namprd13.prod.outlook.com (2603:10b6:8:4c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16; Thu, 20 Oct 2022 02:21:06 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b%4]) with mapi id 15.20.5723.014; Thu, 20 Oct 2022 02:21:06 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v5 06/25] net/nfp: support basic flow actions Date: Thu, 20 Oct 2022 10:19:32 +0800 Message-Id: <1666232391-29152-7-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666232391-29152-1-git-send-email-chaoyong.he@corigine.com> References: <1666092434-10357-1-git-send-email-chaoyong.he@corigine.com> <1666232391-29152-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR02CA0048.apcprd02.prod.outlook.com (2603:1096:4:196::23) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM4PR13MB5906:EE_ X-MS-Office365-Filtering-Correlation-Id: f1f09213-4a83-4e44-baea-08dab241be38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UecdjAYWpAmqpHLI8fUGPFIWKakKNyyVQA/1WwvVuB9dHPE1C68tGS6qgUZtM68zmw7tdgGFsB9BvBc42JiZ3i6rp1EY5Vy36xyyYIin7hO2f4QzTCqPhcTYYQUC2hyLTpf41fJUmuA11/4vAkK2jozRmNb+aFXOQXTAJFoF2lKKmLh6y7CUYp+DkPqZVkkuAh+8KBBw7xcoTzOojFXoMqQJ+0EXue/T5bCVzCjEfnfEeTFq1fCepdK19tVB2qJlkr1zA1jKVamKtIa0kLQlpW1HOQpt/dts6p8HvIHH9vh1EWdgsLcGJr3iEPE8WPvNXccMahoqVcwvJIGEZrk+VZunTXPkmDlTk4z3iAYPM2nNsWzXDX+mMTWxVCfspS1mQVHxuJaNk3WtajyGQrrwAMumnIt7Z0GK2V8HJgS+YNv+ZgXJhi9aUgmUlSj+3cX4L95s6yKlzHyYVPxVQSkAQ8Cggmuzhh1Lbo09kNjYkZj47JTrcXRYr7g3HiDF4ulVvoOu53skNoNjBDEatmBNGnCU8y2WT7oARiWfLLTAvuvqAuDqWjIIbJKFR4KJxVi6tBMGENS+QqG8secWrSDxrizB91CM6PxdyJdiBnAvaGySTmGoAHdBb5F+BDB/wt8vFKXFmrYFr8faWWP7fDketJMxp8RDMTa6ISFodR0jmJDUGjw48NbHqyQ++sAS7gEKxqBpWXcxSOAyBsijtYBuwqJEzgtFr+mFPXb9LOTW4NamuAOUFT3hs4jJSoWiit4vhaI7/Pjr2RxIuhMlTcoG8nEqQ5UujDWuZWb+LThj33xd+aFJ8omUsXhcDdIuIEiq 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:(13230022)(4636009)(136003)(376002)(39840400004)(346002)(396003)(366004)(451199015)(38100700002)(478600001)(38350700002)(316002)(6916009)(2906002)(186003)(66476007)(52116002)(66556008)(6666004)(66946007)(107886003)(4326008)(6506007)(2616005)(41300700001)(5660300002)(36756003)(8676002)(6486002)(8936002)(26005)(66574015)(44832011)(86362001)(83380400001)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bGllZzI4UVlmdXRKWks4TTZuMlFEKytJWG1WTnRiWkxWMzNsN2d2VCs3RWhw?= =?utf-8?B?alNFRTdyNUZIUWRPSUxlMzZyQnZBOTVyTGlYYXB3OHltL3FLV0hJSFR4MHUz?= =?utf-8?B?b2FnTThIbjZyTUg3ZUpYWHU5YzQyK25CYjZ6R2pRYk1IbllhaWFuckRyb21F?= =?utf-8?B?M3EwWFBBek5PUWZzUXJFZkV5S2tpYWpBbnJEQWFqaEdPdHpNeVJkTmxNVUxN?= =?utf-8?B?NW9ZaUkyWW1KTU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YyTHo1?= =?utf-8?B?aVl3elRQNnRsWG1jays4bjZ2MTBKTlZsZnV1bGh5TmlPWmNyZk14WUxtMXAw?= =?utf-8?B?d0VXcG0xeTF0UFpVQ1BzRmVQMXpCWk9EcUtpUm5QUDQzS1g5YlJmWE1SL3VS?= =?utf-8?B?Nnc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1f09213-4a83-4e44-baea-08dab241be38 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 02:21:06.1915 (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: w1+tqwN4unqRsQH3JqCLb6CbGa/ZvFi6LATt4jAMlU1KkRSWdjO/bTX/Jb34jOen7gxQUcjeBByiaipbey+yv1lOVfEARo3AMP5VEZDNihM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5906 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 Add the offload support of very basic actions: mark, rss, count, drop and output. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 5 ++ doc/guides/rel_notes/release_22_11.rst | 2 +- drivers/net/nfp/flower/nfp_flower_cmsg.h | 11 +++ drivers/net/nfp/nfp_flow.c | 112 +++++++++++++++++++++++++++++++ drivers/net/nfp/nfp_flow.h | 37 ++++++++++ 5 files changed, 166 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index 4460cf0..f91da82 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -29,3 +29,8 @@ Usage doc = Y [rte_flow items] eth = Y port_id = Y + +[rte_flow actions] +count = Y +drop = Y +port_id = Y diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 6d421a2..471f300 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -163,7 +163,7 @@ New Features * Added the control message interactive channels between PMD and firmware. * Added the support of representor port. - Add the support of rte_flow pattern items. + Add the support of rte_flow pattern items and actions. * **Updated NXP dpaa2 driver.** diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 75a3b91..d776e37 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -253,6 +253,17 @@ struct nfp_flower_mac_mpls { rte_be32_t mpls_lse; }; +struct nfp_fl_act_head { + uint8_t jump_id; + uint8_t len_lw; +}; + +struct nfp_fl_act_output { + struct nfp_fl_act_head head; + rte_be16_t flags; + rte_be32_t port; +}; + 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/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 1af0acd..be522ad 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -546,6 +546,22 @@ struct nfp_mask_id_entry { case RTE_FLOW_ACTION_TYPE_VOID: PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_VOID detected"); break; + case RTE_FLOW_ACTION_TYPE_MARK: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_MARK detected"); + break; + case RTE_FLOW_ACTION_TYPE_DROP: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_DROP detected"); + break; + case RTE_FLOW_ACTION_TYPE_COUNT: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_COUNT detected"); + break; + case RTE_FLOW_ACTION_TYPE_RSS: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_RSS detected"); + break; + case RTE_FLOW_ACTION_TYPE_PORT_ID: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_PORT_ID detected"); + key_ls->act_size += sizeof(struct nfp_fl_act_output); + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -773,6 +789,96 @@ struct nfp_mask_id_entry { return 0; } +static int +nfp_flow_action_output(char *act_data, + const struct rte_flow_action *action, + struct nfp_fl_rule_metadata *nfp_flow_meta) +{ + size_t act_size; + struct rte_eth_dev *ethdev; + struct nfp_fl_act_output *output; + struct nfp_flower_representor *representor; + const struct rte_flow_action_port_id *port_id; + + port_id = action->conf; + if (port_id == NULL || port_id->id >= RTE_MAX_ETHPORTS) + return -ERANGE; + + ethdev = &rte_eth_devices[port_id->id]; + representor = (struct nfp_flower_representor *)ethdev->data->dev_private; + act_size = sizeof(struct nfp_fl_act_output); + + output = (struct nfp_fl_act_output *)act_data; + output->head.jump_id = NFP_FL_ACTION_OPCODE_OUTPUT; + output->head.len_lw = act_size >> NFP_FL_LW_SIZ; + output->flags = rte_cpu_to_be_16(NFP_FL_OUT_FLAGS_LAST); + output->port = rte_cpu_to_be_32(representor->port_id); + + nfp_flow_meta->shortcut = rte_cpu_to_be_32(representor->port_id); + + return 0; +} + +static int +nfp_flow_compile_action(__rte_unused struct nfp_flower_representor *representor, + const struct rte_flow_action actions[], + struct rte_flow *nfp_flow) +{ + int ret = 0; + char *position; + char *action_data; + bool drop_flag = false; + uint32_t total_actions = 0; + const struct rte_flow_action *action; + struct nfp_fl_rule_metadata *nfp_flow_meta; + + nfp_flow_meta = nfp_flow->payload.meta; + action_data = nfp_flow->payload.action_data; + position = action_data; + + for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) { + switch (action->type) { + case RTE_FLOW_ACTION_TYPE_VOID: + break; + case RTE_FLOW_ACTION_TYPE_MARK: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_MARK"); + break; + case RTE_FLOW_ACTION_TYPE_DROP: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_DROP"); + drop_flag = true; + break; + case RTE_FLOW_ACTION_TYPE_COUNT: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_COUNT"); + break; + case RTE_FLOW_ACTION_TYPE_RSS: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_RSS"); + break; + case RTE_FLOW_ACTION_TYPE_PORT_ID: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_PORT_ID"); + ret = nfp_flow_action_output(position, action, nfp_flow_meta); + if (ret != 0) { + PMD_DRV_LOG(ERR, "Failed when process" + " RTE_FLOW_ACTION_TYPE_PORT_ID"); + return ret; + } + + position += sizeof(struct nfp_fl_act_output); + break; + default: + PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); + return -ENOTSUP; + } + total_actions++; + } + + if (drop_flag) + nfp_flow_meta->shortcut = rte_cpu_to_be_32(NFP_FL_SC_ACT_DROP); + else if (total_actions > 1) + nfp_flow_meta->shortcut = rte_cpu_to_be_32(NFP_FL_SC_ACT_NULL); + + return 0; +} + static struct rte_flow * nfp_flow_process(struct nfp_flower_representor *representor, const struct rte_flow_item items[], @@ -823,6 +929,12 @@ struct nfp_mask_id_entry { goto free_flow; } + ret = nfp_flow_compile_action(representor, actions, nfp_flow); + if (ret != 0) { + PMD_DRV_LOG(ERR, "nfp flow action process failed."); + goto free_flow; + } + nfp_flow_meta = nfp_flow->payload.meta; mask_data = nfp_flow->payload.mask_data; mask_len = key_layer.key_size; diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h index 6fa1b3e..2ad6d0a 100644 --- a/drivers/net/nfp/nfp_flow.h +++ b/drivers/net/nfp/nfp_flow.h @@ -33,6 +33,43 @@ /* The firmware expects lengths in units of long words */ #define NFP_FL_LW_SIZ 2 +#define NFP_FL_SC_ACT_DROP 0x80000000 +#define NFP_FL_SC_ACT_USER 0x7D000000 +#define NFP_FL_SC_ACT_POPV 0x6A000000 +#define NFP_FL_SC_ACT_NULL 0x00000000 + +/* Action opcodes */ +#define NFP_FL_ACTION_OPCODE_OUTPUT 0 +#define NFP_FL_ACTION_OPCODE_PUSH_VLAN 1 +#define NFP_FL_ACTION_OPCODE_POP_VLAN 2 +#define NFP_FL_ACTION_OPCODE_PUSH_MPLS 3 +#define NFP_FL_ACTION_OPCODE_POP_MPLS 4 +#define NFP_FL_ACTION_OPCODE_USERSPACE 5 +#define NFP_FL_ACTION_OPCODE_SET_TUNNEL 6 +#define NFP_FL_ACTION_OPCODE_SET_ETHERNET 7 +#define NFP_FL_ACTION_OPCODE_SET_MPLS 8 +#define NFP_FL_ACTION_OPCODE_SET_IPV4_ADDRS 9 +#define NFP_FL_ACTION_OPCODE_SET_IPV4_TTL_TOS 10 +#define NFP_FL_ACTION_OPCODE_SET_IPV6_SRC 11 +#define NFP_FL_ACTION_OPCODE_SET_IPV6_DST 12 +#define NFP_FL_ACTION_OPCODE_SET_IPV6_TC_HL_FL 13 +#define NFP_FL_ACTION_OPCODE_SET_UDP 14 +#define NFP_FL_ACTION_OPCODE_SET_TCP 15 +#define NFP_FL_ACTION_OPCODE_PRE_LAG 16 +#define NFP_FL_ACTION_OPCODE_PRE_TUNNEL 17 +#define NFP_FL_ACTION_OPCODE_PRE_GS 18 +#define NFP_FL_ACTION_OPCODE_GS 19 +#define NFP_FL_ACTION_OPCODE_PUSH_NSH 20 +#define NFP_FL_ACTION_OPCODE_POP_NSH 21 +#define NFP_FL_ACTION_OPCODE_SET_QUEUE 22 +#define NFP_FL_ACTION_OPCODE_CONNTRACK 23 +#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_NUM 32 + +#define NFP_FL_OUT_FLAGS_LAST (1 << 15) + /* Tunnel ports */ #define NFP_FL_PORT_TYPE_TUN 0x50000000 -- 1.8.3.1