From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CF89C5DF7E for ; Tue, 18 Aug 2026 11:18:24 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7660D40A73; Tue, 18 Aug 2026 13:17:48 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 08384406B8 for ; Tue, 18 Aug 2026 13:17:45 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E1019200122; Tue, 18 Aug 2026 13:17:44 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AA75F200253; Tue, 18 Aug 2026 13:17:44 +0200 (CEST) Received: from lsv03583.swis.in-blr01.nxp.com (lsv03583.swis.in-blr01.nxp.com [92.120.146.12]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2BD2A1800226; Tue, 18 Aug 2026 19:17:43 +0800 (+08) From: Hemant Agrawal To: stephen@networkplumber.org, thomas@monjalon.net, dev@dpdk.org Cc: Jun Yang Subject: [PATCH v12 07/26] drivers: shutdown DPAA FQ by fq descriptor Date: Tue, 18 Aug 2026 16:47:11 +0530 Message-Id: <20260818111730.801760-8-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260818111730.801760-1-hemant.agrawal@nxp.com> References: <20260813144205.2505031-1-hemant.agrawal@nxp.com> <20260818111730.801760-1-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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: Jun Yang Pass the full FQ descriptor to qman_shutdown_fq() instead of just the fqid, so that channel-affine portals can be correctly accessed when shutting down push-mode Rx queues. Signed-off-by: Jun Yang --- drivers/bus/dpaa/base/qbman/qman.c | 9 +++++---- drivers/bus/dpaa/include/fsl_qman.h | 11 ++++++++++- drivers/net/dpaa/dpaa_ethdev.c | 6 +++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 931d487de4..2315b81065 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2784,18 +2784,19 @@ qm_mc_result_timeout(struct qm_portal *portal, RTE_EXPORT_INTERNAL_SYMBOL(qman_shutdown_fq) int -qman_shutdown_fq(u32 fqid) +qman_shutdown_fq(struct qman_fq *fq) { - struct qman_portal *p; + struct qman_portal *p = fq->qp; struct qm_mc_command *mcc; struct qm_mc_result *mcr; int orl_empty, drain = 0, ret = 0; - u32 res; + u32 res, fqid = fq->fqid; u8 state; u32 channel, wq; DPAA_BUS_DEBUG("In shutdown for queue = %x", fqid); - p = get_affine_portal(); + if (!p) + p = get_affine_portal(); /* Determine the state of the FQID */ mcc = qm_mc_start(&p->p); mcc->queryfq_np.fqid = cpu_to_be32(fqid); diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 82269cdf99..673859ed2e 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1896,7 +1896,16 @@ static inline void qman_release_fqid(u32 fqid) void qman_seed_fqid_range(u32 fqid, unsigned int count); __rte_internal -int qman_shutdown_fq(u32 fqid); +int qman_shutdown_fq(struct qman_fq *fq); + +static inline int qman_shutdown_fq_by_fqid(u32 fqid) +{ + struct qman_fq fq; + + memset(&fq, 0, sizeof(struct qman_fq)); + fq.fqid = fqid; + return qman_shutdown_fq(&fq); +} /** * qman_reserve_fqid_range - Reserve the specified range of frame queue IDs diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 85dae9070c..9f3129f499 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1123,7 +1123,11 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, queue_idx, rxq->fqid); /* Shutdown FQ before configure */ - qman_shutdown_fq(rxq->fqid); + ret = qman_shutdown_fq_by_fqid(rxq->fqid); + if (ret) { + DPAA_PMD_WARN("%s: Failed(%d) to shutdown rxq%d's fq(fqid=0x%x)", + dev->data->name, ret, queue_idx, rxq->fqid); + } if (!fif->num_profiles) { if (dpaa_intf->bp_info && dpaa_intf->bp_info->bp && -- 2.25.1