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 12BA145C9B for ; Tue, 12 Nov 2024 23:09:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E68A40A67; Tue, 12 Nov 2024 23:09:01 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 0E0E140673 for ; Tue, 12 Nov 2024 23:09:00 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4314fa33a35so50538345e9.1 for ; Tue, 12 Nov 2024 14:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731449340; x=1732054140; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3y5ZF4cMGuFhOn7/nR7bv7riW1BJNxLWfpmEvSIhZuU=; b=P2lqmcLvMjlmR8fz3CMutmTIFgV9Zm9sau3Gj0j48cNji9zWc8Z9YiJt52sv+XDox6 Ck1JqKaaLRbVmy7bW31dHdqBumE1xgptQ12QVeN+LIAKEaMgJsFKC3M2ZwD2R6SL4Dey 6ctLv2hf4VDzRUQgAx/XEHzBQv/C4d8ZAq43LKzuCr8xcN8e9nZ0C6FV0Cjc2k3qaRJ2 3mu6YlNEz8Zbp5bsHqGs4sEW3UBLQXgF7iWUzcvzau9MSAdzPGKBmv6dxkhBr3RTWkPN cX8cCAW1u982LI/0VwYxymyDbgxgNti4Vg5jbzUCavkiRDpdlp6UTlnDPIoCM38fFSRe FQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731449340; x=1732054140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3y5ZF4cMGuFhOn7/nR7bv7riW1BJNxLWfpmEvSIhZuU=; b=gl75OzV626ySIYp38fMIYsKAEMDjyiYxrqtH+jxeD0wX/MMffTuOT0kLVl6b3zMPpG pmeC8nmz98oEAZPVH7EiMCDiGBFa+tfd5pP3A9ueY/A81QCik+DXkyixn7Ew6m2+vW6X 9e+fLJORl0J2gSUx0oi6ecRIFHUrv/Emyz3iu4TW/gIK6C0rs7bNJ4M4lCuwM8GbO0M8 uAqmbDf7+eNexufc/+KE5NfszWNDJOb2Ig9ezYc+1rl+hfWgJ23hB9qvq2u0dneG/h2w ENWFN3p8iOWTO2bBSVC29HftfLDWd/nAK5FwMJsssHuyrufpJEh3x4voGS6mxJ/7qJuv M0bA== X-Forwarded-Encrypted: i=1; AJvYcCW9orFLaDV+Rt5+hffXDrjeTsCW3FOgCR+f/W16OfT4uwqaI5IxMrsm9GlGaO0uiY/B6Cq41WE=@dpdk.org X-Gm-Message-State: AOJu0YxQhZA4+0za4D/z3ZrrqA7f7vkYvgMuLvRqhe9Bo7dYpudsDPsE 1P20KdqCqB4f1NEnLTtCRsOgyq4yMDkzcKlmtUEgEEc1AvqMJ5kB0ch1LQ== X-Google-Smtp-Source: AGHT+IFx0zCLERDPLb4HxTBu4qnDwdE+3+XQlWIDVqHlJXHa+d2u/s9WiaToSKvaAcBK/bpl8nJ95g== X-Received: by 2002:a5d:5f53:0:b0:381:f595:fd0a with SMTP id ffacd0b85a97d-3820810ffc0mr2890899f8f.16.1731449339534; Tue, 12 Nov 2024 14:08:59 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:e89d:e9a1:da72:2f9d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed987d95sm16603621f8f.44.2024.11.12.14.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 14:08:58 -0800 (PST) From: luca.boccassi@gmail.com To: Rohit Raj Cc: Hemant Agrawal , dpdk stable Subject: patch 'bus/fslmc: fix Coverity warnings in QBMAN' has been queued to stable release 22.11.7 Date: Tue, 12 Nov 2024 22:07:26 +0000 Message-ID: <20241112220754.666489-16-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241112220754.666489-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-79-luca.boccassi@gmail.com> <20241112220754.666489-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/14/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/ef19017fc47d1d88d7c4a7354129e52564e3b935 Thanks. Luca Boccassi --- >From ef19017fc47d1d88d7c4a7354129e52564e3b935 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 [ 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.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-12 22:06:59.209008178 +0000 +++ 0016-bus-fslmc-fix-Coverity-warnings-in-QBMAN.patch 2024-11-12 22:06:58.659307077 +0000 @@ -1 +1 @@ -From 051f4185f98faa964b6a965b2e8e7b2da68969de Mon Sep 17 00:00:00 2001 +From ef19017fc47d1d88d7c4a7354129e52564e3b935 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 051f4185f98faa964b6a965b2e8e7b2da68969de ] + @@ -9 +10,0 @@ -Cc: stable@dpdk.org