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 8AF7F41C3F for ; Wed, 8 Feb 2023 10:24:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79D1941153; Wed, 8 Feb 2023 10:24:11 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2095.outbound.protection.outlook.com [40.107.237.95]) by mails.dpdk.org (Postfix) with ESMTP id CFA8240141; Wed, 8 Feb 2023 10:24:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gHxTcR3FWIwuKpWYzw2XhvwPhdgOl+p9xoYEJRslnxT35Yzbj9i/ClR2ffJPJjotdifbtyAeknPhKIr9CZFJ7t8GMccMfHllpkJdAFixtCHsbscH38sles0MJYoX+xsy4cm84d1ed6mBS4zz0yamDhZ7fSqH0iIzgyKG93B43Ow2oCae7REE3PAKxsIfqxuxh4YvblF4WxJdlc8xXxM2GvAfLqwzU8LXSOtHTCcfp8fqBOwjL/0LAP9bm71g01q+lds8P4OiAbqm+NYkIJSjo8spCWzlCe3XBQgSUHXGlxf/Z4CPsCkrzjIqkqkMKoET7EtcWRHi7mIamAih1X1D2g== 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=u6Nd9APhEJF8H7riEGWzhNUaJ3XsK4hKtNYxU2OHt64=; b=YnMq3phweoDC81Yl09PzjjSd+C6IlWy06fiXKNSQmiE/UOadhUiPO1qieMBWQuxNOb8e/uWQOnGDC0TkpVABVPReoSolRmdz/ePZ27bPMkdTh4QBSp25FPMcyE10J+v+nxRp7LtnCeAw3duCyy2q1UwR1baVoiIYJmn97vRk+XsM+avCL68cUA3sd5uCkanrIWFU2aX3+HgkHAiSCitmv3LxZe/sX1P8HZTSceS/q0aqkjSAflXDKzMDS54Z0vSy3r343SFjHNZE0mROem1FRBHSAe7rQukcxsLDgOPrDNCspbKpwir4Tn626fQMxNIQUarwY3rAVSNUgA5axE754A== 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=u6Nd9APhEJF8H7riEGWzhNUaJ3XsK4hKtNYxU2OHt64=; b=Bhe6/Fkt21bn9sOXywQL8Vl77vrNygFRPhW8S5pLMpkZwZqBEw4ZhKeVmFJJmtb1iYAkJV2HkaHBXL08So20nQoajIi+vL/UJarH9LCq4UMwymx58XwL+40jQP8skTRFFxfXvZIebsgmwwL4PKfSAF0T8wlFcY+SpT0oBRfe0hU= 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 DM6PR13MB3898.namprd13.prod.outlook.com (2603:10b6:5:248::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Wed, 8 Feb 2023 09:24:06 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d%5]) with mapi id 15.20.6064.036; Wed, 8 Feb 2023 09:24:06 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He , stable@dpdk.org Subject: [PATCH] net/nfp: fix the incorrect vni of VXLAN encap action Date: Wed, 8 Feb 2023 17:23:50 +0800 Message-Id: <20230208092350.26226-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:3:17::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_|DM6PR13MB3898:EE_ X-MS-Office365-Filtering-Correlation-Id: 38e92ec3-0664-464c-af87-08db09b639ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q6oHUaycKVy00c7CeONbhedLZWYaK/XdQb199bAFz8RF9ZlrEzL4LobjALrVNKD4IfDGOvbUJij8ZvU4mgAxJiw8POQd21FAw1yIsDkdxvfvoYp2iLVffhgI8ZFcAD9UVesUF7tWGIWuZFCijD0fVXMTTqZckE/R0Y3URSOdDlpfg6jFdvci2mehZkuxhESvSkHSrX1ekVCb3sna1i96vMU57eFwh3FlAfgDGKeeDDeE4+DJUIm8Pzk0nrrfp/CU1Ce33x+uxDpH5KygTuZ9gFAY9OKhg0AJTNQsW3snGxozIsbRdVA7l4vH75KC+T6qWZ8lYT+PyiR8ngjbEI3ABY6veNMXvb96d90SWlOIbPG28jkp+zVhZFjG1afF0vCvanKn4jUFSN9jKLOrohAwjrIQnZ7Y8wtIzGTNV6u33VPEjW2m5l845Fk6GSjf1kHI2U3iDk8UDHxZ+TLKd+t+XNsFWrPsREYBZLs0wx3j6aiYdEAOfm+qSssOH3NwPRaSd8/RkofgvpFc7YGfEk1XmzGIicH3HupicQJy2s7e6JmzUg0JVbWvlDSjQ/2dKF2nsQSP1aRmuHnYDpWPkXLIUfsnZwCEaHmKb2SQZgirRw5KMkDPrMMxm1nwo9FcovfRo8YHb9L4hLRMf6XxvxdOb/W0J5AqnsMJagDkoaL43ypQjxdJPDVrSI3a2N2ZVQv4lxZtXOHITaUBucBPYZEv1aYgK6C9iEjqk+eXUjPXTd/Xh00NP5cc6Ukd/LzLnZ7y 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:(13230025)(4636009)(376002)(39830400003)(396003)(136003)(366004)(346002)(451199018)(6486002)(6512007)(186003)(26005)(5660300002)(8936002)(6666004)(316002)(4326008)(66946007)(66556008)(66476007)(6916009)(8676002)(450100002)(41300700001)(6506007)(2906002)(1076003)(52116002)(83380400001)(478600001)(86362001)(44832011)(36756003)(2616005)(38350700002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RXJ4c1N0aUtQOFhGMHQwelp4UHpDbVF4UzdXY1REbHJqYTVXaElNelB3R3B5?= =?utf-8?B?VmNMM2pMaEt2T1BWMHpnREJoeHAzRkE2eXpXU1gvSnM1cU9nMlRuMU5yQk0v?= =?utf-8?B?QWMvaElZY0NXaWZqbVM0V0phNS9veVVreGpYTERtTkNvUGdKcDdSanY1NnlU?= =?utf-8?B?bk9xc2p5YWJvOWVWaS9RbktCUi8wWGNSQVo2WlBtMUZySTVQeFE0RW5VSmc5?= =?utf-8?B?WEg2bm9GQk1aZFV6UFpEWTNxV3Q0RUF4NENPTWtyTllCWmhGMTlBbWpCSS9G?= =?utf-8?B?NGZsRTFBczZRakFzaUlVU1FqczRlcElabEFQVndJZWo2d1duTVNyRFBFczhH?= =?utf-8?B?cUREL0dnWEpiQkdkdnBxcFlqRExaKzdIRExUcUZXRnVwYm5WYWxueGVn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= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38e92ec3-0664-464c-af87-08db09b639ba X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 09:24:06.3415 (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: TOjXGSsrQr9hnuwShwzJJXuCfHAHnTQiAf+sC85YMbNAGcg1t7JM1Rce7Wsxqc+RMhLecr7GGaepKGWKtY9gpB8AtQpQo3NVjyyhtWVll5k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3898 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The helper function which send the tunnel configuration to firmware requires the vni with CPU endian. The original VXLAN encap logic wrongly invoke it with the big-endian value. Fixes: 724662b4ce5b ("net/nfp: support IPv4 VXLAN encap flow action") Fixes: c3b7254093c2 ("net/nfp: support IPv6 VXLAN encap flow action") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_flow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index ff2e21c817..33361ee19c 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -2686,6 +2686,7 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower, struct nfp_fl_rule_metadata *nfp_flow_meta, struct nfp_fl_tun *tun) { + uint64_t tun_id; struct nfp_fl_act_pre_tun *pre_tun; struct nfp_fl_act_set_tun *set_tun; const struct rte_flow_item_eth *eth; @@ -2704,7 +2705,8 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower, set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size); memset(set_tun, 0, act_set_size); - nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, vxlan->hdr.vx_vni, + tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni); + nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, tun_id, ipv4->hdr.time_to_live, ipv4->hdr.type_of_service); set_tun->tun_flags = vxlan->hdr.vx_flags; @@ -2721,6 +2723,7 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower, struct nfp_fl_rule_metadata *nfp_flow_meta, struct nfp_fl_tun *tun) { + uint64_t tun_id; struct nfp_fl_act_pre_tun *pre_tun; struct nfp_fl_act_set_tun *set_tun; const struct rte_flow_item_eth *eth; @@ -2739,7 +2742,8 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower, set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size); memset(set_tun, 0, act_set_size); - nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, vxlan->hdr.vx_vni, + tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni); + nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, tun_id, ipv6->hdr.hop_limits, (ipv6->hdr.vtc_flow >> RTE_IPV6_HDR_TC_SHIFT) & 0xff); set_tun->tun_flags = vxlan->hdr.vx_flags; -- 2.29.3