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 A67C3A0560; Tue, 18 Oct 2022 05:25:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BA4342BCE; Tue, 18 Oct 2022 05:23:42 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id 8A9D442BC5 for ; Tue, 18 Oct 2022 05:23:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UoL6OWlbSWWSn3Gz6J1Ra6mULt1fCLkBCnlWG346eQmkCe/L+naL/fpHkYS9JHQOCx4WDbkpbiuNOFPuR5qGXwTq2mn2C66Ie77jdduFmCLMtmgHUMeAzv1o9I5q9HezJhOVAhzxIr6xA1fRotrgHWGgyGU8jxiuz7icOatiHHG8r98+drekdN88kEqezRLl1aDRxdUpMgOGUafdMkZPjlUqAUh6nWOCUdqP8pN3yBq3pMP6J/NZhO4HiAbRRG/iSbpeX8NVm3bnYfvkyD97KpF+BCXvELIpfBdQiQvESGb/76YY8mNWlMj4LpaMivTT+gVnAAULByUes8O5KyodXw== 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=drWEPf0CKMOJmY6xENDBaY7oAxsdvydQrTsOw6v6pts=; b=PXxQ8PJpNFZmWkoEJLCkgVuMAH+HHDvdwwoyP5aw706N4iXrjKgS1GaPiNJ+ohoQ19el0OQHWMmsoM+DFILItNweBDPRmbmXooDyl9OSmEw3P18Vn9rqtDa7dhWafTUs+lASfE0c1xqrXCm5w3URsY3WvFs0+nTeQtWg13N9xjppMli/7x5pFV8Ns8yIIIz9h8uTvFPJkIvPU3REflP7gafteT1n6z0AX30fWFA1Q9uT4EGVQEoOcnE568nKynW/onaREb5eQiqycKvrgZzQMyjIVsh/xSr5g+3vvDc9UWHwWlbHII4dxr36mI+PEFhox+RUZc2Wb2eDgldRxOl9OA== 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=drWEPf0CKMOJmY6xENDBaY7oAxsdvydQrTsOw6v6pts=; b=GOkq2sm4pPe9UqpQIodLcIHjQ48ShDy9lWxWXYae9MWZEDMhzazvFmcD/hhvvw7tc47OqbeFpB3CI+lkbVAEoQWjARMjDnT/SzfS2JsDbJQMefsT5cX9Xvtfbfs6ZapaKTS9XCmEDBAmxTuyJSCy07zWuktUibkM3p2YcSyOhws= 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:39 +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:39 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 20/25] net/nfp: prepare for the decap action of IPv6 GRE tunnel Date: Tue, 18 Oct 2022 11:22:34 +0800 Message-Id: <1666063359-34283-21-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: fdc8f14c-2e41-4239-0069-08dab0b82636 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zLDvAozXrOgUDUc6Fyxpc1BVYtrPOaSLa/xopEsIfIpKw+ee94agJ/Z0Qm0T1LW27/ViukhnH7MNSvVTYP1a4oMUH6AYGI1JMYjZmStCGiSh+eiP8gzv3PgkxFsNeU9urcaOuG2ljjmCQjTUNz7o0mRprOOTH0lR4RuT/AsBPUe7RhlQ3V090P5t2y25BXM4b/dxEMbORuIlKUdzTT4CiU+LK2FCg36bxy0e2xqnaXGTTywLc1YrQ8lfjBJIlPvEgpqxI4uQ+ve4P4kk5ActXwcjHHKAQ0CFbuSj0gVs/QuKyznyeP1AcVqhsP8gcL7131T6fto1ZBoKVT2VQOQGZc2A97odjTrJedPZP/z0sen/F0HoDmg7wYXaOW8xPr67zBPX36qXThBztfT3U5QjQJf9HlbnLueLuxyrTaUsW4WzcEmm5Ri+lKARFrNRxL9pFmS5mF9j2fuBO4nTEhcNMPxR7PKJb1qT3wqg9ly34l2j19ptJWMdZPiRk9C01kRT3XREMaleCLLjPG10s2GslH55lBSp6nTExhtp728P8hiV7FvsezO4em4dns7WmPdIWC4OGAR7+hOy3e57hAGTSLv6NG5gmOutzSmPXMkqcK32bYC2OXktuXsLZ0wS+MQ1r7U20/357v50pMrW8liawhQ+6Gd4WxNQwOkeN+FoAZmzlN7UcDpUbdmvczsyNoTrQziEL0PPaDmkzxiaZn3vEv9lArklfZFDmtjPKp8Uf3MNh+7o5xvhSKsfoAGPAFUcGu1YD6CC6bOuY6Mz0mpFgw== 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?N1pCYzU5R3NkWWNHSDcvU0dtRVFoRHpFTHJFTHU2cjVrQUxNVlJZbnk5cHVk?= =?utf-8?B?QjdsUG0xY0pkbFJPKzNKTm1kb1R0dXEvOWVTWnN1VHh6bmZRMVhlM1p3Tmx4?= =?utf-8?B?cXpqaVdUeFhtWHRzWGlMTGRtUGZLUkpiYnJ2YS9IT3lxYjl5U0RQU3BTMXJN?= =?utf-8?B?RE4xb0cydjhjamVaL2JqVWJ4Z1Vtb05IZVo0RVRBdjh4eUo5R1kxa2QzQVd4?= =?utf-8?B?MTJUZEZFK2QrbnBtU3BOeUR6MW9MaGRiOUQwWGVXamJqalBvRTgxM01hanR2?= =?utf-8?B?K0p0WH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RGZFMmpSREFDckxVQUZsVXowVkc5?= =?utf-8?B?RWV1N2RhdWI1ZmlaSFhFbXE2V3FTZERHNWc4cVFrUjJWZlZzbWp1UzRaWXVi?= =?utf-8?B?WkE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdc8f14c-2e41-4239-0069-08dab0b82636 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:39.0702 (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: U52fqJM76HI5nQRRyMLqP3Da487Nrsxt757Nc2FNUUTxqClbFD85TLuuKE8VNkcs7/GafZXrfKIh+hDChZJ4G1mNTd382Qyx4DVsAZbh56I= 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 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 8bca7c2..a48da67 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 0c0e321..3f06657 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -576,6 +576,7 @@ struct nfp_pre_tun_entry { 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; @@ -587,9 +588,15 @@ struct nfp_pre_tun_entry { 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 - @@ -1204,11 +1211,15 @@ struct nfp_pre_tun_entry { 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) { @@ -1217,15 +1228,29 @@ struct nfp_pre_tun_entry { } 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!"); -- 1.8.3.1