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 1A7A9A0032; Sat, 22 Oct 2022 10:26:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCF0C4282F; Sat, 22 Oct 2022 10:25:28 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2126.outbound.protection.outlook.com [40.107.101.126]) by mails.dpdk.org (Postfix) with ESMTP id B42B84069B for ; Sat, 22 Oct 2022 10:25:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QQITGxLUB2ZuvZVXqff1B/XONbmAx2YYWIRks8bCFJorCfb1QpeMTJYSdGwUnmL361RL4z1I43uD4F3G2ixq+TVO96ICdJKqlRPEI1SlYyPYpHBJ3WpefChEXI+ImOBlHm8c0+ZngRhuif4FIeRKI1RIKqFsZ/41g6UxKcMjDHzUCcvoEwcxL3t99lA8iNwFKsAouuxlaF2z62WkrdhyC2B4M+MyGVlOTgakokGCWaOA/z2fyKEuv3P+NdY1XxijXxcRlNijrVlGPdO8AW6zEVsxakhQ5Ji55TtWr50YcGZ6SP3yexYJUFJF97/nwF9fFUgN/hNS8UStiBXHYdGq2A== 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=+FzZbW8ip5OIs0Eb4IxC3m0SDFoC8SMssC4S5BQ0dto=; b=a0KBQaT2/bBCHm0TsoYmbV3sG0x9Qwi8W730TlNs2gSo1wJxS878gVN3fO5747BooChONC9CR3AblKDlM23rYiG+6l12fdX8N+yooqlukCS96v6TJazFVuDTmAxlA3UrzKAjCU9UQnJ4ECEYH4y1ClzEqN7Ela4xJyffhOF4K/QOcQx7tzKMQ00DKy0F6j6rO/0xCsvzw766aPaSH2KYLjuHzJotwKnFqRW03/YudTCpwVLndO+swwdLwav6/dfjIWFR1NCngRpXLHu5p/muem4rSRPtcb+FYv1lq9fylbK9cOtkWjTuTPBu9tvwTdhPPLzvX6gqW9UkaOkyR5jGvQ== 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=+FzZbW8ip5OIs0Eb4IxC3m0SDFoC8SMssC4S5BQ0dto=; b=QYK/8/CBQAlXjpcqItceMdzejiUPzZ3nPsPljE8Or9na4KxFSPuuBmyx09rSAccAaj6oZ3Pdlwb0UBOpg1KGMzja631DNdhgcpcBs1n9Cc2wFcxj1/1UMTGvIHzYhfJweVQ78DA5+v6AB5zwd8jUUQbWky3hVtATaghohblA7cQ= 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 PH7PR13MB5454.namprd13.prod.outlook.com (2603:10b6:510:130::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.8; Sat, 22 Oct 2022 08:25:18 +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:18 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 15/25] net/nfp: support IPv4 GENEVE decap flow action Date: Sat, 22 Oct 2022 16:24:19 +0800 Message-Id: <1666427069-10553-16-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_|PH7PR13MB5454:EE_ X-MS-Office365-Filtering-Correlation-Id: 0558bb32-1496-4f7a-0533-08dab406f3cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Jmzb7vINQr7FV9/ZDbnoilcWjQJw9myf0bw9msFHB8LXvivFHk9+8RhBlUSF4VsWnANfaAgD9NnRGEV/LOCrdOyOSb4cidabGVzajRJfyLB8nUb1ju41pMX8lGTv6xUaqHymn7XAA7SflCVZRLSK5NeONC8ydLHo+0Uu+IeQythE0uE227F/zf8Ucq0xP9mBKcz8QMquYFI7LjfxlTZNep3TRDuV0FNmkErn7KhBcUNuie3kya00k0eXKX+fGZTiiy7N0v/djTQSWMnATv10Btw+61K8APS4J8RNUbD3QnFO/6JY8m59CwCEOVum0A0GDmPRivrLqo99tgM3xRC1XAGRiXkPP4pQF0aGkFSuL6CinQ04vLJnykTnL/ysoojLGXDK9UEp5I2VP8R86rqTZasA+GumItYJcG/nc15kyHpvBmGlnXQW671b0HN6ExzRVds8A0TrJa+c0Mz/HVPBMzyxLfa/7eYcHESWSE50Ak0h++5ao+9/qU2hsEwwELMVt7CXbjhhxQewl8wPxYh1f9Qce4bNIXzhFC43zlHOC6x3AxwpLatsKcgZNjidWzw7JQAPDc0J7ySC/zUcerwPTCCSOG42yHiLjxdlHxgRajVa2rZFJCoOj9T5tC5BDQvM7eD+XpaBVasIZptvSp8OyOZfygz8y3ql1MPgz3DnMhZzTwi+qjtoSMFwzLPugoQ6IoAl3w48lF9swf22tHEBOh0rpv91x5gcrTDAj3OHSQBZtWti8scYZliaMCOwKvh1J6X14mctUkHcG2Jf/7xHStcE77X3i1QSjuOT13errzZYKoWFafIfL9GnA2DJCwA 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)(346002)(366004)(396003)(376002)(39840400004)(136003)(451199015)(186003)(6916009)(316002)(83380400001)(2616005)(38350700002)(86362001)(44832011)(38100700002)(66556008)(5660300002)(41300700001)(107886003)(478600001)(6506007)(6486002)(8676002)(26005)(6512007)(8936002)(4326008)(2906002)(52116002)(66946007)(66476007)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bDlxd1hlZGNEQVdMRkg0ZE5ZN1pzT1Z5bkt1Yk5YOXRNOWZvWFlvM0hScE5l?= =?utf-8?B?bmdRZnhGS3F5L08vMHBxY0VpWUR1aHQrck1reTYvZ1BFcXFoSldNczBqRFNR?= =?utf-8?B?OVZKSlczazRKV3BKTWlKR1pGRGRobllFRzBERU82cSttRnFPUEM4ZWVGV0lS?= =?utf-8?B?c1F0RkR4d0Z4ZS9jR3cyMTdnemowTTN1Q1kvNGdiVGRlbEU5MFo0c3JzVUxu?= =?utf-8?B?R1ZtZytEMFZ4L3RTZzNNb3haNytaaGxlRFBPV3RvZ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vdXBoRS9Q?= =?utf-8?B?V1pDWTlraHVYMGVQbWszWUhCdWQzUFIzZ1gxMjR0NlA3aW8wR3Rnd2R3UU51?= =?utf-8?B?cENKNXdFN1Y2dTd5MEU0UEFQNHZqckdFVFAyN0J3SkczQ2R6a2xleFNlYWh0?= =?utf-8?B?cGc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0558bb32-1496-4f7a-0533-08dab406f3cd 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:18.1978 (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: O/sliOg9zCxFAs2ruVvJaTwEeHWzDzZfaLXKfn907xRvzHufqEPwg3+CwlBtFLgxcp4Ur6+z+twdI02YmK2fw+N7jzFj6m8WghGEhTuX668= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5454 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 14fb6e0..c017be1 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -45,6 +45,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 48a47a6..223f2e7 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -955,6 +955,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; @@ -1426,7 +1429,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, @@ -1434,6 +1437,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; @@ -1464,6 +1468,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: @@ -1474,7 +1480,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 */ @@ -3056,6 +3062,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); @@ -3546,6 +3553,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