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 766DB45A69 for ; Mon, 30 Sep 2024 14:16:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69C13402BE; Mon, 30 Sep 2024 14:16:11 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2040.outbound.protection.outlook.com [40.107.241.40]) by mails.dpdk.org (Postfix) with ESMTP id 904114027D; Mon, 30 Sep 2024 14:16:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wH63P1TPTxs1ltIAMgNnPFGfIBnDb53e5gH6nbzYya8Jx2JcVDc4XhxYrhmQVTnSrMr/sbOtPU1Eq72qLFAaphRz2Kg7jo3WqljqWa5oAmwnAq4xY9b8yufctO9MyDZ3GCHCJA8VJEgrr7gJHMB9nEvgrxz72FnUnqCAJiMj6e/d/+TnymLC2LvN+q7ZElXmHtOBwHTnYZisgSSeZyB8TkDY62iGWsusx7FpeaRnKT3Ku+uMYOJQ4bjZoeXW6hhX+Way85CPf/LI648WKIDc5+8mbD/c3VPCZQi+k/13dikwZR8Onvnf2mIsCKADz1LzuahdtPh+5xKfyrnf3sOmIA== 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=XjFuK3lqieS1W/neGs6rk+WevvnQIJYA5epg+/rrgzGoXIJFuM9kmCvELQ5ctv5B+1pbE8khijx1Mwhz3JyGsSsg5Vu8O0BWx4SUHMMFbeo5Wmbng2HA4e9+c0Dedtbbco7bZ+GQtN9YNe7jwpJRqU+ZWDZrHd81QShS5oqcPW8SERufKHD9vqDV8dYScfllCX5+Zs3FTN0B8JY99kLRTHbzj9Bn8E8U33NEVkYJlc784Sgp2G00D087GlQBZH2mhqtS8VQUTn0R3rzqgaacaXVxV74J/eCQq4eCpiOF6wFJZULFU0CFbWUZ5iN14kb+2gIqIlVzwwRJdFjZSJk/Mw== 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=UwZeICcRq/pf7ZwHNSSaQXW+jL/gIM6LdkToAElCiznwQ7Y3MAV454pD/GJCztatyhQrgBNFJohz0g7oFTn8dsCDCoUV4NeCA6oHLxfO5xJQvl2fGsRVVm3eoukKcCnQr3VzIOVFCDcZNSirsDYVf+Wh1lDfMgHDa2+MiHHs7PH4GRPWB/Yg7SpE0RuvOGfbJR1smcBKfTXUEfcQLKGLyjAeeqJoUIEYx8OX7qJyfgW9udoCKdif1hPt5PI8T5z7EVinNGWgl2XP4qqsEll3YAjjMTpux7uFkU6iVPEx4t15bIs8vYbn8e6d6Nv62duSg9L/R+VuVfFuMerGQawtfg== 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 PAXPR04MB8334.eurprd04.prod.outlook.com (2603:10a6:102:1cc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 12:16:09 +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; Mon, 30 Sep 2024 12:16:09 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Rohit Raj , hemant.agrawal@nxp.com, stable@dpdk.org Subject: [PATCH v4 02/18] net/dpaa: fix typecasting ch ID to u32 Date: Mon, 30 Sep 2024 17:45:09 +0530 Message-Id: <20240930121525.3452847-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930121525.3452847-1-hemant.agrawal@nxp.com> References: <20240823073240.3708320-1-hemant.agrawal@nxp.com> <20240930121525.3452847-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0124.apcprd01.prod.exchangelabs.com (2603:1096:4:40::28) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|PAXPR04MB8334:EE_ X-MS-Office365-Filtering-Correlation-Id: 5931566d-d79f-4c38-8f3d-08dce149aa97 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?aCg73WVMCi8ZoaXMyKm6eNFWWRAwB7wv5FC8EIMMM+I8tJ5jfudCtjaSdK84?= =?us-ascii?Q?mcFPdD2qGrTzqbcvzjfxlayR5Q/CquShdb100tsCmpIgWBq+gWYz+yhrw9TM?= =?us-ascii?Q?0YhUMmRDcjhtdS/RboSA827tlBWO/qhoV5SEWHPtalVPjTKzqfMlVzsPX6vU?= =?us-ascii?Q?UdMOAEXl7iUFfFSswydnS1xMCaoWfchQFr6oVWqY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shQCOReMCbJatu6U0NabCoZEVnNj3tS6LnR4Kn3b?= =?us-ascii?Q?wvwZ4OycAejzZloLRr/oOhbyDRath9s/ZBaRUD2YQkG5V528xoK5sGo1PXVT?= =?us-ascii?Q?lxSMVzaX0FFcGwxDtOvQgy22Nd3i36O7KyX/1wtnTalvYeRWfu/QN+kMG9W1?= =?us-ascii?Q?LyJhZlTkCkTgrjTqu4iff58HjhxZxVhuk9D3mnip+y3QjjItbcDFV98g2cYZ?= =?us-ascii?Q?sI7sSoH24cKxHqBwUQSqzj+HYnzkmSi5Ej7DaTqpsIY8PA=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?js4IIxSe3HtvakGdVrT4n0uSaM0pqPVXANIbkFtMSUit9Zto8Tm2RdMIdV0A?= =?us-ascii?Q?0HKM1Rj9XW+HPMu/6QOs764xBDI8Q1xY/X+YI4uf5CZH2X+94/55QI+iAi+I?= =?us-ascii?Q?3eAEVheWmeicatsEy5pbUcedmMcEU4p/7csQiuenm5EWL1hzuQQ9VilPqqtM?= =?us-ascii?Q?RwO6B8GFknJHNhci78ID3nG1kzR2PfKy5tdxJKR9BO0T971/silPNqMNt8sp?= =?us-ascii?Q?/3oXByedwrLW9OIlw3wESK2HS4PbzPmeAASP5hnP1yAMmdgNM1e6FDgja4sY?= =?us-ascii?Q?hnWh3bWN+yJbWBJj9bCS4inD5fCS86zQ7AWJv19LVa4h2YkYYY5mb5Hni/Zk?= =?us-ascii?Q?klC6VQkdkGqSjxniz2IuC9GhHxZv8MHOALi5dSLuhkApAU25GT4orGgvF6mI?= =?us-ascii?Q?rBpRe6j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RyGJRKIVdG07lNt/V?= =?us-ascii?Q?xs3ayEvFc+mhy5cAuF3OKSYk4M9uR1Ya/slnaDr1iEeQXZthKz88HG+/nXme?= =?us-ascii?Q?xSBSwiVZ429lXc0dUEZCETaGZHFQHKmx5kWQ5eQ5RGJ76+cFgnFOe+IqF1Hk?= =?us-ascii?Q?zEBA5Dt+nQagtCb0olV+YwZLNOzyi2AljcKF8qrBDlmVdvznviO7KVRhpLI9?= =?us-ascii?Q?YArd+qCnsRB6+5Kmd9gj/JrUNYLJmeSJW0lCbT/3JSXrtneOdfXHDzZqE92J?= =?us-ascii?Q?JvEAqlghiWfJu9h5gFhjq/XeAn6xZ1oWMOaKd2dEoomZBpM6kKosbdJOIW14?= =?us-ascii?Q?Bg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5931566d-d79f-4c38-8f3d-08dce149aa97 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 12:16:09.2205 (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: YTIZtFPp/5Y77iykQmS1sq0ticBoUPd5Df5Y1QeQ7XOjjoJzqUpt2kUrNxQcHDaAFDIpk5e25Hr1fL7mb17MsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8334 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