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 44D8345A67; Mon, 30 Sep 2024 12:30:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 196F34060C; Mon, 30 Sep 2024 12:30:17 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2072.outbound.protection.outlook.com [40.107.20.72]) by mails.dpdk.org (Postfix) with ESMTP id A08F2402A3; Mon, 30 Sep 2024 12:30:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t/UbwgCLITMsGtEt4PP3qgAUg2nPGKC49jQkI5SSoMO2kO9AySRB5RyJhnGgSp0zSx8nmK9rBDEtOKEhaSX2cpPLt+qtDX1O9s9+IE5/BUvGg0cUq6OFIdpWsEYDElcigW95+1BmzTptd64JM2YvYNdpr8UqM75LR62mFZIjxs1cXu+9cOjp77KDrSekuMYlS0FOAy53PFz9ujW7dqj9VxhmjJFJuOSzfamIZB3WV+zr2ZGcMxUf1D4NZXq4/c5XJF9Xq0hpcHUW0c9mBh4LwS9LJQBMIJR2rLl7ZDI2NBXZowuhUoR9fn3Xt6+CIjE+fHaFk6U5K8OcKbB0Xdx3Eg== 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=noY8QGgiTLrTS9klUK6F8T4GPpeqd74+wPqONwOgWeHoTyvTk+1ycMeTZeO1kp8rEUtHEQQPYLcxVrDvaNBvxOOeECZYXYhz8MZhADG1k/vwE8uvXck9Ac8y2pM1tYfxvj6Q3fNWNJU7WelQE8dTvJg3oYizjIhelOEIPTFzBpfC+wVHOE/7KafUJx+eTs0HX84y4EcXgUZBXM6gh5cTWxUX+dXQeyYMVWXynf9+ZmqPxAGNEjVDyLh6N272SJQO6VmMYXUAaygfTO9gFvs7CTN9K3sICEuRx5bSQS7Ug8GjEueREVlSX2jeWUlaXto+oo+WAM8jcIvQ9aVo7sfR5Q== 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=TqxhkHFtEH8JtJyCN83TEmzMu6aYacSuJdHbd5zoRwZGQ2HRIIjlGwqokyjfPGuOZEDiXDjpPi4Gpj5gzkYxVd8xHXRCrVI+5jo8Cclb2IG+xXIV4AkmklkMnNjCToBHGzWLsRFMthDaPGf+GpIm/fBaQr/AG9+sVo1HvXGnFGeTJpclYGnc0XTk4JymdusKetRlB7KBPEOvaMIRTzKfpPV9lQ06rahcFBNWL4HIzPwE44xi5ijRTjJdX0ss9HyNiyf6UBm/A/7pDAmye7t7upTakkiePl4GpF86TFXxN/A0Lhk8hEgwNwZXEolcaWFsQdLZ7sp0avDsMGWsZLa4yQ== 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 VI0PR04MB10161.eurprd04.prod.outlook.com (2603:10a6:800:242::6) 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 10:30:05 +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 10:30:05 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Rohit Raj , hemant.agrawal@nxp.com, stable@dpdk.org Subject: [PATCH v3 02/18] net/dpaa: fix typecasting ch ID to u32 Date: Mon, 30 Sep 2024 15:59:30 +0530 Message-Id: <20240930102946.3236998-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930102946.3236998-1-hemant.agrawal@nxp.com> References: <20240823073240.3708320-1-hemant.agrawal@nxp.com> <20240930102946.3236998-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::14) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|VI0PR04MB10161:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ae1129b-7393-4695-0a6b-08dce13ad96d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rSuU+cbZz5Gkp2zYKCQ91H9kYuBcu1cV2QcZh8VrHCDsFSfolS1PwZBDaWv/?= =?us-ascii?Q?c0S0zceyOVtWH24QQ38RsjYPFy9S8GrliL/yhilgnMSQYnIoPWKdG4E1kBPt?= =?us-ascii?Q?smhUsVfDpDDHmLG9PM/D6xyXKjkhBOEXLf6fQvMt/4Q6mUEh3VTMfSOL0gaN?= =?us-ascii?Q?tDK7ILbI0LUgDDUq22dIhh9VAGM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us-ascii?Q?b89h6yIU3aWEk7cuzd7hwnW0H1Gfh9FvCyppcMYDJ6jmNcVFOBjpe1FWx54S?= =?us-ascii?Q?klGOQxF9+MRSXNJ3Xx8rR8wSZtlFmI4aO+o/S5jMQIIwM8lhyFW5TiwHIFci?= =?us-ascii?Q?0oRDuemkOOh971PYB81IRn74veAtgm0j6DHUYZHzRspjZvJ2VAr0corHANnU?= =?us-ascii?Q?5ooot7RUrbBzELdG7rRt8oxk64X6ADm7Xv2LXvscB6pMDlCB9I3w+4Fyq8k5?= =?us-ascii?Q?nOvickdPxVCUAmP6ozGZU/VywTKxYhFclQKyCn0v/pCPUw=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)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rRZI4w6SgTPMzbw4qWoWGQhZ0AA49qH6YsNjd6qZrhNzxAYyt798kwPyrDfT?= =?us-ascii?Q?528nm2lU7Q7XIjejdlpZNrA7cJE0JR/LjduzXqLfP4bBA+kmGBDLWUKtq2E4?= =?us-ascii?Q?rXNueoP6eAdnIYUaEh1UruU6rDp9ezNoBO3TQi9bWmdLe+rGgDgg8Yo9ABrd?= =?us-ascii?Q?A3BhNAp4p5sbC8LUrF2cMXawcLZkSSisxxsDMG+ukV4Kdat1Y+BGyF8J0+RP?= =?us-ascii?Q?68+3Nup21l5qr6nRjKryQziBbpU++v/34hK6GfXJFrnxa02zkBwbVTSHBwC8?= =?us-ascii?Q?bEgFVoPw4a2IplLvEkpze19FHxyRtQqNAFNkH9b4NDQeBht29vwLqk6dLHpq?= =?us-ascii?Q?iAJMSIvmz5SaVDSNUmNLqnuzdr63ucz/98IPOPHAmArWC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guF2piOclFxf2elJxZDs8ZWpL8cmku1FCXND73hWeK1i30yxNmUWUYvuO?= =?us-ascii?Q?Dho0j1UHGBANF/VWQEJqiCEAx9oCtsA6KvyKrZYqWmqTGMPv3xCgvPQY8QT7?= =?us-ascii?Q?xRF8AjhxPJyOJ/tNlRG9ImmBheqIStY+iiHeh1jXtACxh3/PgvmpFfk05Iy2?= =?us-ascii?Q?hgpVXPoniHyCZCvScWTDomF3b4AfkqglRF8UWV5oQ448DXErnE4kJfkqZZGr?= =?us-ascii?Q?vDRNvvJv6GZ/avMcWQxa6qlIyVsqSdrG7x0stYJR8vZ/JUviwrn/W+vUUoRM?= =?us-ascii?Q?lSALaUuVhVJj0dB9WsJbe+qz2C6vuHuhzmTSoc/HlTl1Vis68CbcGurH3neY?= =?us-ascii?Q?MA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ae1129b-7393-4695-0a6b-08dce13ad96d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 10:30:05.3330 (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: mL3wggV2qpTjS31HAxiUZS9DxI4r+vA9cP2BpHF8JI7t5h6835zgo57ilSKcnG1cR8Dpjw/eu32GfuT0jYgOKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10161 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 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