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 60EE4A0543; Tue, 25 Oct 2022 10:02:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 775E142C1E; Tue, 25 Oct 2022 10:00:38 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2090.outbound.protection.outlook.com [40.107.223.90]) by mails.dpdk.org (Postfix) with ESMTP id BA0AF42C12 for ; Tue, 25 Oct 2022 10:00:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PP3slOIU1JboHfY1QUCV90Upo5yhP1iDbIIroOmUnEOlvqGljTK36UPt0LYCcN9ItHoQI0Z3Gbbi0Kv3HhDAFodAPQZJkvbVV52niDZB3x4uEjS42uJQGK9pt+Tgb+vDTw0rGpBgrdHl0z6k57fBChK5K9jO/y9zHpzoWwq9BqTtPSJ8PBEjOjsODqTnPzmc7REz1l+uiSbSjiWuxa1aAkYTybV7OGduvIzMOa74jTccvvXE2mN+8t0e9zUxCF7NaXzDYHgZxmA7YA6cak+rODVaWPmuon/29RIPaTuMRwymeAlEzFUjK7g8XTE4aUqwJweTZlro7F4O4LXrB1p1Jw== 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=IL3xN9yHnrEBjiV8n1oBuxLRiLqlGsn0fL9Oq3ZXwns=; b=ON14MXhbMoNvfg9xQsHB//ob9PLpfHwMRN8GgYSIOw8H8970zXg4XPLKLpfb0FJ2LTtj0nIITWXR8RNOHXmovGlApWHNdV9I6wfddYb+EXTrgBsRcZzBt/S1I/XGdxmZcmgZPsz8AnGFDe8QfmQukZ1xYOwJ/dh19cqfTL8MMWgQOqDHuST7o7DGE7eU0GscbhnhFJAkdadA+6PEZuk1InSemum8/M/lIMIZ5csmvZHSOrtwgH7L+kmM0PJgtgHAZHOBNmco4SXk3O0mA26GaP/+ga30ukQD+hbgSOSPrJEKVo0mZ8Nu4eLTTY4cOTo4C62XRT/BpPF0zVT/aKEUoQ== 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=IL3xN9yHnrEBjiV8n1oBuxLRiLqlGsn0fL9Oq3ZXwns=; b=Gjft/IlesC8L5aCE0+ycAY6jcyK2k50vuvvJPqf3gFXnGww510dzxSBPXciIaBDMoffMk1sL4TqjPsekh3Sdjl5sqig8EQlw0x+yUkMUcrcd2ZHP9lbiPa60a5/9g73phxs4oNkWF6M5Sid1cQwk5i+KOYrNM3xeZtzSDdGnv/0= 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 MW5PR13MB5439.namprd13.prod.outlook.com (2603:10b6:303:196::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Tue, 25 Oct 2022 08:00:24 +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, 25 Oct 2022 08:00:24 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v3 16/26] net/nfp: support IPv4 GENEVE decap flow action Date: Tue, 25 Oct 2022 15:59:08 +0800 Message-Id: <20221025075918.7778-17-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20221025075918.7778-1-chaoyong.he@corigine.com> References: <1666427069-10553-1-git-send-email-chaoyong.he@corigine.com> <20221025075918.7778-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW5PR13MB5439:EE_ X-MS-Office365-Filtering-Correlation-Id: 5381d1b9-cabc-4346-e248-08dab65ef88d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kQeUoGkIWpXPMOqvB+DYuTMJWWp2fVhmRvDvmQoWmxwk8vSH8+x+3ni1C8zWdRR9Cme2voz1DJmhEBIYaM4wvL2WuNTTrcs6pLvhHUwNL3Y/PBnu5L3cnrDkKT+ugVHfHAuZ3X6V47CQwhyAw14gHz/uiiHQh36hmDzMAZ1h3W17GGdbAx5yhE2GDJ9Vz4jRn7XHTq42rtKlcqK+jBrbvafcPvbVqY7tEmhtJsuMqeNqvZilAVm8cywIlKgLjnWworR5AYx4Z11mEqcIUxrCqhtJf5884xtspcyS4H2FBNX6m2L+w4fNIm/mIzMRhxRkjz4OuvP5nYJS2OEtcGazNwWgdQmd8zeETiUbhwJ768OeS3KTYBLT4zTWyOK2lY0OOZRb1TxGcbyc2bM4ldZdnxEhsW8remrYOrf4tNQY3hBM9ytyNA/0GO+h5Y/YJOoBhOGG7YfElTYGaZfPn1TDGBzw57Dt+bUjpakTS/qKox6w2dre13KEjt30gbEElbZAuZRKJjR7TOVOoDt1n4rGS/SZ+JAgQUa27zHwmBcia33SUWjBFNoLASfk157qUMPg9ZqYVzPp4yHVikNS+cwj215jhtJ0a6dc1Vc8CWAwVTo3Ux2aZAr4AZG5ureRCJi5hUV+KxtD/4f4i3f1k7JnWG8yoi0p8X3XyA1SxnQ+EMaYM6QlA4JYpZa6jlb4V7Ta3hvog00boXh2ZVhRTpPMCt//wPrfi5rR+B3k++9WOsCXnTzy1W4eSuL3DXwTzWwhT9ZttUdIyoQxf8CD06+u2g== 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)(39850400004)(366004)(396003)(346002)(376002)(136003)(451199015)(83380400001)(6506007)(478600001)(316002)(38100700002)(52116002)(38350700002)(2906002)(41300700001)(5660300002)(6486002)(44832011)(66946007)(66476007)(4326008)(66556008)(8676002)(6916009)(1076003)(8936002)(6512007)(86362001)(2616005)(26005)(107886003)(6666004)(36756003)(186003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M1FpSVhOdU55Uzg1TDNZS0hnczkyeG1peWtkcmRxeG5GZGtHRnVLajBndFFh?= =?utf-8?B?SkZLQm9EUlVUb2JabXZSQzhSMndDZU00c3MrK1U1cFpYWkFyOUsxdW4ydU9q?= =?utf-8?B?Wk04dm92T1ByTzlrUWo2K1Vma2tUN2QwTGxldllHYy9CbFhCRjRQM2p0L0xp?= =?utf-8?B?TU9MQlM2RDdNeHl1Ty91TWN5R3NZYzNmZEZQY2pRYUw1Mm1tcE9yUVNxWk1Z?= =?utf-8?B?S0ZaVlZJc2cwUTdHR0lSMGNlMytpRmp6e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0dXbCt3a1c0VklDZG92bHEwTkVjMlZDbTg0eWl6V3lOUExCWnNT?= =?utf-8?B?Skt3N1RJN1AzaDZVQzlOdWt0M3dQQzBMMGlBZkdXTkVFeEZhS3kyV2VSNlI4?= =?utf-8?B?WGc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5381d1b9-cabc-4346-e248-08dab65ef88d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 08:00:24.1620 (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: GIRRXc5YtgtIoGTzTL/lSW0YV/1zburjxM3OahEMCJ8EqhW5BTCcCRIE4ZuTrt61L/sEl4yLdOw+QQFIgMLGUZe5m592P/PupHdV5M8er18= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR13MB5439 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 2e215bb324..fe1cb971f1 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -46,6 +46,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 50e5131f54..46a047cd7b 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -955,6 +955,9 @@ nfp_flow_key_layers_calculate_actions(const struct rte_flow_action actions[], 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 @@ nfp_flow_merge_vxlan(struct nfp_app_fw_flower *app_fw_flower, } 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 @@ nfp_flow_merge_geneve(__rte_unused struct nfp_app_fw_flower *app_fw_flower, 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 @@ nfp_flow_merge_geneve(__rte_unused struct nfp_app_fw_flower *app_fw_flower, 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 @@ nfp_flow_merge_geneve(__rte_unused struct nfp_app_fw_flower *app_fw_flower, *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 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, 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 action tunnel decap"); ret = nfp_flow_action_tunnel_decap(representor, action, nfp_flow_meta, nfp_flow); @@ -3546,6 +3553,11 @@ nfp_flow_tunnel_decap_set(__rte_unused struct rte_eth_dev *dev, *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; -- 2.29.3