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 6923BA0560; Tue, 18 Oct 2022 05:24:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B63FA42BAF; Tue, 18 Oct 2022 05:23:32 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2119.outbound.protection.outlook.com [40.107.92.119]) by mails.dpdk.org (Postfix) with ESMTP id 34C1241148 for ; Tue, 18 Oct 2022 05:23:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nlISpC5c9c078vNKxRHTVvwDA/dkZ/EPMLVW75B4Lpf68wvZF2u/EY9MZ6r7eoxQJjefG3NIpcaOwZKKHsg279pNWVcXqmeqhaQ7aQO+PbO1PuRhYusUGhsMSdzIKJfCfH8m5cFGBX4gIwodxmYM1HA45GDRr/i7jc93IxCuCnbmAWuYBqqULaG3oySIuPRVv3qiUYtmcxhIwiQPEkcrwxS5rRpxXyb9xXOuEwDcHoftv3SvDPmVD8kK/L1OnpfhUj83CbHp/+PHpKJyX9/ekKiJeYosDP8cx4KwS80jWJEOcA5fMHin0HaSzDduZBaWH8f+/aeteMkKQCbZwsq8Iw== 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=pLrJ0UUE9u646wXPnFLmEyS801orNN8Is1vo1yMzkUk=; b=SmQ3TeoRJAcKRSYJJgZ7mVBknnXfmAw8etzNRgie8j+x03Gwgx2LPEtdEOEc3/3FqChJ4pH978WA4lgjVa9GIwp+pmytuy6w/BtTUIi2Wi+AWFgq/TLScjv1BGgtbB9oODeEaEyj1fCI/fOSW6FQgsPf0yqixdl+jYpJAR+EOBf+RF1CMsjamIkhFowLgxyZ9oiZkfWaIzKdwYxKYG0Wu1P14sxxXkfta8BOSB/wkOjI+AzHDBGC1SUL+Wp2SoSS4RttUl4ep8dGzYu7UdVlr17M1kYhcBSU3uPVvHv8tYL5IriTWXSaA/hsWrYn5fmqFnU966YnlT+4q7udxPDUqQ== 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=pLrJ0UUE9u646wXPnFLmEyS801orNN8Is1vo1yMzkUk=; b=ssuAPVMZTwr3s6LM3RGNNEQRSlG08QXKzxJvDtBtWGyzlzBFyF64gdxJUb41cfp19RNfohlEeLKx2HH418fTftV9W+AMbumrpycnDDOuMgkUX3IhgwH/JkXd//BM+clBtqoc5b3sa319y4c5fo6RyPbQpA8mnmbGZ+8qfqRr9Dk= 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:29 +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:28 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 15/25] net/nfp: add the offload support of IPv4 GENEVE decap action Date: Tue, 18 Oct 2022 11:22:29 +0800 Message-Id: <1666063359-34283-16-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: 391fea9d-79ab-49c1-cc3a-08dab0b82025 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JdIAfZ5hlUv+C1LP4XZfttUmgHl0pysAe5/UcPuo6vsaj0OFdLcH1X9YbXTxmRIUmiT8rtGZxsGahIuKXTGyt8SrDms7k58F51RxWmjaRgd8XnxaV1kfWGBjoTxz/r5i0BQtlKbtD/fG7VOSnf/HyT+KG8swJsIG9OXPIrL1rvT6fZdMd8JIV33aRuLLJAUzEGwPFUPBJC2tBN9MpPq+ORHtGILdpr1aI5I1bmym3g/F+dxRm7/EZwnJHiWEdqXjCpzEcoiLSg20Mujqf5oYDQ9CeAQFryndZf7N8yCFVQ8odNlopG16COjhWkSqLecTQPZZ8iVPlygM++lBA2CTAuKKv741JW+/B5r7LqafGap7S0ksSz/PBZyvCbpvMaztj5Z9A9HTxLrWT9kOmPzyHdB3MElBOOjsk2Z4FIkdTQhBMOI4XPZD4U2bKZTYQarN39zmkXPRg8Cn5j906rT3muvhpMJyN3iWiNeEN+bIB28MdCGs6iYV2s3N+87F0ufDpcVJniCNXwJVJwvff+8W2VZ4JBdC9UAD6GL+i43ug6tWuTDOuEeQNYbi4P8sw21PJ/40EYDMvFU1i+jgBQndEWSbxXKYcm7a+pGpAKsao+/OwBcgnfMLRFaQdGJM7dEacCArjI5KIwdlqvogzyeTsGH8MG4bS59JhHENsOSsBUQh5M8gs8pnISz39fIJ7MqSBEOws7OCYW9PnlswOqUkr18mh9zvV19UU7wn3Npf33aLexW8WjGHKOrkWUvpkGkzARn16H0oGLZbKsLAAh1Agg== 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)(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?SHNjVnExakdoL0hzcVNjZ3FYVzdnWklvQ203cGlVaUt5c0Jxb1V0bHY0VHh4?= =?utf-8?B?aGNxK0tWOWx6Z1V5VkRGbEwwTU1HR3ZXeksvalJxTzlVNEpyY09tOUFzbDBH?= =?utf-8?B?Y3duWjlGTkxadTcyT04yaXdjRE1XcmVidlpuK0hNbno2czJuQkNaYWVYRk4y?= =?utf-8?B?Qm9oTmVmWW4waXgyVlliREY5Zm9UaHBBQndmWHBpejBHVTVoSHh0T1M2alht?= =?utf-8?B?V0hWVlpqS2NSTnNKRWxaMnhJYkZLR0cwMC9SOTE5Nk96UjFyZHhBb2Z3Q1dH?= =?utf-8?B?eXJHaFhoVEJ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JXejFoYUthUUc2R2ZWVTVq?= =?utf-8?B?d1lmakNleVYycUxkc1FJdVVEQzhPOEdKQUtSemNMWkhVdHVabm0rNXl4UjBO?= =?utf-8?B?WlE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 391fea9d-79ab-49c1-cc3a-08dab0b82025 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:28.9134 (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: GAjYS8/Y3ZCMSEok5ta8do1XDgdIYRRVkOYQNJCfgACCzYMGk57bVvdQByHzuUUscnuBs6D9IXVVH0AY9MtRjwKe5QPGhUkPZO5yL2KqNUQ= 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 IPv4 GENEVE tunnel. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_flow.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index 4c0d1ab..7453109 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -47,6 +47,7 @@ of_pop_vlan = Y of_push_vlan = Y of_set_vlan_pcp = Y of_set_vlan_vid = Y +raw_decap = Y raw_encap = Y port_id = Y set_ipv4_dscp = Y diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 36dbf27..a8287a1 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -973,6 +973,9 @@ struct nfp_pre_tun_entry { case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_VXLAN_DECAP detected"); break; + case RTE_FLOW_ACTION_TYPE_RAW_DECAP: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_RAW_DECAP detected"); + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -1444,7 +1447,7 @@ struct nfp_pre_tun_entry { } static int -nfp_flow_merge_geneve(__rte_unused struct nfp_app_fw_flower *app_fw_flower, +nfp_flow_merge_geneve(struct nfp_app_fw_flower *app_fw_flower, struct rte_flow *nfp_flow, char **mbuf_off, const struct rte_flow_item *item, @@ -1452,6 +1455,7 @@ struct nfp_pre_tun_entry { bool is_mask, __rte_unused bool is_outer_layer) { + int ret = 0; struct nfp_flower_ipv4_udp_tun *tun4; struct nfp_flower_ipv6_udp_tun *tun6; struct nfp_flower_meta_tci *meta_tci; @@ -1482,6 +1486,8 @@ struct nfp_pre_tun_entry { tun4 = (struct nfp_flower_ipv4_udp_tun *)*mbuf_off; tun4->tun_id = rte_cpu_to_be_32((geneve->vni[0] << 16) | (geneve->vni[1] << 8) | (geneve->vni[2])); + if (!is_mask) + ret = nfp_tun_add_ipv4_off(app_fw_flower, tun4->ipv4.dst); } geneve_end: @@ -1492,7 +1498,7 @@ struct nfp_pre_tun_entry { *mbuf_off += sizeof(struct nfp_flower_ipv4_udp_tun); } - return 0; + return ret; } /* Graph of supported items and associated process function */ @@ -3080,6 +3086,7 @@ struct nfp_pre_tun_entry { nfp_flow->type = NFP_FLOW_ENCAP; break; case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: + case RTE_FLOW_ACTION_TYPE_RAW_DECAP: PMD_DRV_LOG(DEBUG, "process RTE_FLOW_ACTION_TYPE_TUNNEL_DECAP"); ret = nfp_flow_action_tunnel_decap(representor, action, nfp_flow_meta, nfp_flow); @@ -3550,6 +3557,11 @@ struct nfp_pre_tun_entry { *pmd_actions = nfp_action; *num_of_actions = 1; break; + case RTE_FLOW_ITEM_TYPE_GENEVE: + nfp_action->type = RTE_FLOW_ACTION_TYPE_RAW_DECAP; + *pmd_actions = nfp_action; + *num_of_actions = 1; + break; default: *pmd_actions = NULL; *num_of_actions = 0; -- 1.8.3.1