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 7EE7FA0543; Tue, 25 Oct 2022 10:00:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B4EE42BD0; Tue, 25 Oct 2022 10:00:11 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2093.outbound.protection.outlook.com [40.107.223.93]) by mails.dpdk.org (Postfix) with ESMTP id 4F87142B8E for ; Tue, 25 Oct 2022 10:00:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FWOPo92UoKkgP4rL54TEXs6BM1w4AzpItFh0UqeqYAff79QmaNXdmUPjBMET0sNJZJZm+dcYK2YEwNJmMqFacEQsZUaU3AyZlTflslbaDrhSUxHm8XCEzsMGrHEGK4jtyCk8xZfNuvheyhzLCwcFV47AumjENgyWMEwo6Ox3ZQpvoAOipcAeoNkOyU1ypfhbrlLcoirpCkmFqK77FgClb8RQXVxKGtiIjAMnyy2PX+VKw7VEUvpMKkiK/+SnETHq6kGBpnhKOMbSlpq8hZQREVkXeXhRn+X/oA0zmXW+kK3O3IbwB1QpOjotjB+qV5Eii5WwA1d2/JPhqHQ/pjzb9A== 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=b/mnjWQ023jGw/OG9fUmtSnkQY2iidLOzgr/M65/+Zg=; b=Iqoe3KLBc0xblgsjD/cn7lS0UCYM0IViqHpntLtjJ7MhxXqr+V+b/TyF2WwsgoJ73cZGD6iVppLekoNE05/6NDKwJiiLJ6pORtiqKW2QFmwCJrWMASxWMxeIx+aPm7RSXeYJeI4yb3Obw9QWjYvcZcWVqNKq1+fM63EBHe3o3NVQeXQgojm9tJ9YdBOogDjrJZidD/x2KkMjwSvhRjpF59duJpVjZIdOjKPfvG4h7GkWgQhoY53sWRWtwTAd6mc9dQATW6fJIfP1XcIjqxwmhG7C/hO7awpXyprbylWPtpd9rHGdIV3LukHfngOQn/gIvt+LQKJykTuzk8cQqcFA0g== 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=b/mnjWQ023jGw/OG9fUmtSnkQY2iidLOzgr/M65/+Zg=; b=HTuNW9QMfCu37qaKYRkQ3hgcyO0wWptE0uSm+8zlZIkpbn+12gfwcZCo/g0LbnRx/z9+FvhV9JQX4U7PWlBKWXXStMup4qWbFwweTj6NPhFoiCSBs5OG/So2WVspHqHZdSnCGG6OFUO+ljBoh5RyhnIuhr25cNUnDEVzoqxgQcc= 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 BY5PR13MB4405.namprd13.prod.outlook.com (2603:10b6:a03:1d4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 08:00:03 +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; Tue, 25 Oct 2022 08:00:03 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v3 06/26] net/nfp: support IPv4 VXLAN encap flow action Date: Tue, 25 Oct 2022 15:58:58 +0800 Message-Id: <20221025075918.7778-7-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20221025075918.7778-1-chaoyong.he@corigine.com> References: <1666427069-10553-1-git-send-email-chaoyong.he@corigine.com> <20221025075918.7778-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY5PR13MB4405:EE_ X-MS-Office365-Filtering-Correlation-Id: 58d845ff-510e-4aee-b3c2-08dab65eec70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ooDiaHoo8q0FraIPNWI6WGwlrcBcYgnK7A71uOqOZfX6gU9gTJkVcBek5iJ/QFyD4v2niJS3sPVchXYP+ff43NldMKoVlDguP7vRRPH8jCDemTWh5qIXsw70Hl0qKUUcDz0Wu3J+bwr1pP6eZnPCIjSiqKqarfJKEODGLXYvHXzZox8McL2eCcYCml7AXav7pcQEtwdbDb5WTRFBvtn/h4B6yj9HjL3Fc7yRrv464advKIkKs424bvA9IjQ5o73DQWaDrWyD8NS23tNCTr/l6m33F04YRU9VnCKrIj0SDtSncHTJJHDlWRsaT7EP4QaH30r6u5Mcg+fbVDjjRSwpW7HxhW/nrpqWz9qkngN1Ctn9i508h+Zn75qQejVpIGWV4iEVo2VznmN18quckmaGC5ltDqmzJfZ6DLvMzmEBg00p+s80DdeApqFyzjINs0BAfg3euYVeBGs2brXla4KzfMPyy7SMEWdjigrMvVyvkyuZehrcebJmOoNW54Y/ggxk9UbvbCDm5KIoGqPMgXmGGM3ZXO5HDnAQmhhUKd2xf/hHi7c7V8cuEPYufu4ksEjD60KqpBuz+9u4a7OSjDZzyMKHpviBVOdbwjKWTeCbGYT/NoyoUbzX8uG9QwSohhsAWSRUqjKkMLq8Gt35bBVTJ+ChSUOQO4AR0L/InWgW8hMXhVKlmLhLDrx08tD4EfPp27fQY0z4Ncrr2hbYjXsDLS47nDOPW8PcskQYy9syBFAvWI3l8VtonDVTkLrLwn+aw+PbJpve4C7IMXa/1k1CpQ== 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)(39830400003)(346002)(136003)(376002)(366004)(396003)(451199015)(36756003)(6486002)(5660300002)(66946007)(66476007)(8936002)(38350700002)(38100700002)(66556008)(83380400001)(66574015)(86362001)(44832011)(6916009)(2616005)(26005)(107886003)(186003)(6512007)(1076003)(316002)(478600001)(52116002)(8676002)(41300700001)(4326008)(2906002)(6506007)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S3VYTUVlZEpMN2I4TDU3anFVdTdrSkFtakxuUDYzV3hpVnE3TWJVVVZUV3Bs?= =?utf-8?B?Z29QdFp0MVlGRUtVRmpic0hlQi9Qc0c5aWZDUFNVTTNoVjV5QXJRdm9lVFZM?= =?utf-8?B?V1BCV1g2Sm4xZStDdkkzVWpCK1RpOU9nTjhhMHV0VGFiQXF4THN2OHVFS050?= =?utf-8?B?NzdRcXFJdEEwQkNhNmIybmhjRHRqMldZRjhib00ySnoyU012VlNnOGY1eDlQ?= =?utf-8?B?SFR2blNCZ29TOFVnY05ER2htV3ZrV1RLd05oZ2U4b3lwNHFF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1Yd2NNV2l5RnVuZzZvWUgrYUZ4V2phUHNOd3hLUU5sQWk1?= =?utf-8?B?S3BTQWo2VFRsRzlhQzk4OWI1VDYwUjJGRXZsTXFuZXp4QjkwVjFYVnE1azYv?= =?utf-8?B?RUE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58d845ff-510e-4aee-b3c2-08dab65eec70 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 08:00:03.8211 (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: XlcHrWIklg7fYlUwrsXUXNSVKRAnEtH77rpg/ysrOhfUeg7WJaRDmHlA3iUIBJ6YKMQh7lg0L2ZmaWvWYrNHa7x7TX2N7JIJt5ii9IoueN4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR13MB4405 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 encap action for IPv4 VXLAN tunnel. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_flow.c | 132 +++++++++++++++++++++++++++++-- 2 files changed, 128 insertions(+), 5 deletions(-) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index faaa7da83c..ff97787bd9 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -56,3 +56,4 @@ set_mac_src = Y set_tp_dst = Y set_tp_src = Y set_ttl = Y +vxlan_encap = Y diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index e1b892f303..d2e779ca96 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -10,8 +10,10 @@ #include #include "nfp_common.h" +#include "nfp_ctrl.h" #include "nfp_flow.h" #include "nfp_logs.h" +#include "nfp_rxtx.h" #include "flower/nfp_flower.h" #include "flower/nfp_flower_cmsg.h" #include "flower/nfp_flower_ctrl.h" @@ -19,6 +21,17 @@ #include "nfpcore/nfp_mip.h" #include "nfpcore/nfp_rtsym.h" +/* + * Maximum number of items in struct rte_flow_action_vxlan_encap. + * ETH / IPv4(6) / UDP / VXLAN / END + */ +#define ACTION_VXLAN_ENCAP_ITEMS_NUM 5 + +struct vxlan_data { + struct rte_flow_action_vxlan_encap conf; + struct rte_flow_item items[ACTION_VXLAN_ENCAP_ITEMS_NUM]; +}; + /* Static initializer for a list of subsequent item types */ #define NEXT_ITEM(...) \ ((const enum rte_flow_item_type []){ \ @@ -724,6 +737,11 @@ nfp_flow_key_layers_calculate_actions(const struct rte_flow_action actions[], tc_hl_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP detected"); + key_ls->act_size += sizeof(struct nfp_fl_act_pre_tun); + key_ls->act_size += sizeof(struct nfp_fl_act_set_tun); + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -1772,7 +1790,7 @@ nfp_flow_action_set_tc(char *act_data, tc_hl->reserved = 0; } -__rte_unused static void +static void nfp_flow_pre_tun_v4_process(struct nfp_fl_act_pre_tun *pre_tun, rte_be32_t ipv4_dst) { @@ -1791,7 +1809,7 @@ nfp_flow_pre_tun_v6_process(struct nfp_fl_act_pre_tun *pre_tun, memcpy(pre_tun->ipv6_dst, ipv6_dst, sizeof(pre_tun->ipv6_dst)); } -__rte_unused static void +static void nfp_flow_set_tun_process(struct nfp_fl_act_set_tun *set_tun, enum nfp_flower_tun_type tun_type, uint64_t tun_id, @@ -1812,7 +1830,7 @@ nfp_flow_set_tun_process(struct nfp_fl_act_set_tun *set_tun, set_tun->tos = tos; } -__rte_unused static int +static int nfp_flower_add_tun_neigh_v4_encap(struct nfp_app_fw_flower *app_fw_flower, struct nfp_fl_rule_metadata *nfp_flow_meta, struct nfp_fl_tun *tun, @@ -1922,7 +1940,7 @@ nfp_flower_del_tun_neigh_v6(struct nfp_app_fw_flower *app_fw_flower, return nfp_flower_cmsg_tun_neigh_v6_rule(app_fw_flower, &payload); } -__rte_unused static int +static int nfp_flower_del_tun_neigh(struct nfp_app_fw_flower *app_fw_flower, struct rte_flow *nfp_flow) { @@ -1961,7 +1979,81 @@ nfp_flower_del_tun_neigh(struct nfp_app_fw_flower *app_fw_flower, } static int -nfp_flow_compile_action(__rte_unused struct nfp_flower_representor *representor, +nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower, + char *act_data, + char *actions, + const struct vxlan_data *vxlan_data, + struct nfp_fl_rule_metadata *nfp_flow_meta, + struct nfp_fl_tun *tun) +{ + struct nfp_fl_act_pre_tun *pre_tun; + struct nfp_fl_act_set_tun *set_tun; + const struct rte_flow_item_eth *eth; + const struct rte_flow_item_ipv4 *ipv4; + const struct rte_flow_item_vxlan *vxlan; + size_t act_pre_size = sizeof(struct nfp_fl_act_pre_tun); + size_t act_set_size = sizeof(struct nfp_fl_act_set_tun); + + eth = (const struct rte_flow_item_eth *)vxlan_data->items[0].spec; + ipv4 = (const struct rte_flow_item_ipv4 *)vxlan_data->items[1].spec; + vxlan = (const struct rte_flow_item_vxlan *)vxlan_data->items[3].spec; + + pre_tun = (struct nfp_fl_act_pre_tun *)actions; + memset(pre_tun, 0, act_pre_size); + nfp_flow_pre_tun_v4_process(pre_tun, ipv4->hdr.dst_addr); + + set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size); + memset(set_tun, 0, act_set_size); + nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, vxlan->hdr.vx_vni, + ipv4->hdr.time_to_live, ipv4->hdr.type_of_service); + set_tun->tun_flags = vxlan->hdr.vx_flags; + + /* Send the tunnel neighbor cmsg to fw */ + return nfp_flower_add_tun_neigh_v4_encap(app_fw_flower, nfp_flow_meta, + tun, ð->hdr, ipv4); +} + +static int +nfp_flow_action_vxlan_encap(struct nfp_app_fw_flower *app_fw_flower, + char *act_data, + char *actions, + const struct rte_flow_action *action, + struct nfp_fl_rule_metadata *nfp_flow_meta, + struct nfp_fl_tun *tun) +{ + size_t act_len; + size_t act_pre_size; + const struct vxlan_data *vxlan_data; + + vxlan_data = action->conf; + if (vxlan_data->items[0].type != RTE_FLOW_ITEM_TYPE_ETH || + vxlan_data->items[1].type != RTE_FLOW_ITEM_TYPE_IPV4 || + vxlan_data->items[2].type != RTE_FLOW_ITEM_TYPE_UDP || + vxlan_data->items[3].type != RTE_FLOW_ITEM_TYPE_VXLAN || + vxlan_data->items[4].type != RTE_FLOW_ITEM_TYPE_END) { + PMD_DRV_LOG(ERR, "Not an valid vxlan action conf."); + return -EINVAL; + } + + /* + * Pre_tunnel action must be the first on the action list. + * If other actions already exist, they need to be pushed forward. + */ + act_len = act_data - actions; + if (act_len != 0) { + act_pre_size = sizeof(struct nfp_fl_act_pre_tun); + memmove(actions + act_pre_size, actions, act_len); + } + + if (vxlan_data->items[1].type == RTE_FLOW_ITEM_TYPE_IPV4) + return nfp_flow_action_vxlan_encap_v4(app_fw_flower, act_data, + actions, vxlan_data, nfp_flow_meta, tun); + + return 0; +} + +static int +nfp_flow_compile_action(struct nfp_flower_representor *representor, const struct rte_flow_action actions[], struct rte_flow *nfp_flow) { @@ -2118,6 +2210,20 @@ nfp_flow_compile_action(__rte_unused struct nfp_flower_representor *representor, tc_hl_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP"); + ret = nfp_flow_action_vxlan_encap(representor->app_fw_flower, + position, action_data, action, nfp_flow_meta, + &nfp_flow->tun); + if (ret != 0) { + PMD_DRV_LOG(ERR, "Failed when process" + " RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP"); + return ret; + } + position += sizeof(struct nfp_fl_act_pre_tun); + position += sizeof(struct nfp_fl_act_set_tun); + nfp_flow->type = NFP_FLOW_ENCAP; + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; @@ -2410,6 +2516,22 @@ nfp_flow_destroy(struct rte_eth_dev *dev, goto exit; } + switch (nfp_flow->type) { + case NFP_FLOW_COMMON: + break; + case NFP_FLOW_ENCAP: + /* Delete the entry from nn table */ + ret = nfp_flower_del_tun_neigh(app_fw_flower, nfp_flow); + break; + default: + PMD_DRV_LOG(ERR, "Invalid nfp flow type %d.", nfp_flow->type); + ret = -EINVAL; + break; + } + + if (ret != 0) + goto exit; + /* Delete the flow from hardware */ if (nfp_flow->install_flag) { ret = nfp_flower_cmsg_flow_delete(app_fw_flower, nfp_flow); -- 2.29.3