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 BF0A2A0543; Tue, 25 Oct 2022 10:03:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28E6942C4E; Tue, 25 Oct 2022 10:00:43 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2101.outbound.protection.outlook.com [40.107.237.101]) by mails.dpdk.org (Postfix) with ESMTP id 42A4740A89 for ; Tue, 25 Oct 2022 10:00:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iTY3aDA1KbAiH3ZhPzpm7Lm0/u3yCguTP3jeSLSCMiOxHO+T/iZMdCRrhKmrL6bdeIcs5qck31mX+SkfaDG1WGkToBrJ+jeLs3+nPQFI97bbYfNdHMSByXtKEQNF5qsv7w9/v3V5MkHJ3jKSMnSBbAVAV4DyZ8mB70sAqpcvLemFsQNdAMeH8owHOEuFNt1KNcT1Diown5pCn5xSTikd6EFBJoiz9qYbzx3U/7qSZb6xyUcOnJNVO0ym9Rfp9UcoaP962l79QpoFe4hGCvnUHB3WWIVLicFGhoSYiRG+d4S9mFRZctWUCyyHWnzqufSsTZR1p6l1EIlF3VGokeKXLg== 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=txU6/h6aGkaChtTUJRmrQfuCJhPP4ghJeEcPMFhMvhU=; b=U+Ec6gbkfgPu3Ss5N224dDmwtdlugYoEV0Se091o4BRGN+BjVsTQC5EZ+LiNUPOUG+wvCPUvXcVYK0JwlRMeWigacmyMn4dk4Sb0YjL8LpIcipjijNznVgKdF1hn2S0gW/8Js5rRdHQUVC2ONHybVpzoAgWoImrpO+94kdiBNReRmOOjZsGlO+QLPfq2jltEhHCKQFfUAPlUJC4CfxE5WWgrfy3fBRGYf5v5VCQaek6fgUKrpx+JzMcwFfKEJ68d/INZuDH1aFMlLhn2fi+nRqP3ALr2JMKnAvigXQcvwrbObsvrA9Sk1p2dUzbUkZaatnjyU/GZHBmSPIyaACmHnw== 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=txU6/h6aGkaChtTUJRmrQfuCJhPP4ghJeEcPMFhMvhU=; b=Wm3JcT/g2mHG+dTiYubp6DlUEMpeBMdlJOuydVsh9AY5WzL8TR+3Pjx4yDf2PNgw7ckvVlJRfFt8Ot33uIIQsmMZQ5rQSIRLJc08xebqsvCxIAAmFyCTnpeuZLBzPUJ5gTCVW0MZpdPDrN1aHsFZBryPdSRYNFX4r/rbBG9fYqg= 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 BLAPR13MB4739.namprd13.prod.outlook.com (2603:10b6:208:306::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.25; Tue, 25 Oct 2022 08:00:35 +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:34 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v3 21/26] net/nfp: prepare for IPv6 GRE tunnel decap flow action Date: Tue, 25 Oct 2022 15:59:13 +0800 Message-Id: <20221025075918.7778-22-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_|BLAPR13MB4739:EE_ X-MS-Office365-Filtering-Correlation-Id: f5d8c4c9-bb81-4926-fc01-08dab65efeb6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wf4dtbMD1BG3SrU2Rj07j5zKpebv+L011hVYyQtWtYdUO/VoHBcH66K/bfLGJNgaXRmzoEJ09/H/bpUa4dvekipWthNPLiv1rMBjwpUCZzMZLwBYQ8PHXkdqmr0ZYW4hXH+p3vLQGpTKUJ3ywxawdixUKgHpx2et8JLFBvMJo4jZLAUk9HzVAiS0RLmw1M6tlnyqWMS926WVLIDSFS0xPJT21BZjs4v0EJDOxyGf1PeM/mj8Dfa8bSz/WfAgfVlaWERv2L6B5JS7WaEKm5qj8On1IG/lk4RTSkwVgn169FyU0LVXotfw9vZpPtJRCycVe61E8Sv/n+cvwlihpg9OVxxMZTFx4a+xLz8dt1elccovPTlAqUfRWGxrOx/z2n1VKrAlwVi98LARAVILULO7CbJ2Va0fhnoTmWoz94NQcB5aGovFUcrdDjmgA6rWSsWUd5jjhioGT3EcNNKdNThz78Sz61gvSM88aWKOXKP0mJ1YfgWKmQjGUCLbQp5JPeXrLeQaVH41lbu1VU9dSXeWhaoXw05uhODz248drITYWCr/uX2W8HYtJE7bxBf+TCy4NeN1bdxyLBjR4MftCJzSm1wT9jY27XTpGsJDWF+sSxQqqZvgNRhlrHu4uHBjK9IYbVCV/KFobEWsf8nedkEA1ciIbd3MDBAfkE9HpxNpc7CdYbruWGccmTj5zGvPCgE5T/o6UB41x3nMC7LOdtXFhIlfey0BpwCOEBckS07/vPAQ1+KvdnXakMleesod2gD3dC6s3stK4jEugLhlZdSCdg== 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)(376002)(366004)(396003)(136003)(39850400004)(346002)(451199015)(36756003)(38350700002)(86362001)(38100700002)(41300700001)(83380400001)(66946007)(1076003)(2906002)(6512007)(6666004)(26005)(186003)(6916009)(6506007)(52116002)(107886003)(478600001)(44832011)(66556008)(5660300002)(8936002)(2616005)(6486002)(8676002)(316002)(66476007)(4326008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bUtRN2hIL3BWVnpSUlVqZ3BFT2NVVTNnQk1zQk5XU1k3QW4vMCsrb0NnVjRO?= =?utf-8?B?KzM5cWVkbURTUzhQS3dJcndQMmplT1pyL1Rid2pGUkVNZEdBQUlXRlVCU2Ry?= =?utf-8?B?QjNHdmtxMjhnbVpwbjUzR2IrOFlnUzRyK3hDcHRpZEpnRFR4Nlo4K3NnRkJl?= =?utf-8?B?RG9JZXZkM3ZqY2pTODZMN0k5d3pOdlRGVVp6d0JnWXFvTG43UFc0WmRCekFP?= =?utf-8?B?K2Rralk5NkhSYTFTdDVqd0xzcWJobC9wQkx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=?utf-8?B?cHNLRWlocGVzak9hdjVCMC8xeUtxOWxLQzVCS2J1S05DR3B3cDA4Mk04RGlZ?= =?utf-8?B?dE0xV3BkN2QrM2crdnIvL0dyLzdzbEU2SDZBMTh5MTgrYXNZZlpqcXVzakJr?= =?utf-8?B?V0E9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5d8c4c9-bb81-4926-fc01-08dab65efeb6 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:34.4807 (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: vldaytNty5sKfms0otlnU4wc2y1oHr1diekguHpUqR+WYDO0f0Yim9VR9KYOJJS93ObDSdYVdd/Q9TuQz6wnCfSR7Zzp4IFSt0jLLaLvo78= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR13MB4739 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 related data structure and logics, prepare for the decap action of IPv6 GRE tunnel. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/flower/nfp_flower_cmsg.h | 41 ++++++++++++++++++++ drivers/net/nfp/nfp_flow.c | 49 ++++++++++++++++++------ 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 8bca7c2fa2..a48da67222 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -604,6 +604,47 @@ struct nfp_flower_ipv4_gre_tun { rte_be32_t reserved2; }; +/* + * Flow Frame GRE TUNNEL V6 --> Tunnel details (12W/48B) + * ----------------------------------------------------------------- + * 3 2 1 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_src, 31 - 0 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_src, 63 - 32 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_src, 95 - 64 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_src, 127 - 96 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_dst, 31 - 0 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_dst, 63 - 32 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_dst, 95 - 64 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ipv6_addr_dst, 127 - 96 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | tun_flags | tos | ttl | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Reserved | Ethertype | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Key | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Reserved | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +struct nfp_flower_ipv6_gre_tun { + struct nfp_flower_tun_ipv6 ipv6; + rte_be16_t tun_flags; + struct nfp_flower_tun_ip_ext ip_ext; + rte_be16_t reserved1; + rte_be16_t ethertype; + rte_be32_t tun_key; + rte_be32_t reserved2; +}; + struct nfp_fl_act_head { uint8_t jump_id; uint8_t len_lw; diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 115b9cbb92..0353eed499 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -565,6 +565,7 @@ nfp_tun_check_ip_off_del(struct nfp_flower_representor *repr, struct nfp_flower_ipv4_udp_tun *udp4; struct nfp_flower_ipv6_udp_tun *udp6; struct nfp_flower_ipv4_gre_tun *gre4; + struct nfp_flower_ipv6_gre_tun *gre6; struct nfp_flower_meta_tci *meta_tci; struct nfp_flower_ext_meta *ext_meta = NULL; @@ -576,9 +577,15 @@ nfp_tun_check_ip_off_del(struct nfp_flower_representor *repr, key_layer2 = rte_be_to_cpu_32(ext_meta->nfp_flow_key_layer2); if (key_layer2 & NFP_FLOWER_LAYER2_TUN_IPV6) { - udp6 = (struct nfp_flower_ipv6_udp_tun *)(nfp_flow->payload.mask_data - - sizeof(struct nfp_flower_ipv6_udp_tun)); - ret = nfp_tun_del_ipv6_off(repr->app_fw_flower, udp6->ipv6.ipv6_dst); + if (key_layer2 & NFP_FLOWER_LAYER2_GRE) { + gre6 = (struct nfp_flower_ipv6_gre_tun *)(nfp_flow->payload.mask_data - + sizeof(struct nfp_flower_ipv6_gre_tun)); + ret = nfp_tun_del_ipv6_off(repr->app_fw_flower, gre6->ipv6.ipv6_dst); + } else { + udp6 = (struct nfp_flower_ipv6_udp_tun *)(nfp_flow->payload.mask_data - + sizeof(struct nfp_flower_ipv6_udp_tun)); + ret = nfp_tun_del_ipv6_off(repr->app_fw_flower, udp6->ipv6.ipv6_dst); + } } else { if (key_layer2 & NFP_FLOWER_LAYER2_GRE) { gre4 = (struct nfp_flower_ipv4_gre_tun *)(nfp_flow->payload.mask_data - @@ -1186,11 +1193,15 @@ nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower, struct nfp_flower_meta_tci *meta_tci; const struct rte_flow_item_ipv6 *spec; const struct rte_flow_item_ipv6 *mask; + struct nfp_flower_ext_meta *ext_meta = NULL; struct nfp_flower_ipv6_udp_tun *ipv6_udp_tun; + struct nfp_flower_ipv6_gre_tun *ipv6_gre_tun; spec = item->spec; mask = item->mask ? item->mask : proc->mask_default; meta_tci = (struct nfp_flower_meta_tci *)nfp_flow->payload.unmasked_data; + if (meta_tci->nfp_flow_key_layer & NFP_FLOWER_LAYER_EXT_META) + ext_meta = (struct nfp_flower_ext_meta *)(meta_tci + 1); if (is_outer_layer && nfp_flow_is_tunnel(nfp_flow)) { if (spec == NULL) { @@ -1199,15 +1210,29 @@ nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower, } hdr = is_mask ? &mask->hdr : &spec->hdr; - ipv6_udp_tun = (struct nfp_flower_ipv6_udp_tun *)*mbuf_off; - - ipv6_udp_tun->ip_ext.tos = (hdr->vtc_flow & - RTE_IPV6_HDR_TC_MASK) >> RTE_IPV6_HDR_TC_SHIFT; - ipv6_udp_tun->ip_ext.ttl = hdr->hop_limits; - memcpy(ipv6_udp_tun->ipv6.ipv6_src, hdr->src_addr, - sizeof(ipv6_udp_tun->ipv6.ipv6_src)); - memcpy(ipv6_udp_tun->ipv6.ipv6_dst, hdr->dst_addr, - sizeof(ipv6_udp_tun->ipv6.ipv6_dst)); + + if (ext_meta && (rte_be_to_cpu_32(ext_meta->nfp_flow_key_layer2) & + NFP_FLOWER_LAYER2_GRE)) { + ipv6_gre_tun = (struct nfp_flower_ipv6_gre_tun *)*mbuf_off; + + ipv6_gre_tun->ip_ext.tos = (hdr->vtc_flow & + RTE_IPV6_HDR_TC_MASK) >> RTE_IPV6_HDR_TC_SHIFT; + ipv6_gre_tun->ip_ext.ttl = hdr->hop_limits; + memcpy(ipv6_gre_tun->ipv6.ipv6_src, hdr->src_addr, + sizeof(ipv6_gre_tun->ipv6.ipv6_src)); + memcpy(ipv6_gre_tun->ipv6.ipv6_dst, hdr->dst_addr, + sizeof(ipv6_gre_tun->ipv6.ipv6_dst)); + } else { + ipv6_udp_tun = (struct nfp_flower_ipv6_udp_tun *)*mbuf_off; + + ipv6_udp_tun->ip_ext.tos = (hdr->vtc_flow & + RTE_IPV6_HDR_TC_MASK) >> RTE_IPV6_HDR_TC_SHIFT; + ipv6_udp_tun->ip_ext.ttl = hdr->hop_limits; + memcpy(ipv6_udp_tun->ipv6.ipv6_src, hdr->src_addr, + sizeof(ipv6_udp_tun->ipv6.ipv6_src)); + memcpy(ipv6_udp_tun->ipv6.ipv6_dst, hdr->dst_addr, + sizeof(ipv6_udp_tun->ipv6.ipv6_dst)); + } } else { if (spec == NULL) { PMD_DRV_LOG(DEBUG, "nfp flow merge ipv6: no item->spec!"); -- 2.29.3