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 7F43DA0560; Tue, 18 Oct 2022 05:23:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 407ED427F2; Tue, 18 Oct 2022 05:23:11 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2126.outbound.protection.outlook.com [40.107.223.126]) by mails.dpdk.org (Postfix) with ESMTP id 469B042684 for ; Tue, 18 Oct 2022 05:23:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0KAtRGRbGL1O1fApDmHWVwLeH3XEMP0dFwxq4LCGPnzTJrhh2HgVSJMf5On5oyt7Oi4lJYRzgwiWr0tpl3c4lpf98gUnQCrw9xc5iylBPzTw5JmEHgacOtR3J/KsGmZbDoSl+LYL/N9YZoEg5U3NO4O5mZaRYq1EqYEXNTjQon2p6fMNmFPX/0zR68q+0lfGkQsFzs9QgzRQGRJrb6fFgzLitatNwuS1S/JdPO8ZXAT1XmcNKjQ3AB7CGYn4PZL+6Zcr21XOekz1SQoKdydBDJR1Ocgb38eCuyaL08HXYh1TYq4mF/cYXFCTYoAW+HM4Nyg/s69q27YpssvBE7ZRQ== 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=O0wT5lPctQFE9agA63PZsVDB8KBoOkbakguWjuFuxgk=; b=GU5XOHotu1iricdde7Lj6TW91PfrUnFF9/yRtxHnHay4A8M57z3OmiFikW/jq/THWWHKA75XfQXkTjD9L4vSKhiZLdyiTUrCriEH1LHi+PW6xWHMQVyrPVFd1/NMnCaHK99/XVAS8LXqL9Y1yOV4EkZZHQgPMlcZhW5RTNZHZa9qh3Xv7eF2GaQVtYSI3Ckn3GUg8uCvqLsgW0qOAtjjOqvmcOcC18+rbImL7VWATHeGrD1eAigiipfdhxw2OHFpII+YXo1tWxqLNxoHromne8+kfA/ms0IpYdROLEy4frrQmlEGU9ZdYerE5pXyj8QF4ZHbruZkClGq/EeSmkCTTw== 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=O0wT5lPctQFE9agA63PZsVDB8KBoOkbakguWjuFuxgk=; b=O6mUrGgi3l8O2FiE5Y9LioH7ExV8Z9CzPL8Xie0F9E6X87HIqz4zlKMx6ceJ4RgBG2Aow2KlAHnbdeM7faKGvW4WwzHO2Y6EUKH61bPEHtpbockCJ1x4+bpmoamqM9Z9NM9odet8/khSTQ9dM3cvdXPzxyitOAs2GxRKCzRxoBs= 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 MN2PR13MB4149.namprd13.prod.outlook.com (2603:10b6:208:24f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Tue, 18 Oct 2022 03:23:08 +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, 18 Oct 2022 03:23:08 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 05/25] net/nfp: add the offload support of IPv4 VXLAN encap action Date: Tue, 18 Oct 2022 11:22:19 +0800 Message-Id: <1666063359-34283-6-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666063359-34283-1-git-send-email-chaoyong.he@corigine.com> References: <1666063359-34283-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0184.apcprd01.prod.exchangelabs.com (2603:1096:4:189::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MN2PR13MB4149:EE_ X-MS-Office365-Filtering-Correlation-Id: bc586961-0999-4aed-04b9-08dab0b81423 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v2ppTThaOzazW24wjYNov0KMkHIv5wciMh4+TpWcwIBZaoOsu7STPZ1SwoScFxTd5Jg4A7GJ4FS/zdaX3TCPBDdEXpbl634ZywIUjb6RprNAf8O0mrgciHDucfcIAhzi+OdBTYVFwcqipqfe+Dli1HxIc/V6ItMIkgT/ocIi35qV8Y7EJpe4fIJBiGbBXt7QVkoskDyEP4jHuCzqVqh3X5APnQLW54d+vfCfuc8BN6UoFkqBKinyp1GBAGu/AtUxI/EvNzoT0/Lu0aGOg1HnAaycEj1ZY+FCCkjBXg0ijal9s5CGzdcPP1NJz8P9LctnpZV42U7iRRyntjiFdquouI74dCUJbBjCrKY4Phk/bKcEld1YSinaVK3d7fD+MYjWInbAZR5x9BjFehp+e98RHeK9wjvk0WxHPKRT+edUFLq/ZxAwORBBQSONv4nQqPjsgofsERy/w0u5HoNMrcm3o/g4g4M41wpsPyWYJSvzsO+PwD5eFeC4zdIP7kLZsoBjZ9xDtsCREZ0r+zsC+ySEFheJ3iGR9aRZM1ijOEWno5XfmHvJmVRLDQsylwNE6aUv+nDZYXzNvUl31uyDlau3pFJmVt1tkRymlLLRpxgltvf2698+/NFWAK46EPV9OeF8wcN5CEXH4FNWhFQ6hEq0lUBfe8bDvKAoCo8UgdgbIboZMsfcgDvVvCzMdNPPVJQz/VNgbmDFk7D4mnyQVM23kstZN7+4kWPV0KqxGLwKG6pJS8quEfsPrDKv0CnvMljyWPwDxpxJnXKc8HbAtTvOhIQai5NYWow2/nJkACunxgqdFIc09ePXM9OR9AGXmZ7P 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)(366004)(346002)(376002)(396003)(39840400004)(451199015)(38350700002)(86362001)(38100700002)(36756003)(83380400001)(66574015)(5660300002)(52116002)(6506007)(2616005)(26005)(6512007)(186003)(6666004)(2906002)(6916009)(316002)(6486002)(107886003)(4326008)(66946007)(66556008)(478600001)(8936002)(44832011)(41300700001)(8676002)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?djY5Mm5sc05ZcHUxNFU0SWhBS1JCVlVUUVJIYkVtSG9pN0pMSHE0Mm1vVVpB?= =?utf-8?B?RnNZb1RqeGVBNFN3cUxmLzF3MHdTMmFqQ25GcWNSc2dXVzNldVE0REdXSjlw?= =?utf-8?B?Y1NGUFBqdnZHR1o1NGRKaG1qclAxZHlGYXBjTFlKNlVrMDlDRFl1TlFNaWNB?= =?utf-8?B?R3kyMXdzL0Y2UWhKcURoVlU1ZjlFSnNYZXBia2MwNUJKeXhjMWdBV01kZTNh?= =?utf-8?B?eTBLQi9WaVBsVk5UaERSU2lKS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= =?utf-8?B?d1NHSEluMVNUNTN2UzVmUkNZV0hYMUlTTmFTaUQzaUJPQi9NK1p0UXZYV3Ix?= =?utf-8?B?NitncC9aKzNLNzJnaWp2dHNaSUwzckpZbDNzRXdsTUJlVlEya1JsNEJxb3Ru?= =?utf-8?B?ZlE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc586961-0999-4aed-04b9-08dab0b81423 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 03:23:08.7797 (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: L4sdYdAxibKE7xiPq20NluzY5XaGhOc5hJcSylpzUcC0710I4oBo3vowLFtgE4nIq9s/8bGnbHlakqhAUjqbNq9LH6cSPJEl1MfwChzrAfY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB4149 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 40b9a4d..fbfd5ba 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -58,3 +58,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 b8e666c..2f04fdf 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 []){ \ @@ -742,6 +755,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; @@ -1790,7 +1808,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) { @@ -1809,7 +1827,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, @@ -1830,7 +1848,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, @@ -1940,7 +1958,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) { @@ -1979,7 +1997,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) { @@ -2142,6 +2234,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; @@ -2418,6 +2524,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