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 5EF0CA0560; Tue, 18 Oct 2022 05:24:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CDB54284D; Tue, 18 Oct 2022 05:23:28 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2109.outbound.protection.outlook.com [40.107.92.109]) by mails.dpdk.org (Postfix) with ESMTP id 5C4A741145 for ; Tue, 18 Oct 2022 05:23:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sn4jPoGKkuX0IzBBxhxD1byouECofiEUWGhHJKY56DwCpioBtYKfZdqUfdHIcUbhjRb1TZKZqMMPQ+/kBV2CCzSd38AXev0DO+RftV6Qn7v1zR0Amt5H+OPkRPF156jltoAfIYNGBMd87e/X+kHmcnPIQiVdpvpWBFr2NuwcrZinXc5i9j2RMEHpclhCuoedy4VeUrCDoG3e2q2KpCYsKSBEVUiyFubX/9vGDolMFqI46dQVfCVnV9JVDsJg1RRjisyYJjOGaKIcxYpvN+lSfSfb2kVjilb1o/e9C7UuWceLZZhG8Gl8auBOWrydOBwtF+sZyzU0P5WaHdclbqVXhA== 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=ljSkeaF57yEZJ3TbWPPlqwbQ+hkuEjey0T+ZaR4os28=; b=TbQOI1A1ZRkQZImswYjdB3YMW4bcKwWsn2hLulLvzKAWdQM2tf9cie//Pbl7Qe7s8DqPIs1ksVoNnNkFIC9LGzWbSu0czjT5sbbyhORa+QrvaKLP5JyXvdzde4dmj73PpDBGsevuXNaSMCfuQI1EOdSBZCXR3YPeeVIISKENj4t2vIbi4GEA6y2xIqajG1gjHiKFzEjSPGh46lfOCacM5GDCYiBtONCC5SCzyKnHoQgukT0c9lRXwvLjjxHJfDz0FhXujtj04chBubXpTzkPoo95RxYLgMd7VHx0FDY/PkuDz8bm4HpfXJA91rvl6lLBerwpJYYf9nR2nlEKQYfXmg== 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=ljSkeaF57yEZJ3TbWPPlqwbQ+hkuEjey0T+ZaR4os28=; b=X5lhHFwW4npzyysJb+laWd7+TT07JiydiI3FCcXIXPof3sYoqeVoJjeqwL5KMAQ5iRFTajL/QLLv/16QxPdy+5iQg6p1fFZEE6CnJQhw7vPt3yR+6Lb7KdWBPvOj2y9czWnFmaUe7ScUoaqkA/kB5gHIISQLgfsRdjFj4hWlun8= 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 BL3PR13MB5147.namprd13.prod.outlook.com (2603:10b6:208:33a::5) 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:18 +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:18 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 10/25] net/nfp: add the offload support of IPv6 VXLAN decap action Date: Tue, 18 Oct 2022 11:22:24 +0800 Message-Id: <1666063359-34283-11-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_|BL3PR13MB5147:EE_ X-MS-Office365-Filtering-Correlation-Id: a8c22b09-1610-4579-c457-08dab0b81a20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4aEuONO9vtr+62zla1fiuGAOdzE+ndyDYC/XYX+45REEIwjuoG208XK1AAUo/s9itlxprOuL2suyxQYpBwQze9n0bmKlscnoQfNvgKJBXi1TqPrx6bf+9HrHvux8tF4r4E9GPxyel8th3wEZanXpn8AzcZAl7PNjEucEMJyQ94aoBZmM5dd5RJ2mFmP6ZqCyhNCVK2cCPWPAsg3JjuzAGP9VqIlSI4G7jfnMhLOYhJr0DqX5n8m6e0yH/h3whlLFND5a6zl0Y6ydQrjOBKsZtJeaky0cq0ADIZPUq2OgXa2EYfzDXq6gGQa3bVoy85C/tjJbp5XnWt84RffiDPfhV6qTBsD7I4r5otqbFUJtVwaF5i2hHf7mQ4AalOKRHSAPSijORf2eBnPJ8RHvc/kjZzBL0ZP8GYEsybvmjLv1QUHOVnObUX7x4OrCO1VEiqGOoPtUqgg1IrgZ9toO8RhrSo4Op4Epv7Nr7ssWZmXzGPZfwKYyj72aAIE5jshmmOcU2T22UQtrdzK2EDZm6UaMajUiIPNkEoS51hgXq2M59v+5bJcZY20teEylCdFFJe/8P6kkNbBatgAsk0NHMMR1ccYg8oGySW/X5ro8OTbTfjuh8zJjdWNqLdeyVrMcpk1b7GNzB/u2bPLKtPjkhj2VBz7YDR0S87gxjWTIGklpkG1Aq+feXY/z7AeNx1Kl6g6pnUuSJ1yyd0Nk0qATYyJMYs/wShNlCZFk/VyQbUYpkH/pvhz3SHvLbygWRHcBlLd9w7os2PgriRI6rBfjBQXuNA== 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)(39840400004)(396003)(376002)(451199015)(36756003)(4326008)(66946007)(6916009)(316002)(5660300002)(66476007)(66556008)(38100700002)(38350700002)(86362001)(107886003)(6666004)(6486002)(478600001)(26005)(6512007)(6506007)(52116002)(41300700001)(8936002)(2906002)(44832011)(8676002)(83380400001)(186003)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TmZFVWx5cEZJNk5CekttRjJEOUZNbC9LNkJGUFg3YW9zNzc5QXFwL2RyR0xX?= =?utf-8?B?SUk0TTlQSGpPYzBmWU1jSE9nRDBXRWtkOXMyalB4MWNLY01kMzhsT0tSRHQr?= =?utf-8?B?YzIvd24zWkZvQVdveGNVZTAwZ1cramwxOU1mMzdra1cvdjFqb244eGszRTZI?= =?utf-8?B?L2ZibVFDcC9SSld2Vlg0Ny82cjNDaTZnUS9iemQzUWd3WWQva3lMcXFxQ1Nl?= =?utf-8?B?MDVWTlg3KzZlZDBVN2V4cjBxMGxxeEVqOVFkd2c1ZGo1UGpLSitwUCtvSnZW?= =?utf-8?B?andMV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Q2N4WG1EWndVK28wN3Za?= =?utf-8?B?WVFhcW5hT3c4R0VEQkJlNWlIbyttZThSUUp5dnNVTUNCby8xaEdoODQrcW1U?= =?utf-8?B?Tmc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8c22b09-1610-4579-c457-08dab0b81a20 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:18.8154 (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: ayqWftS48vIFGNJqQbDu0/+JL4nQ6br7qvnYHiN7suFk4r63MgT8loNPa4fErYem/gliWR/DUpSaHLEf2BzyV7QttAxEnlSVaDa2o6Vyw0g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR13MB5147 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 decap action for IPv6 VXLAN tunnel. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/rel_notes/release_22_11.rst | 2 +- drivers/net/nfp/nfp_flow.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 351fb02..49e92cc 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -184,7 +184,7 @@ New Features * Set the port number * Set the TTL * Set the DSCP of IPv4 and IPv6 - * Encap of VXLAN tunnel + * Encap and decap of VXLAN tunnel * **Updated NXP dpaa2 driver.** diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 0578679..e212e96 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -487,7 +487,7 @@ struct nfp_pre_tun_entry { return 0; } -__rte_unused static int +static int nfp_tun_add_ipv6_off(struct nfp_app_fw_flower *app_fw_flower, uint8_t ipv6[]) { @@ -1370,6 +1370,8 @@ struct nfp_pre_tun_entry { NFP_FLOWER_LAYER2_TUN_IPV6)) { tun6 = (struct nfp_flower_ipv6_udp_tun *)*mbuf_off; tun6->tun_id = hdr->vx_vni; + if (!is_mask) + ret = nfp_tun_add_ipv6_off(app_fw_flower, tun6->ipv6.ipv6_dst); } else { tun4 = (struct nfp_flower_ipv4_udp_tun *)*mbuf_off; tun4->tun_id = hdr->vx_vni; @@ -2181,7 +2183,7 @@ struct nfp_pre_tun_entry { return nfp_flower_cmsg_tun_neigh_v6_rule(app_fw_flower, &payload); } -__rte_unused static int +static int nfp_flower_add_tun_neigh_v6_decap(struct nfp_app_fw_flower *app_fw_flower, struct rte_flow *nfp_flow) { @@ -2595,7 +2597,7 @@ struct nfp_pre_tun_entry { static int nfp_flow_action_tunnel_decap(struct nfp_flower_representor *repr, - __rte_unused const struct rte_flow_action *action, + const struct rte_flow_action *action, struct nfp_fl_rule_metadata *nfp_flow_meta, struct rte_flow *nfp_flow) { @@ -2613,6 +2615,8 @@ struct nfp_pre_tun_entry { nfp_mac_idx = (nfp_mac_idx << 8) | NFP_FLOWER_CMSG_PORT_TYPE_OTHER_PORT | NFP_TUN_PRE_TUN_IDX_BIT; + if (action->conf != NULL) + nfp_mac_idx |= NFP_TUN_PRE_TUN_IPV6_BIT; app_fw_flower = repr->app_fw_flower; ret = nfp_flower_cmsg_tun_mac_rule(app_fw_flower, &repr->mac_addr, @@ -2633,7 +2637,7 @@ struct nfp_pre_tun_entry { if (meta_tci->nfp_flow_key_layer & NFP_FLOWER_LAYER_IPV4) return nfp_flower_add_tun_neigh_v4_decap(app_fw_flower, nfp_flow); else - return -ENOTSUP; + return nfp_flower_add_tun_neigh_v6_decap(app_fw_flower, nfp_flow); } static int @@ -2827,6 +2831,8 @@ struct nfp_pre_tun_entry { } nfp_flow->type = NFP_FLOW_DECAP; nfp_flow->install_flag = false; + if (action->conf != NULL) + nfp_flow->tun.payload.v6_flag = 1; break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); @@ -3277,6 +3283,9 @@ struct nfp_pre_tun_entry { return -ENOMEM; } + if (tunnel->is_ipv6) + nfp_action->conf = (void *)~0; + switch (tunnel->type) { case RTE_FLOW_ITEM_TYPE_VXLAN: nfp_action->type = RTE_FLOW_ACTION_TYPE_VXLAN_DECAP; @@ -3304,6 +3313,7 @@ struct nfp_pre_tun_entry { for (i = 0; i < num_of_actions; i++) { nfp_action = &pmd_actions[i]; + nfp_action->conf = NULL; rte_free(nfp_action); } -- 1.8.3.1