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 ABA6545A7A for ; Tue, 1 Oct 2024 13:03:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 235284065F; Tue, 1 Oct 2024 13:03:49 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010061.outbound.protection.outlook.com [52.101.69.61]) by mails.dpdk.org (Postfix) with ESMTP id 0B5994064A; Tue, 1 Oct 2024 13:03:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O+y2lvPMMYk9ozV1ziSCnelZ0wlWjGmYqc1ey1cHlbTlFEagy2clx6Bl0ADwDOAbqWIhd5Xx0GYni804frEagIVj2bPY/pNWa+++RMo2+GSXkr4zPrAru5xMvl7h5eGc4FrNskrSb7M+NbhTqIemRcqHL5BVUYCw/10kdsw/G5FpLLU82LbAT5/mzGnDpdHZmU1Kob/Zsy/R+/CyWYE6leenp3OzH4yLlKJ1tEAYzUvuzyXmnSC01RCzHz7M+xd/odS359dcHAibnlvE2+QmkIU/urJOmKuSFn7HZMb2NsGec3zrrCyar65lqZHDEiMfDRRkkk7XnAOSxZhB98awTg== 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=R6q42HsQFrqqj18IvhDZnpZvE2lWAJfJ8Ciiv01ZGGU=; b=bmecgrq0aHLcJbJSC2Wrzb67OxPiiAbVnKdyjBh/hy/GQdD7tootYjNdO11FJmyK8jWXpXvn+JspJiAJIyvdWItDWRo6WliGv7g97kw23Sp96TLGuWagCxQGcTLWXVbR9PxFQvh458PvkzSCVFfbZla2ZFqhbeholAr5DIKTQSBW+h3Oi2JFo/iW9yF4B5Bf9yJ9JH7Jznw30YIji+U/alyMHKCgN+hFSnjpCq52Cj6duqYp8C3zcj1BllFD+i+Y30+pBTjjBSKnpQg1/wnaTEuEnRlPuBS0boGmzvthkLM0YFWz92qOpjEosmA/XWL4fEkhcvV9/6vbDRY7EybO3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R6q42HsQFrqqj18IvhDZnpZvE2lWAJfJ8Ciiv01ZGGU=; b=i1zHRq9xJyOD4gd+f0yK5eAT66hNXNvfV6xRkOg/sHNfe4iC7fup0AJPM5tdAA7fm+Tw95OnUrZ1sBgM7q64jpF3vNyGz01PQmy0VcD46Mj2/VmCT2DIoJvka2VlQMJUxe4bFtzOtbHxQyGbZoItfFvzXI0scsfJfyu1kwtc05axGq3qDb5Kg3A7DMYzUTE8JnLob/Xw7x48p5uKOVc7abYxrtGyZfXzmduglWWxDU5ZrbrYkPo5EhK3CiaRk9ZOT9krC7KKqIY7sQHAym3L8E78WwB0FwSjdn7ld7M181p4a5K+0jb7KOcKJUT5jk2Ao0eMSvSBB70ABcKkYMQ27Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by DBBPR04MB7724.eurprd04.prod.outlook.com (2603:10a6:10:209::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Tue, 1 Oct 2024 11:03:45 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.8005.026; Tue, 1 Oct 2024 11:03:45 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Rohit Raj , hemant.agrawal@nxp.com, stable@dpdk.org Subject: [PATCH v5 02/18] net/dpaa: fix typecasting ch ID to u32 Date: Tue, 1 Oct 2024 16:33:09 +0530 Message-Id: <20241001110325.4173762-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241001110325.4173762-1-hemant.agrawal@nxp.com> References: <20240930121525.3452847-1-hemant.agrawal@nxp.com> <20241001110325.4173762-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0086.apcprd02.prod.outlook.com (2603:1096:4:90::26) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|DBBPR04MB7724:EE_ X-MS-Office365-Filtering-Correlation-Id: c468ff99-0d57-490b-1bbe-08dce208b79f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?91+0/7ApYcq69BAOPGfh0So20uDvyuzQ5inrOjEVc08/Rw27dSCV1J2A83vA?= =?us-ascii?Q?e2yTDZkyKNC6x/7XuZIvdvL7qedu6N5KlaBh+1lrqKU1on0wOVs7BvIAIdxh?= =?us-ascii?Q?ycEE6b1S5cQgxiCVakbXYrjQbJdIJJqRwXF+7Yel2k/myEB/o1NUcECI0Rqv?= =?us-ascii?Q?5oxirV9nFLkDCDCRJmuhMel+UEfv7d+ABu43nQfSWpBiZnoctPLI7S6FQQNU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Cjd0P1ppFnrZcVRHK8VKL77xeIEa?= =?us-ascii?Q?RURdbAoFsHgcok3ncx+N7F+6wjDCykKkCtyNnBoP2VK8mXKwu48mQxSVK25I?= =?us-ascii?Q?dkkT6dcnXab+rCURKPJvL2bYltvKwbRztukbGeMswI/A2JN4Ju5aOm+swZFO?= =?us-ascii?Q?6h003xKKs0Xa23IIIaew7XrvrKJ+KYdkNdPYBMtiaINvtZC0Js2z/nnaCofv?= =?us-ascii?Q?+avNSZMwu/y/irkZ6i1An84w46/1tKf9qJfshpiD48/Eeg=3D=3D?= 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)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?C0J45F0VVfLkX4JM79McKtse+RLbyugXIvEERxKmBR8z1sFBZaXRpJ7Ioa2D?= =?us-ascii?Q?6qFOcSTSk6QH0KLHjZ7QUwMtcWMd7HUoyCvefWAHNDHyy5shlfBJdg26CDvH?= =?us-ascii?Q?CDGBU3kzfo6eoEIYPf3nXEi5bgihNY2qgSydjkAONsihvoclUp9eoWGp1KHO?= =?us-ascii?Q?frN/qM8dpdbnEcIC8KENpHco7Q/jf8CbZIo1sd3n9XHy/pXyFARZ7UYD3SA9?= =?us-ascii?Q?6a5MV2f9EFa3O2uSFyv0fYqGeenF64vS32Elq28dPlWBBgyR8ngAy+/uFRJF?= =?us-ascii?Q?VuZKH30XSEUaA5c0BtK9N9ks/VN47pWWIzCmjiz2UZj5k3hmxP0lr9wsDyPI?= =?us-ascii?Q?fmBe0jXs4LvNuO0VeZTO6iRn17nRNOz+oFzn5+k0503VyxIB2dL9BHD6v/z5?= =?us-ascii?Q?hvVI9KwqcY2RMu2GvF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QPyRB54M?= =?us-ascii?Q?8+eEoK2iX8odfobEbF/MDSwrF2YbuWwhQ/IUrlppBrP4XcQKbAGsXQCt/JRH?= =?us-ascii?Q?tYyiz//rT9K+IHlAruIOENC4ZwxgSZPFkR5ISwmLlI/YgY+UxhMW/X1sP23W?= =?us-ascii?Q?aj53SkTPDlMD0Fw2nNkCPekcHy7ArfpmX9LH3zQtt9o64OhXMkgVQqaEqfwB?= =?us-ascii?Q?+tJwdg89Ruxt7ZCZfNYMbk8Mk6Gw8unZQclvLrDtpr17Eo2v+q7tCy+Yo11B?= =?us-ascii?Q?6wnj7KnqfIJNR8L81uysWB4iLYdNGZBqDNk88sQMsF8IEeAjEvo5S6VpqA3t?= =?us-ascii?Q?Rg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c468ff99-0d57-490b-1bbe-08dce208b79f X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2024 11:03:44.9854 (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: o4HFWpvIop3IHA2czit1deHm9Elg3DLsuWAV8DO4WKshKC8VzRfZwhf4yFqmKuJGYBQG4IIR3DlUGc11L1kR4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7724 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: Rohit Raj Avoid typecasting ch_id to u32 and passing it to another API since it can corrupt other data. Instead, create new u32 variable and typecase it back to u16 after it gets updated by the API. Fixes: 0c504f6950b6 ("net/dpaa: support push mode") Cc: hemant.agrawal@nxp.com Cc: stable@dpdk.org Signed-off-by: Rohit Raj --- drivers/net/dpaa/dpaa_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 060b8c678f..1a2de5240f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -972,7 +972,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, struct fman_if *fif = dev->process_private; struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; struct qm_mcc_initfq opts = {0}; - u32 flags = 0; + u32 ch_id, flags = 0; int ret; u32 buffsz = rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; uint32_t max_rx_pktlen; @@ -1096,7 +1096,9 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, DPAA_IF_RX_CONTEXT_STASH; /*Create a channel and associate given queue with the channel*/ - qman_alloc_pool_range((u32 *)&rxq->ch_id, 1, 1, 0); + qman_alloc_pool_range(&ch_id, 1, 1, 0); + rxq->ch_id = (u16)ch_id; + opts.we_mask = opts.we_mask | QM_INITFQ_WE_DESTWQ; opts.fqd.dest.channel = rxq->ch_id; opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; -- 2.25.1