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 226DCA0032; Sat, 22 Oct 2022 10:25:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54264427F4; Sat, 22 Oct 2022 10:25:03 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2110.outbound.protection.outlook.com [40.107.93.110]) by mails.dpdk.org (Postfix) with ESMTP id 3D5D740042 for ; Sat, 22 Oct 2022 10:24:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OtA70NmjuXY79xQvWIRS9ZGS1zATaKJgYTwbbMPNZZCwEQ6KtlD5UR1y1LkqFNwrwWvuK73Kb4VapsxsN1CbNVerli7adYTonZoSy8zVetxKWgY5GlqVqOFWVmUsBZ07bmN/NiuEkIWnC0ipJ4W7/qcF0Qw/zO7lUbXN1y4FiLPe6kBzJCG2h5MuiuEvMdzXRK/y/GJKQU98ghEzFkJoxir+Q0ibz84qT8PV7wqtdSN/JDLNaEFOqitUWyhbOiOp4VBUOwg9etjePzSWnmoQrsToeQpVeANw1br334zXJn6o/6zEWWoLtmW3+c6XzPSSTw9D0pU9knz0VShRPZzzBg== 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=X4XhteKcXsNK5Ao1/yAvDR49o0TiMiHs4T5LyugYBUM=; b=UDIWXPoBachQg/X3lh0VfzkiSQkFARU06Uv3cY6DJimw7UIHDHcqvUU4UQKqYw7Dpl5WUUjpev0eTIWx5pP68mVPuFj4hJX6CMqv9sK8vK2bD1apAjNM8NFb/7KnujuCJh83ApZ7a0kMZQ2JGG0pV1KTYhRdNr/QtxKWeeFccWWdM/AWC89N7CR7htqpHwXQuke9ItGce5frh4/bsI+bn9P2jrBWl3j4Sf5DoiUE2AheDS7Syg3oYkSmNKE+0qW+E68fizK7b5jkRwPaUYKCMkiERiahA8E027xJ1wyAPqIOFGwxyz/rbIl6l44whLcC8EmDE6BaW5sJ2Db+jSR24g== 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=X4XhteKcXsNK5Ao1/yAvDR49o0TiMiHs4T5LyugYBUM=; b=heBfsCkQE3RYaLyH+g/iy/dDuDLy9RT0HrzSNuUajxaLExrx707/xHNfu/JRKTy0Bvfp++GbfYdLA/02EVSUWY3HHEYU4dRtKfRj71z9ev8E+wsU60eFKcHvnblqkmjdkhQdlo4s6wt1UpNASFyJtOc114sjP4H4+B2R140IQ9Y= 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 PH7PR13MB5454.namprd13.prod.outlook.com (2603:10b6:510:130::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.8; Sat, 22 Oct 2022 08:24:56 +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; Sat, 22 Oct 2022 08:24:56 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 05/25] net/nfp: support IPv4 VXLAN encap flow action Date: Sat, 22 Oct 2022 16:24:09 +0800 Message-Id: <1666427069-10553-6-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666427069-10553-1-git-send-email-chaoyong.he@corigine.com> References: <1666063359-34283-1-git-send-email-chaoyong.he@corigine.com> <1666427069-10553-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0056.apcprd02.prod.outlook.com (2603:1096:4:54::20) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5454:EE_ X-MS-Office365-Filtering-Correlation-Id: c21a2b78-b388-43e5-fa1c-08dab406e6d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /FZrdYbRTtXfHLiBpIGoejJElub9aZZT+PTCx/HRJGN9CGQ73RnsnFWntV4c2tRMRk83BuF1km1DpGPrStUBkwvW/jZMBHFAD9zccmf2zEaJ8MnVMBAXfteJCiggJLniOYs6gHeR85jRHuZz1qbjSbTvOBMe28qltboRDIMcXtpVLMtfLCgbatAvabKau4soHei/S4yh6LCLmI4Imtmu68UvjkYRcclEM35/qDm9AUnDU7SsNG0xqh1hTaNchY73cKgFzMfwEp8zFfJrcMr8k+TDn0ETjKH2pJsDN71TFjCPymIjUerobQf2t0yLBPaCf+9WaQg7uO89kjWlMq7ByyUsV2uVklV+bnamKcYQkYIJUPKQZGjkU74faKexWa+hdB9K2iTNdoBFATWQ/JEIMg6RFJA1sS61vXN+hOxHxBBiKibhz0jGBK/GIo+7tFiBeJaK2qrAwBPYyMysUUmCfs2x/RJ1kGX01Ir3vrb0kKrRgVYN2/dmn3saHZV4CWdjZwRPbmux0WEwGrc09Xy1h5sHWgi2BjpZavpplf/QC3sm7qL0jDiidhhsqknwD2O7w+AfyMsYzY64S/n1LSbvziWP1THF/xAUpsctEnsUfuG8+iZNzt5ELK6jnhnJQIIa8TXcCaz8zpOEstpIVH9bDH2ou/tNB7IDQaiQ/ToTIrx2cipvkILDb/XfQ2RvZxuWwqhKVaTXmdn1eNmRpB5jpPI40jYrxHwkDQ3jeMaEM2we+E8qHRBqMR0wbIEOjh30hl9AvGF8CoihH8H80zF8gQRKS12h7hLhhFT1GzX2RckStDT9bXGypfok7t9dUb3m 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)(346002)(366004)(396003)(376002)(39840400004)(136003)(451199015)(186003)(6916009)(316002)(66574015)(83380400001)(2616005)(38350700002)(86362001)(44832011)(38100700002)(66556008)(5660300002)(41300700001)(107886003)(478600001)(6506007)(6486002)(6666004)(8676002)(26005)(6512007)(8936002)(4326008)(2906002)(52116002)(66946007)(66476007)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bXVzK1VYUmg0TFdsbVNndG9ZNzdOVG1XYkoyUFlGOHFNRjQzbFpVUEhuOG5o?= =?utf-8?B?ZHY1ZWtGN21wd1NHQmVZeWdoc1Q2cngyZCt4SURlWUZsWU9NWXE1aFZVa28x?= =?utf-8?B?cUhDcy9vV0ZvRWszT3V4UmVvazhXWGRHSzRjVnBpUElscWdnc2tFdUxKZUtl?= =?utf-8?B?NEc0RXFQT2dZa1hMaGZsTXd6M2JqdG5MNkY5S1hjZ0toV0tLc1lEZWo5MDl0?= =?utf-8?B?c2x6VzJGd0dmTVZ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?TXdJSFIvR3FXb2xaRkMrNjJwQmx2WTgybitmNzVXVTk5d282d3cwczIvL1Rw?= =?utf-8?B?Y1FuRm51dkRzMDJ0SWV1Wm9qSUhqc0lQQlp0NmlMRmgvUUg0c2k2SVJMdmFE?= =?utf-8?B?Z0E9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c21a2b78-b388-43e5-fa1c-08dab406e6d7 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2022 08:24:56.5187 (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: jGOtvF9HCrAJSmRRxumRBkpuLYKXD5BKXF2FfTNlrqOEyVZH+Kude1ukt9X28w7u/6mqLe6/2nwZ3H7EdPHcalqUYvbtRTl0vkn+cGmm6Qk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5454 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 faaa7da..ff97787 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 e1b892f..d2e779c 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 @@ struct nfp_mask_id_entry { 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 @@ struct nfp_mask_id_entry { 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 @@ struct nfp_mask_id_entry { 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 @@ struct nfp_mask_id_entry { 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 @@ struct nfp_mask_id_entry { 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 @@ struct nfp_mask_id_entry { } 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 @@ struct nfp_mask_id_entry { 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 @@ struct nfp_mask_id_entry { 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); -- 1.8.3.1