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 A82C9A0560; Tue, 18 Oct 2022 05:25:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB4314114E; Tue, 18 Oct 2022 05:23:47 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2115.outbound.protection.outlook.com [40.107.100.115]) by mails.dpdk.org (Postfix) with ESMTP id E73E9410E8 for ; Tue, 18 Oct 2022 05:23:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tu5YEvX/1RBQUFehqXsNbGNS/PDpWdFSCURHMxjLjPzZNG9Y01m2NCvIOJFTHT6wcgUsXrZ02RniJktiVrcLQ8W3CWhJ4ySaNiXC0rCKxViqhtvvzwL0S4GaN//wxRKEe0rrAraXEK4rhslVsv3+RZjVWPfqcC0lXKTgpD611TGJUZyFN42/+Q1+2hlklTRoN2cWEz6/PcW76sskW+CPzYgzP5OG6Dlbp+e2t808bxdoWoWsN2G9HPH0AFf+s9eCj5XaBNoG6IvU6t3IoRWD6lhB/qOC1ZnHPzez8MbcBXAvmbNYBl0EBhnpl6G8UGVclyllWtYWoNUV7DG5btKlOA== 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=rJ1WEA3ld1+BHWTjfHLmvduQgYD+L83T+QcreXPJEy8=; b=cSpTwLIfmnrxkYDO3qw6jDHKMQEBc9o8a292TGJruxfrHl1xBBWnCeba3I+urnI6+eaTeHdikJq7xOt/6WTt2Cvd99kLreNLO+ulhWd6eP/TJOwDAheWxjOTdDvsS/mvPtTdCTwDTMUhuxTodpJGxkBfdH8hEe3EoolNpPSK3larteRFxboTASxEbd9MIZk7X0g48ONeqMfk+RjT1wLn4QdSxT98lvSWf9wbQwIEqq3iAGpDKGWjUmysqV2fBkmVPZYLk3vY9tuqTTomDSoo2WBWHhJkVVVxqcTxx4rHqFz+FpCp9V7HC+4RSJgSUAtilJH9i3ThR156D77dZ9R16g== 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=rJ1WEA3ld1+BHWTjfHLmvduQgYD+L83T+QcreXPJEy8=; b=opQP/Bwgg4BGA1MkNVvi04tr30QoSHDzJST9UGXWxrq53fqZOq7uSQ5edH+w5iATz4TRVbF3Dxx/YZCkjGWqyEeskNAGF/Y8kNWqyN68XKTRZHzv3dVSJtDa4DowiYdxxd3k6Wpry8poYRhR1QaQAV9Xnf2ro1cMp3rcxidSMUo= 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 MW3PR13MB4122.namprd13.prod.outlook.com (2603:10b6:303:5a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.8; Tue, 18 Oct 2022 03:23:45 +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:45 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 23/25] net/nfp: add the offload support of IPv4 NVGRE decap action Date: Tue, 18 Oct 2022 11:22:37 +0800 Message-Id: <1666063359-34283-24-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_|MW3PR13MB4122:EE_ X-MS-Office365-Filtering-Correlation-Id: d2f3f804-7563-4848-1c45-08dab0b829d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s8gRI1VYh9WkqkgdwHLIGbtIE6EvRDEAqwRH3PiZe0ypechWy8LnSsFJfEtcEWxZoLmys5MwXCUyAdKUanUSl8eWbl2ZKGBal6V3Hs0DUJ9eohiZkfBsIoYp2JfPjEatit41RTFseGN1BxRNOR3EaIaGzHz0Bz0zu2mqSvNzCzDjnuDfkfawHu5a6gKREE3AfVLO8NA+PYu7x+vtxdAl2QK9yuMVTuAJHdwK28S348KePhU2SKo1g0L5jkpbIVpYiX1gQCUml512pZSa0zxU9HsPnPwPkBLys2Kje2j/ZIqNSm6jU7ySrZuBmgkxSy8YwM2CYJaONkxzBEUHka8wDe6q4lM1FHBoUDZBOtaHCvCDFyg9cZqU24AZur+ywRNQNXoq0vkAhE2wmuUQZAcR7Fe7uMp4xfPqfQ3UbpEyegAlKiaYrvmRBbytMimE73jjeQ/UKiXjULeEVL889Kys1nOxrFvw/P7c2KSRDam31WKbqTB0G093KYE4VUdNZaTACFppJ+OnW9wah8Nn/bm8m+6JN5WagWveGwTzpotG5tgHCMcT6ArUOSyMCdWDKVLKcLqGI8wdq+mHRWUX3SrBH/iztAe7+UIfbLeZOCGCbeZe+Afs5EIUNcODn81Ft+9wpBtKIZdXsH0fXRK2SgUADAXTdqtpkqXpP8Pl+IbF8WGo0iFwQFtNCXBFvsL/xIJ1IdrEeRCIenOofL8uN8svFSrehCO7M+X1pqzdolqrluX49lg28mlxjxbHPe/0GtmZQLpaZaDRSlEOKqjxlBAoqvxNECEoUFnHzq4LvQx23/vLBEB94vN76vnuObcnMI0J 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)(346002)(366004)(376002)(39840400004)(396003)(451199015)(38100700002)(86362001)(38350700002)(4326008)(8676002)(66556008)(66476007)(66946007)(316002)(6916009)(5660300002)(44832011)(41300700001)(8936002)(2616005)(186003)(2906002)(83380400001)(107886003)(6666004)(6486002)(478600001)(6512007)(52116002)(6506007)(26005)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MFRPTzEzYk43OFAxdDBSeHF2aTd5SEF0Z2V1MFVGZ1VKV01YZFJQR2tyUDZN?= =?utf-8?B?ZXp2bXhHeTdtZW1VQUthYkhubVJCMUorRG9sa0tpYzB0YlExOVo3SHlxNDBI?= =?utf-8?B?RVI4bDhqakZBSWppaUJEOWVlSi80bi8vN2xoN2diOHp0aldxaXVkc2RrWG5r?= =?utf-8?B?MGh5c2Nza0xUUlBqaWNMeHYwRXRUSUFXWTBuMXBSb2M5RUJjNUM4VTM2ZDFt?= =?utf-8?B?bXpDckQvdnovb25DM1kyeWRjWldFSk4zcjFadk5SK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VVpld3NPelZqc1Z6N3g4UTRnQm9OV05OMzhKM2xrTC9iSlpoaXBOVStpU2Ew?= =?utf-8?B?bHMrQWhXeC9KWHZ6aitMTzNCSFFiUTZBL0dqWGczdDlHdmFFdG81SnVJVnF3?= =?utf-8?B?amc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2f3f804-7563-4848-1c45-08dab0b829d7 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:45.2530 (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: ityFQkYbTPMTc1qTdjfocqBgjIXfdF8EvM0HfHgh4AijQnp5D36n+p3Xa15t8Oqe0o2rmhEJfgAXblqAETtOtnH+0AnCx8SaS4IUHXrDQNM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB4122 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 4c6d2d5..9f7a680 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -45,6 +45,7 @@ vxlan = Y count = Y dec_ttl = 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 9464211..514e221 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -1627,7 +1627,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, @@ -1635,6 +1635,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; @@ -1664,6 +1665,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: @@ -1673,7 +1676,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; @@ -3835,6 +3838,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