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 02AD3A0032; Sat, 22 Oct 2022 10:27:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D9CD42BB6; Sat, 22 Oct 2022 10:25:46 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2107.outbound.protection.outlook.com [40.107.95.107]) by mails.dpdk.org (Postfix) with ESMTP id ADC3042B8A for ; Sat, 22 Oct 2022 10:25:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mq34IYTnCUmxYGD19oEOQeGSupLYilfseEqhnSmUDFsrJg4ESUJhD9QB6BKyp9S2gHeskCmDB3/eGfjxVipxwuF1C+OpK0rvUAIbZ/tUOLNuRE5NkRPd1U4dzwOE0w4yUq/+9odycDeXUVep2GaTs96yE5yBO09CMfzOwK36VgjK4OXD44CHTNIFA5B66iM5pFodDy82lH9bab5F4FEexcVmRlry868vdRivwDSRbqDB1S1+Pn8hJdw3H/EcNgQrPBYlABIWTrIL/3lkhXEITu9a+YttCkfu5uG+t2mVbIcGJO7lvM7mDJr/zqmkaqYiQ5M7vCPZnJtT5D19DzHR4Q== 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=Dae+4/ViEfT3KPrUVhkKbMClYgiMtLPhNdwa41bvVtY=; b=YTE323h5OWN35WcEff9H0APM02s20UJj0sbfdvljAUdQCPMEAiLdsiuR7vauW9i+BY0vDHlr9CjHjnXk239j3k2iJancfzNiutM1uRAdDaBDrw2xgLiQG6jGYdsPS+cuugXNYEi4HxSZ1a9wnVFsW3wArkmx7WV3KPW91qCRCg93TPn1jtN20O8CQnr4CqHmJ+TQsFOL3vW/F0xt/8/i8Hwt2kzMgE3Aa5LyBoJTWRctSIIdumDaFQfVN9IFIQEmXOldqBTMLvj9ulAJzV0lQwpChALlqqie9xMuusRejsahfyA7hz24UmffHbgFwpmtibFWC6KRLyKiEGAWZCOgKQ== 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=Dae+4/ViEfT3KPrUVhkKbMClYgiMtLPhNdwa41bvVtY=; b=Ci8Zs0TKyymmMVngw0rbdA9U4wGqtb5fhKy1kJCltKsO5L3XrAc+b+Qxw6tk6FSroxfcmvDFd0NhdxIrwUni02SM/N3ZT50vos/iKVW9a7JJz81+274XzFZcffmel940c6axqWpfJs2q9QmiJ8HUWW+/MXM2cRd1wny7VGgl+xY= 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 CH2PR13MB3848.namprd13.prod.outlook.com (2603:10b6:610:9d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Sat, 22 Oct 2022 08:25:37 +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:25:37 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 23/25] net/nfp: support IPv4 NVGRE decap flow action Date: Sat, 22 Oct 2022 16:24:27 +0800 Message-Id: <1666427069-10553-24-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_|CH2PR13MB3848:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ab98755-044d-413b-32a1-08dab406ff29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LUXKq5s18fUoz5PcFLueEDpmVejEYPNH446Szrhdn17PWBkGdz84vYmkgHJCosNfaQ2YQTmWqF5YK+ni23veZDY+mDxTDSFLE/J7cW/0OGDO4u/chFna2DXiSIih1LnqE+yde0rkGJfGtPgoFnJJMnWA9MmL0zNCq6Erk/PuF6G0ADsqhGynuzGqzV2D4nYWmbtAjD4DdFvBwH/Sopq498G5rhqn1PfL5IHFFJrCW1XKGjmygGuMj/DftgjC55EjAaiPO8LPFYvgcRccldN6x8bQ5EOcTMInEz0z25WkaPMqTYdhcrg5qNFx0xdVOIv4AOCYqZTDaFC4QeGl5oJX+zRmjQFTO8GRvQPYD63UG1q7oAgZJoSHPnmsCSZx/vvEWVEBfzOT3g/zzOSpr1ELi0j0MgagYkiPtHS2J2LfRqEHUAJZuS4MvGCt9v33Z8OBrigbTLEMbifb1lY3ABxKTYIkRefVAwoFCWSqMfRO3T2q+voMR11/53JCftpvlcZ7ORqKRrniKY9islNPL6qofnOD7hROecdlSqvFBfG3T/gcFJJ/ik+OnG2JWWhrTQUoIPVJ91HqzogwZ4LrHwTqZ9rdGiSAeGaSIw1GwHal/afnh4V1UmGHAwEZQl7nMMPWWqJa0xe6gvwTYL2RuT1x6O8f4Qlw9bJfDmrAkDZkSRqfad3IUZIi6ukYkTpp1Ca5vqCgyVrK3Xr+ijIFUg0y1qiOZw8WRdM8Vm7GfonWYVcZIMuA6AqVzDl/WhP7eIGhfhy4NIKBwYqJ1DiPzIhuag== 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)(396003)(39830400003)(346002)(376002)(451199015)(4326008)(107886003)(36756003)(38100700002)(66946007)(66556008)(316002)(6512007)(83380400001)(52116002)(66476007)(8676002)(44832011)(6666004)(6506007)(38350700002)(5660300002)(8936002)(6916009)(2616005)(478600001)(186003)(41300700001)(26005)(6486002)(86362001)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aXBHSG5zNW56Tjc4Ti9BZDM0NlNEL3B1aGNzVXdoam91UkpRT1luZWFOc2E2?= =?utf-8?B?S3JkWk9qaXdJTnR6THFSNzJ1NTd0RXJxN3BWNVNLWWhBR2Q5ckxKOEhlazhJ?= =?utf-8?B?bzhkekZDZTV6eldhNG53WEtHdFhVYVdWUWZDWTRGZXVvc1ZWNDhhM0J2MzJj?= =?utf-8?B?VmwzcUpBY1hqWm1qL2ZnNmlKL0htYlFnQTdKSDRFM0o0MWVQa2ZzeFJaTHpD?= =?utf-8?B?ZE4zY0Vwd2luQ1E1SzBTeW1EeHlzZVJpemVnVjhaaldnU1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UlVxQVF2WGFCd1Y2clExbDNpZ2hDbzVzMUpnbUlhM3B1Zk5K?= =?utf-8?B?eFlwWmF6SjNtY3dQTlpkUDhRNWVhMFcyc2dEMXMxM0VScDE1QktwVEUyRGRp?= =?utf-8?B?REE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ab98755-044d-413b-32a1-08dab406ff29 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:25:37.2851 (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: gta7gmaDdpLQ2fPIAJzax5HXVZ1B2G3Gur4IwQfi4etQynLoIxLv3jhNxYBv2irYl78GO1n0C2q9wCNugQswLIur7v3EilokxbNTQprCwCM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR13MB3848 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 of IPv4 NVGRE tunnel. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_flow.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index 2acc809..6400a7c 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -43,6 +43,7 @@ vxlan = Y [rte_flow actions] count = Y drop = Y +nvgre_decap = Y nvgre_encap = Y of_pop_vlan = Y of_push_vlan = Y diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 6f21c86..c577278 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -1609,7 +1609,7 @@ struct nfp_pre_tun_entry { } static int -nfp_flow_merge_gre_key(__rte_unused struct nfp_app_fw_flower *app_fw_flower, +nfp_flow_merge_gre_key(struct nfp_app_fw_flower *app_fw_flower, struct rte_flow *nfp_flow, char **mbuf_off, const struct rte_flow_item *item, @@ -1617,6 +1617,7 @@ struct nfp_pre_tun_entry { bool is_mask, __rte_unused bool is_outer_layer) { + int ret = 0; rte_be32_t tun_key; const rte_be32_t *spec; const rte_be32_t *mask; @@ -1646,6 +1647,8 @@ struct nfp_pre_tun_entry { tun4 = (struct nfp_flower_ipv4_gre_tun *)*mbuf_off; tun4->tun_key = tun_key; tun4->tun_flags = rte_cpu_to_be_16(NFP_FL_GRE_FLAG_KEY); + if (!is_mask) + ret = nfp_tun_add_ipv4_off(app_fw_flower, tun4->ipv4.dst); } gre_key_end: @@ -1655,7 +1658,7 @@ struct nfp_pre_tun_entry { else *mbuf_off += sizeof(struct nfp_flower_ipv4_gre_tun); - return 0; + return ret; } const rte_be32_t nfp_flow_item_gre_key = 0xffffffff; @@ -3831,6 +3834,7 @@ struct nfp_pre_tun_entry { *num_of_actions = 1; break; case RTE_FLOW_ITEM_TYPE_GENEVE: + case RTE_FLOW_ITEM_TYPE_GRE: nfp_action->type = RTE_FLOW_ACTION_TYPE_RAW_DECAP; *pmd_actions = nfp_action; *num_of_actions = 1; -- 1.8.3.1