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 A1A2E43E74 for ; Mon, 15 Apr 2024 04:48:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F299402E7; Mon, 15 Apr 2024 04:48:25 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2136.outbound.protection.outlook.com [40.107.92.136]) by mails.dpdk.org (Postfix) with ESMTP id E4D66400EF; Mon, 15 Apr 2024 04:48:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHIdNjQeGo92bqlbKjFJIVh4PlEHQ0EZddxWgUbZ5NDHlVblp/AD3iRAGoJrjnVBITvQ1P8R9NMf81tAVH8p1YadqivlZ0pp/14vzDsod8HD+B/rjviHWoCB5DdVf1lyRgmOUboKnoRbgWxXzv1jIc2Sz891iWCJ4MqVjv68nrj07aWMomETzzkhJ1lUdDGLV4QV4yasx6nAXRA22Wda10wAgnlParM/3H2AA8MOCSDvivZf9DzMfevK6g/ZO5CF4BwjHuPLGd9A4nQnzxIFnSH6OzgWRq/95MHp6Q2VHuxSvea/VrdjjtVXixi6LdOIrqExrU1Gh9oJx69jb39ckQ== 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=RmmX0hOQVDtAuRegQnd1sIn3+3E9O0dd9ei6T8d1RHM=; b=fB57GhRi+xFLi1td5pKFFMDGJSCEynEVRV6FzLQskoyMglbD1NOqjWHu6f38nnQMEJlEoir8QClqTe9opf5hbf9xFaqyPF58KnTVx/4S3yHQaMMS/taN2khhaJoVeJrSPc5pV3lPinwmchhBi3LtJDlDo0ARPu83h6QeBO2YP4pgLPLNZ3yANORb5YUdvIm82uXW15e2Pbr7YcMl10dKPPD3dHExorzB0VpSyim05u9y5tmgPeyh2Jo+icqMHNDIPxIzPBYUrvE5HJkXMKx7bTxnFxg1E5RVATj7byq8asJh20LZTBklQcjL4ktusts5WsGYReSHDcLx82DkKW00hA== 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=RmmX0hOQVDtAuRegQnd1sIn3+3E9O0dd9ei6T8d1RHM=; b=MIpoLOARdKLOaAAYC5FAKbLe7NgQ9OkhWPlQF6grfb5HiZcuxTO/gpVMeF7QmwU/W4frg38+tQbO5UDsOnlxb9uxlOktMDFMOoHSQw57waR8L7P193i7u+g61gQhW3tEB/y/pJSKvmeeDOuLWzQN9b1Cb/Xpt/sL8ttPMs0O3Pk= 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 SJ0PR13MB5272.namprd13.prod.outlook.com (2603:10b6:a03:3e3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Mon, 15 Apr 2024 02:48:19 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e%5]) with mapi id 15.20.7409.042; Mon, 15 Apr 2024 02:48:19 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , stable@dpdk.org, Chaoyong He , Peng Zhang , Zerun Fu Subject: [PATCH] net/nfp: fix parsing non-exist meta data Date: Mon, 15 Apr 2024 10:47:58 +0800 Message-Id: <20240415024758.1001527-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0122.apcprd03.prod.outlook.com (2603:1096:4:91::26) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ0PR13MB5272:EE_ X-MS-Office365-Filtering-Correlation-Id: 9da9e74f-e4cc-42b4-7ce2-08dc5cf681a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?SenTs28oETG6dqByB9Rwi24gd5zttU7lsdsHP9oq6zfPY9s2h6URBH2i1ter?= =?us-ascii?Q?UX+ikxNDVW1BWeRhEBgRrysXkF7EOSlh3MxfrULw4KSPpWJJgoWTPf0Pecjv?= =?us-ascii?Q?uhYUCtKgv47ht5s+3PDT28zwfg2qa2hjmf/r3tByUrF+RXoL0kqJP8hz+Fx5?= =?us-ascii?Q?3qMCE3TCyBHJDJWN3d8xFAiCXJk61Zu4bu/cDFHsZu2EyR0oQqUQZ53fduwo?= =?us-ascii?Q?znjY39cEUong3xcNMd84buFqjMn214ztLCaWpf64ymYNwj47tOy4zzcOy4C5?= =?us-ascii?Q?+bn6YAjdezGRJ9ocbrhuIcDqqvWnOo34j2mgHaNrn0uCTnYSwEw6mtQjuiu5?= =?us-ascii?Q?Xa3X4thc4M+PHj84bZeh4UtMUxcixTUrMBTn8O2kKkvRTkp9ck3Y0ccfzvX5?= =?us-ascii?Q?OWIbXtRGgOuoxeTyw9j3+7EWblg/8WCEaINjXxlzv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us-ascii?Q?Eg98jSRik3IClgfucFf7rNs7Zs0SNi+1JQOxi7N94s0iSw=3D=3D?= 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:(13230031)(1800799015)(52116005)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lgqwo2byNBZWClUz+Vj/VmUrQKFL0WBGBJWOwrmIJcXyxpCG2U9riLwwWyAQ?= =?us-ascii?Q?RRYo/cAtrGWLl8AvFhWQpLR6NKa72cgS7fP0dA+khMC02DgVYkRcIY40XeFh?= =?us-ascii?Q?6mCRK9zM4Tpar4FpCnrRXfYhkGOHQKyp2gGAPU3KG3Fs0gCwkHarsrNgGxk5?= =?us-ascii?Q?JczF2iC01IJM5jRpmPPoVVobKXmPHqno2ZHxl2yKgrTprvYzrJ75SSyDgtrR?= =?us-ascii?Q?iY7W+Jl6l6+pOyWFolx6NY1EJlFOPTEj1bY01fAuFsRnY09kQHV8/hDl/j2d?= =?us-ascii?Q?jWs+97NmsXV03WweINRaAFtk7KH1ftGgCvTvtbAGLItgWniE8inbLImoolAO?= =?us-ascii?Q?RIQwQQ9hSMr5eGr33ZHYwikrnjyCFYbFZhFBomoetIvPmrkEJOlfdAGYWbuA?= =?us-ascii?Q?s8Lxvi1ssox4Mum2WO2l/3Lhw+UIUVyI0WRCm9LqSQ18FIWbymt/J+nfpd57?= =?us-ascii?Q?JZfTU3q2ZMGBhQyo9UapzbIPLA4pjkqMqscqhO7qViltBu84FC43oPhXteQM?= =?us-ascii?Q?gCXyX1mKsOUA/3qQPD7CWuPmoPZc8BF/dd1x2ujGqM6sXojkT7fbqzMk4P46?= =?us-ascii?Q?7dpQlPXd4lfJdEuP2nGTSgaTKi27178tGTT1Mo9GpGF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EkM4LgT2jrYS3x2lD6h78fa9ZNBWgmMIMWodDjo1?= =?us-ascii?Q?8oLfSU/OJa9NRsbhdpiPIpJJMm8q+vVergFFd8SRpqXuaesNpOM18Ajsv280?= =?us-ascii?Q?rw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9da9e74f-e4cc-42b4-7ce2-08dc5cf681a6 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:48:18.9504 (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: 6x59BBJXj4roXsUH/3+Yx1x7y29HE+7TqZtOKhCKtaUo3mU7WmZ21XV9f+5EfNRWCYlPkil62Pk4V4n4RABCq8auuw+dHisyHoewUEJJFoA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5272 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 From: Long Wu If the packet without meta data, the initialization logic of 'meta->flags' will be skipped and lead to the wrong logic because of 'meta->flags' has random value. Fix it by make sure 'meta->flags' can be initialized in any situation. Fixes: 5eed6ad5a7b9 ("net/nfp: use flag bits to control meta data parsing") Cc: stable@dpdk.org Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang Reviewed-by: Zerun Fu --- drivers/net/nfp/nfp_net_meta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_net_meta.c b/drivers/net/nfp/nfp_net_meta.c index fa7e0d3d00..b31ef56f17 100644 --- a/drivers/net/nfp/nfp_net_meta.c +++ b/drivers/net/nfp/nfp_net_meta.c @@ -27,7 +27,6 @@ nfp_net_meta_parse_chained(uint8_t *meta_base, meta_info = rte_be_to_cpu_32(meta_header); meta_offset = meta_base + 4; - meta->flags = 0; for (; meta_info != 0; meta_info >>= NFP_NET_META_FIELD_SIZE, meta_offset += 4) { switch (meta_info & NFP_NET_META_FIELD_MASK) { @@ -237,6 +236,8 @@ nfp_net_meta_parse(struct nfp_net_rx_desc *rxds, uint8_t *meta_base; rte_be32_t meta_header; + meta->flags = 0; + if (unlikely(NFP_DESC_META_LEN(rxds) == 0)) return; -- 2.39.1