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 7F2F445E41 for ; Sat, 7 Dec 2024 09:03:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7449140E34; Sat, 7 Dec 2024 09:03:25 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2087.outbound.protection.outlook.com [40.107.92.87]) by mails.dpdk.org (Postfix) with ESMTP id 2C2F840613 for ; Sat, 7 Dec 2024 09:03:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lu7fem5mTvQCXudDec7kk8fm8Obdr4C4Uie/9cLkI790Zxi9bbwUzoVBj6F/wqj7h3yCJAbeZNR3LAsReUxzOZsAsewjSYlNmNHiiWmGSlo3/RR1C6JNkPoWAELZZzBVXkEjDEeDrnfWnnpFDDM6XDcUS/Uc0ONUYF4dhwhaK0SNCEgzRur9MJI2x1/mEPjiYD5qoXu/BWgAbyw8M4lilijQf58KwcKGlGJ6sWdySVz3hnjQXj7jNJSukz1SorjHLrFd73Pzi3xliLdVCiLJSiZQOQhlAwZuXnHv4WMp8ofojUNUAYxQrahyouhHAvS5U5koX5cK3NZQw2hk66QBkw== 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=HdCzi8D27e5KIAfHrDwXkOg8hJLwdpIOR7kA47jl5EA=; b=sfcTsxxKAhIieAGU4tvZFgqdE2xLDP/pvq6IR+Qy4rrJEJttfoTrvhgLJSNCIASg2b713Zxq7DvJf0HCEunHqD+VpyJ0eHuHJ4ExjJMd9I5ftsGKqKYGEKSwR9cMBZu+AoJMNAUZb0wV5zcP3+9zjy2cer7kg8qFiKUXmg2Dw7f3y61MsKyC8huT8ux7LocuBgY8I+qVVdH07JaLvqPaE8H+yIOxf4FxZspDV7csqPk+8T9WJhlSuEMT+WeOXtF4+M6rpPJRbFKF6npuXhjNEY5EyVZZZX/ylLb5c99Kl9Io37QnARKwJDdPGb/CdzLq8aNEl+MIDTTbK2Ig3P/2wQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=nxp.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HdCzi8D27e5KIAfHrDwXkOg8hJLwdpIOR7kA47jl5EA=; b=KJ+oUhi4X/iN2yEqEne/EfS0goEmWLDzFgUpJ2ds5JU8CJvz1VIAlTJSH1soGFlyGJ7xIrob2y+UVyH0X8AJNC9Yply8utklHtUw593o7oxu5eJ/TYdAt5jQpDvyizXMiPB9atdH28tNdWFW5NY9JCu4O3kx7FJI0c94NG7J2Dgv2MC2d4u6L/DixCTv5L72x5yCqUYJgvE3ASRT+rUbqFpw6Cn64bJKN1NBfOsZVCRsgkv6LSweJH/JPMG8SwCGZdp35/pkyVExbXmrGAbCVvXT960zFvbsWwKn9SInT/9T0UN836GzqAZ9prOsK2RcxeMQgJwXAHffBh39KneqxA== Received: from SJ0PR03CA0123.namprd03.prod.outlook.com (2603:10b6:a03:33c::8) by SN7PR12MB7345.namprd12.prod.outlook.com (2603:10b6:806:298::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.23; Sat, 7 Dec 2024 08:03:19 +0000 Received: from SJ1PEPF00001CE2.namprd05.prod.outlook.com (2603:10b6:a03:33c:cafe::bc) by SJ0PR03CA0123.outlook.office365.com (2603:10b6:a03:33c::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.11 via Frontend Transport; Sat, 7 Dec 2024 08:03:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CE2.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:03:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:03:10 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:03:08 -0800 From: Xueming Li To: Rohit Raj CC: Xueming Li , Hemant Agrawal , dpdk stable Subject: patch 'bus/fslmc: fix Coverity warnings in QBMAN' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 15:59:40 +0800 Message-ID: <20241207080055.488538-23-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE2:EE_|SN7PR12MB7345:EE_ X-MS-Office365-Filtering-Correlation-Id: d4257756-c81c-4318-b5b5-08dd16959c9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?aJaGC0Y0Ly8PyFTQGNf1zO+fCNPN04va2H+Me87nNgG2uCbzNRXeYNw8ZiYh?= =?us-ascii?Q?Mu7h/NvMOcaoIkFjYguXjNfQlbuk9D12WDR7RQHbMo8/NtuqYHgxUziouX4d?= =?us-ascii?Q?F9Ui2/J6AcAZyJrNCgTz5K97i8vut0h8e6ZCi7HOnOLpCY+hZY09VGw802MN?= =?us-ascii?Q?WeMobu9ngDzS0fJQ/bg9S0n/Vhdg0dI/YR3yzFKzhnJIiuHfigTHLdEVu3/U?= =?us-ascii?Q?GbBlI4cC3bTqxlop71GA6LIpC2CQAkRs+672k5ZL0ao14pLfciewKZ8ObvyO?= =?us-ascii?Q?My9bxxT9rdrGWs/V5UVFTrhC38ibVYIbk9ZBMScrwKGtsb254eoDdmZZqe5X?= =?us-ascii?Q?zACOb9p7qCETEKsO6vuM73TpEZQHPbFN90z6KN3pyMwfshVDTDL+rgvy3DgI?= =?us-ascii?Q?BppA5wSlg+c/d2HYcoTfRjvAqfvntHd5f204Q88ZW/N+IczKPKvHwtF/fz/x?= =?us-ascii?Q?IhgByrYaexiuBjNI/Vm5S8uw00/gcJXLBlC2+D1MN/N4leD1kIVU7+LaVpvq?= =?us-ascii?Q?bRUL2rTL6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ZWkFp4m6X?= =?us-ascii?Q?JfXjcmpd53awPwmJ1FteoyKE3U9SI+Fk?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:03:18.8551 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4257756-c81c-4318-b5b5-08dd16959c9a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7345 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 Hi, FYI, your patch has been queued to stable release 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0f7976a1f975d3cd2215d543feb27cec214f14a8 Thanks. Xueming Li --- >From 0f7976a1f975d3cd2215d543feb27cec214f14a8 Mon Sep 17 00:00:00 2001 From: Rohit Raj Date: Wed, 23 Oct 2024 17:29:32 +0530 Subject: [PATCH] bus/fslmc: fix Coverity warnings in QBMAN Cc: Xueming Li [ upstream commit 051f4185f98faa964b6a965b2e8e7b2da68969de ] Fix Issues reported by NXP Internal Coverity. Fixes: 64f131a82fbe ("bus/fslmc: add qbman debug") Signed-off-by: Rohit Raj Acked-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_debug.c | 49 +++++++++++++++++---------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/drivers/bus/fslmc/qbman/qbman_debug.c b/drivers/bus/fslmc/qbman/qbman_debug.c index eea06988ff..0e471ec3fd 100644 --- a/drivers/bus/fslmc/qbman/qbman_debug.c +++ b/drivers/bus/fslmc/qbman/qbman_debug.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (C) 2015 Freescale Semiconductor, Inc. - * Copyright 2018-2020 NXP + * Copyright 2018-2020,2022 NXP */ #include "compat.h" @@ -37,6 +37,7 @@ int qbman_bp_query(struct qbman_swp *s, uint32_t bpid, struct qbman_bp_query_rslt *r) { struct qbman_bp_query_desc *p; + struct qbman_bp_query_rslt *bp_query_rslt; /* Start the management command */ p = (struct qbman_bp_query_desc *)qbman_swp_mc_start(s); @@ -47,14 +48,16 @@ int qbman_bp_query(struct qbman_swp *s, uint32_t bpid, p->bpid = bpid; /* Complete the management command */ - *r = *(struct qbman_bp_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_BP_QUERY); - if (!r) { + bp_query_rslt = (struct qbman_bp_query_rslt *)qbman_swp_mc_complete(s, + p, QBMAN_BP_QUERY); + if (!bp_query_rslt) { pr_err("qbman: Query BPID %d failed, no response\n", bpid); return -EIO; } + *r = *bp_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_BP_QUERY); @@ -202,20 +205,23 @@ int qbman_fq_query(struct qbman_swp *s, uint32_t fqid, struct qbman_fq_query_rslt *r) { struct qbman_fq_query_desc *p; + struct qbman_fq_query_rslt *fq_query_rslt; p = (struct qbman_fq_query_desc *)qbman_swp_mc_start(s); if (!p) return -EBUSY; p->fqid = fqid; - *r = *(struct qbman_fq_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_FQ_QUERY); - if (!r) { + fq_query_rslt = (struct qbman_fq_query_rslt *)qbman_swp_mc_complete(s, + p, QBMAN_FQ_QUERY); + if (!fq_query_rslt) { pr_err("qbman: Query FQID %d failed, no response\n", fqid); return -EIO; } + *r = *fq_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_FQ_QUERY); @@ -398,20 +404,23 @@ int qbman_cgr_query(struct qbman_swp *s, uint32_t cgid, struct qbman_cgr_query_rslt *r) { struct qbman_cgr_query_desc *p; + struct qbman_cgr_query_rslt *cgr_query_rslt; p = (struct qbman_cgr_query_desc *)qbman_swp_mc_start(s); if (!p) return -EBUSY; p->cgid = cgid; - *r = *(struct qbman_cgr_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_CGR_QUERY); - if (!r) { + cgr_query_rslt = (struct qbman_cgr_query_rslt *)qbman_swp_mc_complete(s, + p, QBMAN_CGR_QUERY); + if (!cgr_query_rslt) { pr_err("qbman: Query CGID %d failed, no response\n", cgid); return -EIO; } + *r = *cgr_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_CGR_QUERY); @@ -473,20 +482,23 @@ int qbman_cgr_wred_query(struct qbman_swp *s, uint32_t cgid, struct qbman_wred_query_rslt *r) { struct qbman_cgr_query_desc *p; + struct qbman_wred_query_rslt *wred_query_rslt; p = (struct qbman_cgr_query_desc *)qbman_swp_mc_start(s); if (!p) return -EBUSY; p->cgid = cgid; - *r = *(struct qbman_wred_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_WRED_QUERY); - if (!r) { + wred_query_rslt = (struct qbman_wred_query_rslt *)qbman_swp_mc_complete( + s, p, QBMAN_WRED_QUERY); + if (!wred_query_rslt) { pr_err("qbman: Query CGID WRED %d failed, no response\n", cgid); return -EIO; } + *r = *wred_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_WRED_QUERY); @@ -527,7 +539,7 @@ void qbman_cgr_attr_wred_dp_decompose(uint32_t dp, uint64_t *minth, if (mn == 0) *maxth = ma; else - *maxth = ((ma+256) * (1<<(mn-1))); + *maxth = ((uint64_t)(ma+256) * (1<<(mn-1))); if (step_s == 0) *minth = *maxth - step_i; @@ -630,6 +642,7 @@ int qbman_wqchan_query(struct qbman_swp *s, uint16_t chanid, struct qbman_wqchan_query_rslt *r) { struct qbman_wqchan_query_desc *p; + struct qbman_wqchan_query_rslt *wqchan_query_rslt; /* Start the management command */ p = (struct qbman_wqchan_query_desc *)qbman_swp_mc_start(s); @@ -640,14 +653,16 @@ int qbman_wqchan_query(struct qbman_swp *s, uint16_t chanid, p->chid = chanid; /* Complete the management command */ - *r = *(struct qbman_wqchan_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_WQ_QUERY); - if (!r) { + wqchan_query_rslt = (struct qbman_wqchan_query_rslt *)qbman_swp_mc_complete( + s, p, QBMAN_WQ_QUERY); + if (!wqchan_query_rslt) { pr_err("qbman: Query WQ Channel %d failed, no response\n", chanid); return -EIO; } + *r = *wqchan_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_WQ_QUERY); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:44.882405617 +0800 +++ 0022-bus-fslmc-fix-Coverity-warnings-in-QBMAN.patch 2024-12-06 23:26:43.903044828 +0800 @@ -1 +1 @@ -From 051f4185f98faa964b6a965b2e8e7b2da68969de Mon Sep 17 00:00:00 2001 +From 0f7976a1f975d3cd2215d543feb27cec214f14a8 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 051f4185f98faa964b6a965b2e8e7b2da68969de ] @@ -9 +11,0 @@ -Cc: stable@dpdk.org