Message ID | 20240801105313.630280-3-hemant.agrawal@nxp.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Ferruh Yigit |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4425545710; Thu, 1 Aug 2024 12:53:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 356404336F; Thu, 1 Aug 2024 12:53:35 +0200 (CEST) Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011019.outbound.protection.outlook.com [52.101.65.19]) by mails.dpdk.org (Postfix) with ESMTP id B4BAA432B0; Thu, 1 Aug 2024 12:53:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c1K6XUj62b+4wpn8IXeyGkp4Aa8QWoClYwPrYdblas2BLnV3bH3kjNVSpvYZwTCL9YkNmvluyfrmJ7a6iTixK+BcpRBCx48JmLxmkdSKRQ/AbIn7wJsaneAeeybFQZIYEqnZOAiyCDNvsV/xkqYky7IxQU+PyA1HsFeWX2J8PcRBIcs2urCVnIHxyTA3k3VCaoiR7aNcZxIb41xwReMcGF6NhNWk70aW5aeP1uRNywoTCIxdeqkO4nNR4Hrn9SDVKxO4kg27G25RDYzeGEvc9x0DY7/XPSpsQG/AOkyvu7yZA8ZFG2zzKqcOR5JTS54nA5POI0J8I8wmBNh3h9px6g== 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=3Lb8EfqZZPQm/j9MCtAb8D8Yrh/1MKk2R2FaQFsqf08=; b=soeECz0KBoxfBlob0IUbCd9CakEGFR0fukyxuupPQgT0qGmCf6bFU+SFeNKVbF2wZ+Os2Ev2CvcfjlTNpT5ltjDefqSupeOjDCrD6lbpE1sPFEtAuq/kiR9tYMdscwi6TUP3fvYXmvvMnscp0bqceIdSs5vyP63F5Ad5HrSweKPxQZuf7E65wYrGJhaRgz9CiIb7jmNx/jU8N9iuhp349HSxiTc7mqLVw4heV7RCaS0P/3w9hzWY868Y75XjEN4qOpt6DkuAHvHfdyFdkvWW1Gwfk8OEp2edSnbFaIkTHxu8yIk34FaEXsuZG4Z/38Tn0O49+MZ8irwYiQ4CzC2RYw== 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=3Lb8EfqZZPQm/j9MCtAb8D8Yrh/1MKk2R2FaQFsqf08=; b=a3KFbpqrCRoWG03xyCRfQ7O/Mil3SKb6ve5kc+apMih7pjm089krGL/7EjvJLytVJSYurRetI5e11Jop+N/PZLKOK1T24qwqgUyOMf+xcqqE/acHINBKQ3vwqYOXvQeKc29Yg/VJ2NJQBBUHqzLlz9bmfESNOy7kl56y3sb3w6YZhoo0vO2tMswLYVedHb5ibCv42iRLJQTWrevu3gksN3LiD5JM9rlev7wcKOGb1ZSbiPRbZO6CfMJynuoMThi8W64butctB3fREh4RgoBF1WorxXB7ne8GQG3oufyR3Mxi1c6htIowaFgHa/08iho+aussQNCGuulE5He79HVzUw== 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 AS8PR04MB8433.eurprd04.prod.outlook.com (2603:10a6:20b:407::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Thu, 1 Aug 2024 10:53:31 +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.7828.021; Thu, 1 Aug 2024 10:53:31 +0000 From: Hemant Agrawal <hemant.agrawal@nxp.com> To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Rohit Raj <rohit.raj@nxp.com>, hemant.agrawal@nxp.com, stable@dpdk.org Subject: [PATCH 02/17] net/dpaa: fix typecasting ch ID to u32 Date: Thu, 1 Aug 2024 16:22:58 +0530 Message-Id: <20240801105313.630280-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240801105313.630280-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0026.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::13) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AS8PR04MB8433:EE_ X-MS-Office365-Filtering-Correlation-Id: ac2a31b1-c511-4844-fedb-08dcb2182e77 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: xGfZ56J5hyx18dOr33GiB/E/Me9LkyFuWvVrAo+rLtM8SUnWfN7h9hP5UyUkZEWcYH7uPTQnbKmzG6H5n25yJwprNcfCScQtBGrFahw/xE4Sd3Kg2hvI112Irkb24RoizXoTumBQ0EoGZKRx3H31YcqtpK0zpiCwPp57NOqdDhER4QIi3e0f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dXeikaKikJGsSHK9cIJNwHFvBS44Sjyvek8DNVEhTd5of3p4yGrNl6DAE/39roOZOqjNc4sB7bmREbFwHyKYYzVBdQysAAZkPq8G72rRQbsfmgNNAp1KuaTfPOpbNQGpCfNHCf78mgjGtRLbUmDCFJO+Na7kMdLaxUBXOzTFO1RIug== 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)(366016)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F+sj2+O56YK6MF4J0Bf8nrES+m6+1qGoCs76q5YZfXhLBypwN0IT7fVyzhWYxxa/cnqCIjkh9CKOxQicn/bMD+HqCkP4E7OPN0BXkhll5eM2iXGoiLAb52Ud0VZLED7zGu4hyNaefjzC1/1fHCupILG/A4r9EIwkLFTdzXUJusRyJUOdhGLe42cqPngjSdunmye313eDrDAMSKO9G/la8zIGNEhpxDFBHPk9C4xLLYzphqJC8CkQfVdP7QQgUTz18fYyrAXUj5IwGpsXS0JOJm6K6fgKJGW9fC88Q/+SL4ehzphLT6H9mxMv/qw/Q27JeDTFWsPUUqJLFlukIGU298UTv0m9H7wO76CIbhkVKJXh8sFDOHjlfqAVuPisRWOA58a77N5olTQA7CCHCJ3aJb7u0x61odZwdm677X3DQGA0vQ8pDQoTQRqurWXN0bMJGZJQxfrG+4cSlSMQsMxRvazdHbfTWzB9rU59NT/cWfgEjDFN2ST2bTmJbh4YhP7nIhc5DyAOsYtrWEyyys/OA8+v7Z5p6nm9H+PybqyB3s8PlysxiLTe/jioOLwdMg5FK5tZZyIp6nu3wz5a4FjxJzfTsmG0Lhvs382WsqulZwK8xWXM7Nv7HvrX8npq52c9InEM8CIcAXnoM+JwGe2p/we49Oaodwr03+UhvOxM+9PFt2KjNawVTcAoWwO8UNy3z4xanW7+9E0lRaEubJWhgwy8fXGhgeeKA8J6j2AOfAf9LatvrWpB5qiLzBIGfmXaPsx5j6vOW9DLaDkLVPBYGfJVpLulKM39bd1mYAtxgBbnr97WyjqKrLM+Km66Ft14BmO3bAt09Rf4w6NwQfOSakp6O+a4k1envmzyrB26ET4GWmvnyMUYVL5QLRXf4FyBUASvfMINWikN/4aEWy8tzrH5q3aNaPlWDXWqRnrRmib1+8g/7V4fIFPP+FHlX+cZSCHCi2aShKYJNJy1RWwRibI+93yhapVBpN4Kyc1nTjCxksHtMbNfYF6tzfC/RaIVpSPsuNqDNK5DL8Jej1NGw6K6FTiio6AL0W4BTTwzs01+RIYFPBMsqSRrwG0L8w1sUrGJCbho/HUKtJoHNYNOmU9qnodPzJAaB9+wsPFmmCbRFDL9j5YScphXJa19cSNsGgXzrKCM9LSPoHh1UDzkKbmNSkgTdRQxirbpGwyJdcaT23Ug3o0pkiolDSZiYBcTgcvmthRwLg/yPRdWUbtaTzWU6CpMzNU0QuUCm/PA8Yco0hjN/V6wZWTcBHdetuWXxCU83+FELImlWVXSnTaCUCBICPklhy6+Cu1fwY//v3Fj2SHXQTg3s8g/WkmyaqwDjV7Pf3DJHGHzdzqYaJjuDemeExQ1g5W9wNEH3YBD3OcT3CGYEkSw15Ov4xqk7wwyPSsHOBQYpt29d9NBEWn9CZFrvz5D+0/1nyEKWWBBi0l++W7ArQdAQ88b3VJpTSx0+o7C2mstlzWft7LefeUqfJRlAB7yIhVefX73TsIVULIjB+CsfHVLgHzvJDkoei512AWdOb3t8wDZBcIVB8e8EO4bNT0U874SR0eJ3Qi46FglELXyKBEXEtJeHzStdBi5tFwwraAiMe7zD5T5UDXH0g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac2a31b1-c511-4844-fedb-08dcb2182e77 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 10:53:30.9888 (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: dCoEgHbwena2b25rxSHrFtpP9d9ehYQSHTxJwLXU7yJss6jrHDHPTlYpp8ZJGWIAALRLwsPFLNcOHvhdiK1pRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8433 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
NXP DPAA ETH driver enhancement and fixes
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Hemant Agrawal
Aug. 1, 2024, 10:52 a.m. UTC
From: Rohit Raj <rohit.raj@nxp.com> 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. NXP CID: 27996293 Fixes: 0c504f6950b6 ("net/dpaa: support push mode") Cc: hemant.agrawal@nxp.com Cc: stable@dpdk.org Signed-off-by: Rohit Raj <rohit.raj@nxp.com> --- drivers/net/dpaa/dpaa_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On 8/1/2024 11:52 AM, Hemant Agrawal wrote: > From: Rohit Raj <rohit.raj@nxp.com> > > 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. > Ack on the issue and the solution. > NXP CID: 27996293 > internal tracking id can be dropped > Fixes: 0c504f6950b6 ("net/dpaa: support push mode") > Cc: hemant.agrawal@nxp.com > Cc: stable@dpdk.org > > Signed-off-by: Rohit Raj <rohit.raj@nxp.com> > <...>
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;