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 986A945D30; Mon, 18 Nov 2024 08:04:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73D2740DDA; Mon, 18 Nov 2024 08:04:33 +0100 (CET) Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012047.outbound.protection.outlook.com [52.101.66.47]) by mails.dpdk.org (Postfix) with ESMTP id EFC6B40678; Mon, 18 Nov 2024 08:04:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rH0dTVxRFMyFdQ+rswvq/Vo1iL9zmIFM1Yob8uS6rRHj3RLha25RRz6DRD6DHFxZs5w/p48G0p9AK2HENwJBYKSurjeTasdfxlFWfOap4Jc2tTTC/+95AQLQ/Ktxht5F4VTAM3Avbua4Re0ljCwdHcC9KobnKD/ziDC5KxAP/J69v4Yb7sWbrqrg682KFdJmW752KOGZLl7rWPJoLSuPeNT7/UnzTySoLmtZiXUeJIu4XEw6gEUScZKUROfr1gFeDRUragkQSoaK6y0IGWGaAvoqKGr3N+QcvM/7/PMCjgaSS/krUP3Zj1w2rpg4X+IzaQjBCCZces7JRP8v6S+J/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=FXx8cpOc0GtXcouTsMsv230RmiA+Z72uUGVqqd5EwTU=; b=K7zUD1yt+qB7ycrt1VPSCWZZRU5JXuIfScVnDHd0Cfrnn5/x214ElgABtUX0tW3nOGj8a/D6ZDFvgLUqisj6RmKwA7iepgRSXjJ27rAgTXmftJp/+4Ij7J4Wp2ogoXwuKlVrXeOdJTpS2ay1O4y7gyM3Ws+8Jfj6b814HtjqTCffATMselGS4vqD57Q8IfbcxACdsUKDVyTx36Npib2fTe2BtMT1FqyPhrbST892xONhAbwReSXDTd5JZRQ4+ru+tPZE9WGf+j0aLZP60gSMzghC7PLALcSBcJLkeKrRZsXbKFGfGSdwQn77zTJhiQ3m9Y1I//NrcQe9VYQjqcfdnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FXx8cpOc0GtXcouTsMsv230RmiA+Z72uUGVqqd5EwTU=; b=AqC8ZfMp4ynTAUT55XlQ/3QrwXWyyHjq7bRcXsBQ3B7CgNfVcVJ7Jsn/3J9ooDYwIe86vC7eAQXFA2BcBDRLB8L9PMm9aSsLx5QndWjU11Q8awH4EPP2RvKfT/u9SotDCkWRK+nDHkEHrCgeac/ghHcDZ2TEgAc+wKWhGF1u9YAMPixcZHHnjGBTP5ntdw/WdugpYrrWmX+F/QsjdFM/H/rH5ur+M6RViOXl7vvYkaJYxd1u1m1LKz5l3wvhLKbXCwFEURaTDPFr3Y2vJBdw09O2csvDGlPkGxTWDby5V6cjg2FauoEjDJVUisHo7WERGsZJvHV+VbTCM9W1xIvmdw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by AS4PR04MB9690.eurprd04.prod.outlook.com (2603:10a6:20b:4fd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Mon, 18 Nov 2024 07:04:30 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%5]) with mapi id 15.20.8158.019; Mon, 18 Nov 2024 07:04:30 +0000 Message-ID: Date: Mon, 18 Nov 2024 12:34:21 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 15/16] net/dpaa: fix bitmask truncation Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: sunil.kori@nxp.com, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , skori@marvell.com, Nipun Gupta References: <20241115060738.313190-1-stephen@networkplumber.org> <20241115060738.313190-16-stephen@networkplumber.org> From: Hemant Agrawal In-Reply-To: <20241115060738.313190-16-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI2PR01CA0037.apcprd01.prod.exchangelabs.com (2603:1096:4:193::9) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AS4PR04MB9690:EE_ X-MS-Office365-Filtering-Correlation-Id: deba8226-a672-43e9-1c82-08dd079f3f39 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?U3l4ck5BaDFnQ085N01JSzNoRXBZM3NHM01lVHZJQlZqbUY5LzBoTENxMVdl?= =?utf-8?B?ZkZLbGo1QkxFaUU0ZlJBSEIyTUJYcm9xczgvdm4rQi82WFJMQzB3ZG9qMkt0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dDY00zMElJeDdHRU5lckls?= =?utf-8?B?ZE42MFlUWmc0cjZkRFNvb0w4S2NjYXVIQ0NLMWovUmE0MU1JR2xmb1ZSUDN0?= =?utf-8?B?R0UxcTRFWGd3dDNab0E3djA2bUtSRnFEQkRuMHdidHc1ZU54aFBpZVZKVnNa?= =?utf-8?B?R2psSkhUWk4xVGhmVDl0STlUQlVQc2J6WTNuM3NBM3VEdjhoK2dGWllLMWhn?= =?utf-8?B?cTdpbk14WWdMaWROTmdpbmNDMVlIdHVRZ0NPaVg1d1hpV3FlWStBK25odWJ6?= =?utf-8?B?TFRNelRJYVBCd2RnWmZ4NDZBYmZTTGJEVVdjalhpTHo3OW1pM2JLWWZKMkZG?= =?utf-8?B?NTJ0ZE52d2ZzNXBUWEJTUWg5SlF3MnVHdVFWRTR3c0x6b2dYSHpVSU0xcVdK?= =?utf-8?B?WjVZbEdtbUZkamd0Z0I4bTVRd2pwSEp5L2ZRVnJ1UnNRMHJqVGNQMXZhVGZD?= =?utf-8?B?WWxWYjRNSWFBZis3REpicXlUY3VpZXBleEtjdTNVZDNnc2w4VkswbVNpdHVN?= =?utf-8?B?dnVzckdlSUNqNE9FbXAwTXVWRUFnb1YrTzk1OWZWOVRoZzZ1cnRGUXRPUVJK?= =?utf-8?B?aVpSKzIrTkhVNjdRSXgrZlprOWtzVUY4ODlCMnZiZ1krNWJOR1dZTTBTbGVU?= =?utf-8?B?MjRza3FXRkZaemJSUEtBK3NHVXJSVjJHblJKK25ra3dQKzNYYlRMR25Hb2FO?= =?utf-8?Q?OVx1DZDVIWmCnT8Pf163?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-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yLzB1N0Ezblg1NGlYVHRz?= =?utf-8?B?elZvaStmWE1nNkdFV29vMFFxU0hvVE0xb2NZSHBnWlI1UVZNZktwTEVmYmFW?= =?utf-8?B?OUgrVld3MkZTN2RVNGVJRnVoa21HaS9pcituT3V2YUZTbTlnMjQ3SDZFNXFt?= =?utf-8?B?eFJFN3FnNC9CdG9KUEdPVWJqQmorbXJhTE5iYmNVUVAxa2ZBZWtZMzM0R1Fl?= =?utf-8?B?RXowTEpCQW9NWjVHZ0hQSkd0VzY2enhhNys1OTM5bVppMVg3MjRuQUpHVHFr?= =?utf-8?B?Y2JXcVNOdjUxcnFLRmllSmg3R3hSSlZTZGhPL1NlSENlcnB3Zkk0VUg0UDNy?= =?utf-8?B?OEhvQkdtaVNBVXhLbVptZThNd0pvcDE1dmZOcld3SS80Z2Z3RnMwSzYzaXdq?= =?utf-8?B?bWc9PQ==?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: deba8226-a672-43e9-1c82-08dd079f3f39 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 07:04:30.1128 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BZfz3kMZ+q5TH6Y6wbI1NIbpSTQKJe25FYsMyi4+HX+4CsDZrR/rS3AS0zZLYaQ4wT1/UTno3lizyVf4duw9LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9690 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 Acked-by: Hemant Agrawal On 15-11-2024 11:35, Stephen Hemminger wrote: > The dqrr_held mask is 64 bit but updates were getting truncated > because 1 is of type int (32 bit) and the result shift of int is of > type int (32 bit); therefore any value >= 32 would get truncated. > > Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ > > Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev") > Cc: sunil.kori@nxp.com > Cc: stable@dpdk.org > > Signed-off-by: Stephen Hemminger > --- > drivers/net/dpaa/dpaa_rxtx.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c > index 247e7b92ba..05bd73becf 100644 > --- a/drivers/net/dpaa/dpaa_rxtx.c > +++ b/drivers/net/dpaa/dpaa_rxtx.c > @@ -842,7 +842,7 @@ dpaa_rx_cb_atomic(void *event, > /* Save active dqrr entries */ > index = DQRR_PTR2IDX(dqrr); > DPAA_PER_LCORE_DQRR_SIZE++; > - DPAA_PER_LCORE_DQRR_HELD |= 1 << index; > + DPAA_PER_LCORE_DQRR_HELD |= UINT64_C(1) << index; > DPAA_PER_LCORE_DQRR_MBUF(index) = mbuf; > ev->impl_opaque = index + 1; > *dpaa_seqn(mbuf) = (uint32_t)index + 1; > @@ -1338,13 +1338,12 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) > seqn = *dpaa_seqn(mbuf); > if (seqn != DPAA_INVALID_MBUF_SEQN) { > index = seqn - 1; > - if (DPAA_PER_LCORE_DQRR_HELD & (1 << index)) { > + if (DPAA_PER_LCORE_DQRR_HELD & (UINT64_C(1) << index)) { > flags[loop] = > ((index & QM_EQCR_DCA_IDXMASK) << 8); > flags[loop] |= QMAN_ENQUEUE_FLAG_DCA; > DPAA_PER_LCORE_DQRR_SIZE--; > - DPAA_PER_LCORE_DQRR_HELD &= > - ~(1 << index); > + DPAA_PER_LCORE_DQRR_HELD &= ~(UINT64_C(1) << index); > } > } >