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 6577145A1F; Fri, 27 Sep 2024 02:30:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1076D40612; Fri, 27 Sep 2024 02:30:29 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mails.dpdk.org (Postfix) with ESMTP id 9E5FB4003C for ; Fri, 27 Sep 2024 02:30:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727397024; x=1758933024; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bs6dPchiQAA4/EkxUE7WStQHXX88v3KbROZHEdzmyHM=; b=PfwPB//ixd6X2gHLfRis9ifjJoDZOIKAFm1CoHJ6PHrrvLaYo9YcUP5c 30x3ilqxkINB5IhR3nfG/9RK63IRovOyzBygiGrJQf8bx5j/hQOcb0sj3 pyKIwEsgb4eUcO5pKHGjhct5nR9I5uhf7QRLHFxROXvUeJuRhDeT3bED4 /TpSNef2PkrQntZ0kFR2Xw2eCIyzpPUCWI9eR/WUlliEVNrOP7hZsCmv1 gTlm5R2/R0BJycacSAcMuuXgl9bRgiGx4ghS/S7DRVJVlPsK0nF4XjTkv mYq5LH5cKF7qaiD1tnrf62rZyXhs1yvxHwclQw8CaVZkH/oUS0DkQMJM2 w==; X-CSE-ConnectionGUID: /8nKzcHmSt+ZqOFKBo4biA== X-CSE-MsgGUID: JgnkmMM2QPGE/1BtmcmFrw== X-IronPort-AV: E=McAfee;i="6700,10204,11207"; a="26399444" X-IronPort-AV: E=Sophos;i="6.11,157,1725346800"; d="scan'208";a="26399444" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2024 17:30:22 -0700 X-CSE-ConnectionGUID: fVteSdorTrmKoDhbjy1Czg== X-CSE-MsgGUID: WT4ihr1aQeidl9P9G2XE9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,157,1725346800"; d="scan'208";a="72342858" Received: from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..) ([10.233.181.123]) by fmviesa009.fm.intel.com with ESMTP; 26 Sep 2024 17:30:21 -0700 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com, Nicolas Chautru Subject: [PATCH v4 2/2] baseband/acc: improvement to logging mechanism Date: Thu, 26 Sep 2024 17:31:27 -0700 Message-Id: <20240927003127.1512013-3-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240927003127.1512013-1-nicolas.chautru@intel.com> References: <20240913231811.969965-1-nicolas.chautru@intel.com> <20240927003127.1512013-1-nicolas.chautru@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Support the new dev op to dump operations information related to a given queue tracked internally in PMD. Signed-off-by: Nicolas Chautru Acked-by: Hemant Agrawal --- drivers/baseband/acc/rte_vrb_pmd.c | 59 +++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c index 585dc49bd6..52e76ec6c1 100644 --- a/drivers/baseband/acc/rte_vrb_pmd.c +++ b/drivers/baseband/acc/rte_vrb_pmd.c @@ -1434,6 +1434,62 @@ vrb_queue_intr_disable(struct rte_bbdev *dev, uint16_t queue_id) return 0; } +static int +vrb_queue_ops_dump(struct rte_bbdev *dev, uint16_t queue_id, FILE *f) +{ + struct acc_queue *q = dev->data->queues[queue_id].queue_private; + struct rte_bbdev_dec_op *op; + uint16_t i, int_nb; + volatile union acc_info_ring_data *ring_data; + uint16_t info_ring_head = q->d->info_ring_head; + static char str[1024]; + + if (f == NULL) { + rte_bbdev_log(ERR, "Invalid File input"); + return -EINVAL; + } + + /** Print generic information on queue status. */ + fprintf(f, "Dump of operations %s on Queue %d by %s\n", + rte_bbdev_op_type_str(q->op_type), queue_id, dev->device->driver->name); + fprintf(f, " AQ Enqueued %d Dequeued %d Depth %d - Available Enq %d Deq %d\n", + q->aq_enqueued, q->aq_dequeued, q->aq_depth, + acc_ring_avail_enq(q), acc_ring_avail_deq(q)); + + /** Print information captured in the info ring. */ + if (q->d->info_ring != NULL) { + fprintf(f, "Info Ring Buffer - Head %d\n", q->d->info_ring_head); + ring_data = q->d->info_ring + (q->d->info_ring_head & ACC_INFO_RING_MASK); + while (ring_data->valid) { + int_nb = int_from_ring(*ring_data, q->d->device_variant); + if ((int_nb < ACC_PF_INT_DMA_DL_DESC_IRQ) || ( + int_nb > ACC_PF_INT_DMA_MLD_DESC_IRQ)) { + fprintf(f, " InfoRing: ITR:%d Info:0x%x", + int_nb, ring_data->detailed_info); + /* Initialize Info Ring entry and move forward. */ + ring_data->valid = 0; + } + info_ring_head++; + ring_data = q->d->info_ring + (info_ring_head & ACC_INFO_RING_MASK); + } + } + + fprintf(f, "Ring Content - Head %d Tail %d Depth %d\n", + q->sw_ring_head, q->sw_ring_tail, q->sw_ring_depth); + /** Print information about each operation in the software ring. */ + for (i = 0; i < q->sw_ring_depth; ++i) { + op = (q->ring_addr + i)->req.op_addr; + if (op != NULL) + fprintf(f, " %d\tn %d %s", i, (q->ring_addr + i)->req.numCBs, + rte_bbdev_ops_param_string(op, q->op_type, + str, sizeof(str))); + } + + fprintf(f, "== End of File ==\n"); + + return 0; +} + static const struct rte_bbdev_ops vrb_bbdev_ops = { .setup_queues = vrb_setup_queues, .intr_enable = vrb_intr_enable, @@ -1443,7 +1499,8 @@ static const struct rte_bbdev_ops vrb_bbdev_ops = { .queue_release = vrb_queue_release, .queue_stop = vrb_queue_stop, .queue_intr_enable = vrb_queue_intr_enable, - .queue_intr_disable = vrb_queue_intr_disable + .queue_intr_disable = vrb_queue_intr_disable, + .queue_ops_dump = vrb_queue_ops_dump }; /* PCI PF address map. */ -- 2.34.1