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 12866A0543; Tue, 25 Oct 2022 10:01:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE45C42C10; Tue, 25 Oct 2022 10:00:26 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2097.outbound.protection.outlook.com [40.107.212.97]) by mails.dpdk.org (Postfix) with ESMTP id 3894A42C10 for ; Tue, 25 Oct 2022 10:00:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PPEc9eZBmSQotSTaWzagQM5H0fxyYd7v7dLcO6Fri72wCj4QfyvmZD9Qu7hW4ZqVQaqmsxKoST/4FpHCCL8Mn9LVVjAW/k0Xn35W0BXdHutAWYt/cdtBDyJumwBRXb15gLvAXZK42HbIZnHa/HSXHVVflHl7+E8i0dIAA7dq5xouiR6WrY91j2IN2EzVBHbb71AMmSZr9eoH/koHQb7Xev0f2KaIwr4FkMLUVqD0w5c3Uin6a7RoUEu6qoOeiqgcGl1EkD/MabuuoKN9grPmRyYZCM5DrU0yatcG6sxUZ0VS+RMUqtY3rn4glJ9IxhRECsIy/O2lHQBK1qAwxWuDWQ== 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=uJSd3CLISYoTUuzK7wJVXsNqwC/VcpLDIeh3NLjeV9I=; b=WbDZ0biUJdzh4eDKKLVNKUnZwNnb5B+LxPIdovmv3dyRrcOorQL7G+3CwrzeEi6uXeyZgVjRkjjzSu0zTzcO2NWt7QHcCHlf+tYL5uLclzlf08oUqhFCLgWxmpchnjziqLjLXgfmRFzQDKM9DmD/vSqj7eT08EkVxbqKvpRwmwFW+nI9BCdArDmg4P9oQeltDVNBeddgQu+24QKga6LDYIf0E5ljBhrZVqj4cnmtSPHqSN1XFE0qdtVX9pvYibv4bZl2Wa7HSpxAfjI9je4k8LBW4IPr3KNzNvWP/z0Q+LSau7mv2CribvdwsXV59IiugI7i+EOXsbSSFEWFR++s3w== 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=uJSd3CLISYoTUuzK7wJVXsNqwC/VcpLDIeh3NLjeV9I=; b=nFWWVo1eRiXEANI8DwuyeVD/Eh7aM093wLJOm0shg2QdaTtiVCSydGEnpOQLIPwb9DLNv51arOtnPUSqwxtrrXas1xDnsHS/giNSIqrtZdyDKQWJbYy3kqGytPNIItrQ6CmAva01P+3t5MBX1jj0k4r/OPNgwX4YF4s+RGivfpw= 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 DM6PR13MB3924.namprd13.prod.outlook.com (2603:10b6:5:28f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Tue, 25 Oct 2022 08:00:14 +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:14 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v3 11/26] net/nfp: support IPv6 VXLAN decap flow action Date: Tue, 25 Oct 2022 15:59:03 +0800 Message-Id: <20221025075918.7778-12-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_|DM6PR13MB3924:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c31794a-acc5-46c9-253b-08dab65ef293 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uwzAx4VD4DPDF58/DEnVHLy6ygDnTqHSlliQ3Xj1S/AkI914Kjz73CdbNk8UebyC3CaCeJ6daooSA9Le9mUh585G2B4UKUlBSxWVsUv9tEDqz52IsJ5nUahM2QkbHpIcJ3pwdT2ivuW32u3DkVQnh/E9IwGJtYOyFzre/gfFGGnXTJjw94FwFxTsV+suwJU9mr/yG9ADLzkImntyRCJX9yJvbmT2Ae1lYgMsjIC3kegvJUZEAj/gwnP32eLpBBUEufydmewLN3eHcRx1+2tLDeZTSS8F0K/SOmZe+jjXnTdERHurT/FrU4SxPVqtV1bn4DNOkS4Gj5ytWps2XO/fbeCF3fSyMKgEffRWZ5uJyeR6bZEV/vzqphC+q9GrHuWwrHloW95aEL8/7lm78o+MpCTRaYtG87Ja4+zFg2FiHWjXSMWuMdg+JOTK8ylhhpor77oEQwraxJjrgI/jewZfT4Hga1VTWaUuJveU/5ArITvN7ISD9Pf4G08sf5hADtYdEEu1y25Wa9xfMtYbSJZultRrfPjnrlbvtjlmpH4GSh+Hj1oOkmaA+e/0ZvuoPKHbAR3IFafb9HmK13J34xfTtmhynmVdqWRH2dMtf9kbNQ7uKFiY4wPovZexiY5xHHskCY8kTGu/1r0KLjwBAA3/qEjP3lScIkTTP5r9lqZoy0L6W91jrRMZoTtTudtgjv792ZXN4JczoZI8JoNahp2tBqlLV506ngsn9b0dsoih8aPfx6cIL0MDNFimtdqkPHuiKRn90Y7af6segxe/+MZHlQ== 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)(376002)(366004)(136003)(346002)(39850400004)(396003)(451199015)(86362001)(2906002)(6666004)(186003)(1076003)(107886003)(83380400001)(38100700002)(41300700001)(2616005)(8936002)(6512007)(36756003)(5660300002)(66476007)(66556008)(4326008)(8676002)(52116002)(66946007)(26005)(44832011)(6506007)(478600001)(6486002)(6916009)(38350700002)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aFdqcDdZN1dCRGVMb1VKbFZQTW0vZWtxZWRZMnkxdW5tOGZRRWVhMksvOG9L?= =?utf-8?B?ZEVqdHVwMjF3ejQzdzVCSWRWUUN6d3BPV2ZiaTJHSFErR0FVMlpFcm1YcFNK?= =?utf-8?B?M2ViTnIydnpCSVdMcmV4NkVzTUtCNFRoaDB3N1QxbjQvRnQ2WU9ZVHBzWFZk?= =?utf-8?B?ejFUQU1Sa2lPOTR1dmRpcG5NdFZTNWNhUTZNVlhsRW5nampNdk9nYlN0R3pW?= =?utf-8?B?VlBRajR5TmlPUmZnbFNPd0d3YWVwcW9xeldFYmdUaFlXcUxjRWs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SFR6akx1T0JQTTRPaTBBK3lKNVNuWWpxSlJ6?= =?utf-8?B?a2U5azFMZnJBODV3L3BEL2d3Y3NySktDak55TmdVbW9JRFRSWGRDcmxlRXZO?= =?utf-8?B?a0E9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c31794a-acc5-46c9-253b-08dab65ef293 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:14.2082 (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: X6AylydXRU3sI78uws06RXpGzPUaOiY3iHVk0s1cKepw8yCq1txI35+D/UiSaPF7q43De3qtmXSPueJiBqgyFj0x1/oWizLMPm4KRggU8hk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3924 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 IPv6 VXLAN tunnel. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_flow.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index e71292ff12..9e8073b0f8 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -476,7 +476,7 @@ nfp_tun_del_ipv4_off(struct nfp_app_fw_flower *app_fw_flower, return 0; } -__rte_unused static int +static int nfp_tun_add_ipv6_off(struct nfp_app_fw_flower *app_fw_flower, uint8_t ipv6[]) { @@ -1352,6 +1352,8 @@ nfp_flow_merge_vxlan(struct nfp_app_fw_flower *app_fw_flower, NFP_FLOWER_LAYER2_TUN_IPV6)) { tun6 = (struct nfp_flower_ipv6_udp_tun *)*mbuf_off; tun6->tun_id = hdr->vx_vni; + if (!is_mask) + ret = nfp_tun_add_ipv6_off(app_fw_flower, tun6->ipv6.ipv6_dst); } else { tun4 = (struct nfp_flower_ipv4_udp_tun *)*mbuf_off; tun4->tun_id = hdr->vx_vni; @@ -2163,7 +2165,7 @@ nfp_flower_add_tun_neigh_v6_encap(struct nfp_app_fw_flower *app_fw_flower, return nfp_flower_cmsg_tun_neigh_v6_rule(app_fw_flower, &payload); } -__rte_unused static int +static int nfp_flower_add_tun_neigh_v6_decap(struct nfp_app_fw_flower *app_fw_flower, struct rte_flow *nfp_flow) { @@ -2577,7 +2579,7 @@ nfp_pre_tun_table_check_del(struct nfp_flower_representor *repr, static int nfp_flow_action_tunnel_decap(struct nfp_flower_representor *repr, - __rte_unused const struct rte_flow_action *action, + const struct rte_flow_action *action, struct nfp_fl_rule_metadata *nfp_flow_meta, struct rte_flow *nfp_flow) { @@ -2595,6 +2597,8 @@ nfp_flow_action_tunnel_decap(struct nfp_flower_representor *repr, nfp_mac_idx = (nfp_mac_idx << 8) | NFP_FLOWER_CMSG_PORT_TYPE_OTHER_PORT | NFP_TUN_PRE_TUN_IDX_BIT; + if (action->conf != NULL) + nfp_mac_idx |= NFP_TUN_PRE_TUN_IPV6_BIT; app_fw_flower = repr->app_fw_flower; ret = nfp_flower_cmsg_tun_mac_rule(app_fw_flower, &repr->mac_addr, @@ -2615,7 +2619,7 @@ nfp_flow_action_tunnel_decap(struct nfp_flower_representor *repr, if (meta_tci->nfp_flow_key_layer & NFP_FLOWER_LAYER_IPV4) return nfp_flower_add_tun_neigh_v4_decap(app_fw_flower, nfp_flow); else - return -ENOTSUP; + return nfp_flower_add_tun_neigh_v6_decap(app_fw_flower, nfp_flow); } static int @@ -2803,6 +2807,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, } nfp_flow->type = NFP_FLOW_DECAP; nfp_flow->install_flag = false; + if (action->conf != NULL) + nfp_flow->tun.payload.v6_flag = 1; break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); @@ -3273,6 +3279,9 @@ nfp_flow_tunnel_decap_set(__rte_unused struct rte_eth_dev *dev, return -ENOMEM; } + if (tunnel->is_ipv6) + nfp_action->conf = (void *)~0; + switch (tunnel->type) { case RTE_FLOW_ITEM_TYPE_VXLAN: nfp_action->type = RTE_FLOW_ACTION_TYPE_VXLAN_DECAP; @@ -3300,6 +3309,7 @@ nfp_flow_tunnel_action_decap_release(__rte_unused struct rte_eth_dev *dev, for (i = 0; i < num_of_actions; i++) { nfp_action = &pmd_actions[i]; + nfp_action->conf = NULL; rte_free(nfp_action); } -- 2.29.3