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 5FD22A0032; Sat, 22 Oct 2022 10:26:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F10542B7A; Sat, 22 Oct 2022 10:25:13 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2101.outbound.protection.outlook.com [40.107.244.101]) by mails.dpdk.org (Postfix) with ESMTP id ACA0041614 for ; Sat, 22 Oct 2022 10:25:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fnF857eRmGRTkI7qgISC2eayZHrqK+sTB1Int7lH2e/y+KllCh8nf4M97uRvebmaKngH7YOcCe2VshdaVF8sYrTA0j/5dlyYbYJ4Pu0A1iqTkdPF++yuNylv4DJ3a6CHU9cuoNNt0ffgxSz87PiiipWq5gP5Ez8R/1rmznRFcWNtgk1Vr6vlIEfk/hTXnnCQZ36knRr4Ed/SZ2KmOdv2YYCT2FQU9vpAhLX2px+6j8jAiq9FiZH0QvJLGe/CUVkldn3IABj/J5VQdrKwLa9w2Mjl8jcM1cvtR7zpl/+fz6HLe3nAWbzOoGyjDfC3a4jOkUV4UAEEc3JhRhWUvya26g== 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=DpBdcc8um9/lpkn9Hw/KC5JDFsljn8dml9E2QbYh9jQ=; b=Kh43h1eepuNUn916j6ZCCo0Yfx7eLnbf1AeQnYjqwxuIy2BULCNMCgFJqQaW4FMzkbMb+60vd1vqdvP4EYX7sSvgoVfbS6YsaT76l48/ZL24/nuPmqK6PlPwRZXnH0unZ00sHF+49henMxH9I+jREUrXBAykYx+JCh7P8WDcMDxb9kes6ZPl/dDDKeWBThGlN+xEmDTlCJvREcteXS92x4m23VHapL0XJEd6mmkFG39WYPtqjJ3WE0m95Snrs/jSVG/6BTsOnBqdNDTWhkCyUS2fxPSYzdAOqJIQ9ICNCg72eHm2P/JWqcRwjUcGlXm+zF110y2EK7xExskB4fipEQ== 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=DpBdcc8um9/lpkn9Hw/KC5JDFsljn8dml9E2QbYh9jQ=; b=PCWiF2SoA+5zEU8mAS+O07nxJJ1Oxxrl59r9CKZ52ctJ2sf5TE37uIlcgBg+T3joMQyfmj7S+SpckneiKtg2ZxyprSJTlmZVioPLd+zaH5A9rOW3FxKtKh6WE7d+Xy4pCJ4Uv66M4RhwLUXN+pLWzv6z6uiI1BCWF6TYcEj/WsM= 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 DM6PR13MB3690.namprd13.prod.outlook.com (2603:10b6:5:24e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Sat, 22 Oct 2022 08:25:07 +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:07 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 10/25] net/nfp: support IPv6 VXLAN decap flow action Date: Sat, 22 Oct 2022 16:24:14 +0800 Message-Id: <1666427069-10553-11-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_|DM6PR13MB3690:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fa1ac6c-20cf-4ad6-22a4-08dab406ed5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qc1QlEvAZIwZoDCoK5LjKRAydlvcQ+NwBgmNbC0zVFOJQSLlzvZyZOLXV2l0AOSPyQAkX4GM7uQpiOFlggkTD1MgAqhADREo31viCLZBzAa5XQ/2H7xLnjxbwVaszdW4+JjUTo2lPe2TlqKSnIS8e29GXq2P2XQVpZus2MAj6A7dryo3WTcLQNy+o+9YLWAu4EpozPMsJinA/g/xTxK1J1mf5e/buRjb9wtskTiOCvJni0kHL2OhyxUoRolP35WyIpfGTRmppUSLFkeYa9AdZEiU/RhHp+Q+6rcaIS563kRAB4mAF70LEr/pK/8Bi4F04zH6UkEbUrBVFTwe2AUW0urumWsK6ycgnxeaj+jZ5woPmcSzW7qKG/3ziJEjbPLjJhYnH9/a2qAI+xek2x1gWmWoij51CGxQUhDd/gs2VB6fXYvPtgj3W+IVfZWIazm0e4dbZtdeqr3ExWAtAqxXwAyvCZSU4J6mBpeaeFjc6L2KJQl/Zt6yIUXnZaqR6n5IOdKKJeRGxjlOaZFLQ9GMok4Ejingj8PQq9jL+05gj8Vbw6jyxQmivgFVeNl4i4AtutT92BFt+TnEoWFs5JtSZ1KX6JWjuSuMSKjd4rU/y3/PjcxrtmeNMMe9rNjYm5DnOX+XzDml3S0GSLLKB43X7ZCv4x71npyTXcaSpgHPtgLyk3cyycDDSJq5TJ1JvqnHsZFtZHMYQOXQEXv2b7kJo+uijlVUXDDrmDXdf31HHxi9ung7o+enfWzz/UVkvgvqy1nGqX3roTpWiqfQxhshZA== 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)(396003)(366004)(346002)(136003)(39830400003)(451199015)(6916009)(316002)(6506007)(66946007)(4326008)(6666004)(52116002)(6486002)(8676002)(66556008)(66476007)(107886003)(478600001)(6512007)(2616005)(44832011)(41300700001)(2906002)(8936002)(186003)(26005)(5660300002)(83380400001)(36756003)(38350700002)(86362001)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MlpJYUF0M3I4V2ZKQk5vcjdhdmNId0pHTjBNUEtPVEhFRjF0VjVDb0EyYnM2?= =?utf-8?B?RzBnd2tSakdwWnFGSTRlQmtua3lKa1VGVVc4YzNJQjNhUXlzWkNyVjRqbzdT?= =?utf-8?B?K1RwU21vaUU0OHRabkpmczJyd01PY0hnRkRaQ1RtclBUS25mMVBoTjRMUHZv?= =?utf-8?B?Tk9pQ3ZxVDJjOFpDZWFXekVLTUp0cHNoUUd2bmtKWTNzeXFpZGxncVl0OGhr?= =?utf-8?B?UytXU2xqYXMyWUhma044RFhNZEN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HdQdDF2UENhczYvWkx4bGtNcEo1eDlsejVUNjV4OHZ0QWN5?= =?utf-8?B?b2plTUU3TjZoVWpFTVdUalVvTXlaUzF0M2pFa1lVa3puc2gvNUJmbzVhWFp3?= =?utf-8?B?bnc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fa1ac6c-20cf-4ad6-22a4-08dab406ed5b 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:07.4290 (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: UaiU8aepDvm4EYkXRRyhktO8LEdymquWkEYQpOfbZVUubLyE/8y4hT6U78r0PjANUEwE45s4cfneLcCM5GfFeZ0nM0qFvs2TlXauMQRLAGE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3690 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 ce61446..1abb02b 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -476,7 +476,7 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { } 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 @@ struct nfp_pre_tun_entry { 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 @@ struct nfp_pre_tun_entry { for (i = 0; i < num_of_actions; i++) { nfp_action = &pmd_actions[i]; + nfp_action->conf = NULL; rte_free(nfp_action); } -- 1.8.3.1