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 7D4EE457AD; Tue, 13 Aug 2024 09:24:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 677AA40DCE; Tue, 13 Aug 2024 09:24:05 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2069.outbound.protection.outlook.com [40.107.241.69]) by mails.dpdk.org (Postfix) with ESMTP id 6ABB44065B for ; Tue, 13 Aug 2024 09:24:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gFTvvYHkznVlhJ4lA7VmjhAmScVa227ZpauQ+lHYPhBWnO8AWCKs/j8ap+EGxF8wqlTa0ALb+2C26t/obcD+QKPcn868N0avxtFiZcQ/3e5MWmf/2cmULjCPprQ2qs6UNVitrzSgSoB3VfjuL6YSVxhg5IM29Rapm1Tz9rOAB7IIIEa4XGSkmggs+AVsL73DYFyzFKkyKRSg7fx7VzhvKOVrxuzzpOCnt/6ZDvUaxHXzj1Fp+dpZv4O8QoKfXKu7qZSFYSDOTbNkGs8AQwBX1lGuOjFiYTszA1GaexXpXzAwwcK9UxQgoJjW/UHWndC+bBzfwSwie9dmw3eJHg9oPA== 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=6oiBcQrl8R/2eEv4609zJbejqL5sezmQap6VYEayg1w=; b=AZAAKd9nrRN1u/VQb0UcBZTyFgk3JiozpbIeYdlomg+LJC1Xz23AiKjWASeS94rlyeFDaiGTYnR3v5yMJ7vMX8O5sBqJZfZU9T50aDyWllq4ZuXraGsgXEgM3z2gDGnBs/FyMt0JUOzXumETwZY/4zWQaobt2g4BQ2py5yncgvaXLRIAdmoe8P/7NpHGhWfd8NtyIF5VWfq1MbJO36+FD6q2s6NrUBi/l8T/hlzGc5F6ERlPrYHwcr6dBoAo647QrMcBR1O6omRIy1Pl0+ZWTJqF6j+LH3sVAKdEtsJXQkTDchXdD2jec1dCg4KWU9Xe+UUIVW+Bx88q4q0Y4nAl4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6oiBcQrl8R/2eEv4609zJbejqL5sezmQap6VYEayg1w=; b=OzLJBXAATdLzuqXb8BZC+TImgcJhYY4KSJK3A5+hp/51gXmc4MmYPnDfMeGRyxcw3mhVhjR8u0005BnXwjOpWjT/7zUDU5dbW3oV2Bg8F7PJTGd5m7XL4HQjox3hxzZs/xsljBWXQzpBd/H/LlykOhVVIzXnlXBDH3sLwAeZOnrNTDDAsDate6VtNuLhWeTBHG+Qmb6sQfL5hf55/GK1v7yFa5WOXsBNR+2lVg5H2X+tY8/puNoNlaJaDLNU52xYfa1qVsTLol+ZOYFy2z2csljFWN4jgoa5TtX+ISTIypKX0sFpRGYkidXRVfBqDBNJBIqLNmbJnNWmt3wKaRfHjg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; Received: from DU2PR07MB9522.eurprd07.prod.outlook.com (2603:10a6:10:49a::12) by PAXPR07MB8445.eurprd07.prod.outlook.com (2603:10a6:102:2b9::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug 2024 07:24:02 +0000 Received: from DU2PR07MB9522.eurprd07.prod.outlook.com ([fe80::3bcc:6d1b:6257:819]) by DU2PR07MB9522.eurprd07.prod.outlook.com ([fe80::3bcc:6d1b:6257:819%4]) with mapi id 15.20.7849.019; Tue, 13 Aug 2024 07:24:02 +0000 Content-Type: multipart/alternative; boundary="------------g7MWQsMyDsQ0zQpFqLzwcKC8" Message-ID: Date: Tue, 13 Aug 2024 09:24:00 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] baseband/acc: refactor queue status update To: Nicolas Chautru , dev@dpdk.org, maxime.coquelin@redhat.com Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com References: <20240812234201.2196633-1-nicolas.chautru@intel.com> <20240812234201.2196633-3-nicolas.chautru@intel.com> Content-Language: en-US From: Mattia Milani In-Reply-To: <20240812234201.2196633-3-nicolas.chautru@intel.com> X-ClientProxiedBy: FR4P281CA0450.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c6::11) To DU2PR07MB9522.eurprd07.prod.outlook.com (2603:10a6:10:49a::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR07MB9522:EE_|PAXPR07MB8445:EE_ X-MS-Office365-Filtering-Correlation-Id: 56c67173-b682-4923-e1d6-08dcbb68e7fa X-LD-Processed: 5d471751-9675-428d-917b-70f44f9630b0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?dnVHYTdkMWtJMkZWa0VPd0ppaUFlZk9MQklCNDdCZEZWSFlwdU9maWdBdUxR?= =?utf-8?B?WTRabHB2dFlvZHNTb1ZvVEhOQWR6U3p4SjlCWEcvcU9JcE96OXlVNFhGdnIw?= =?utf-8?B?WHZMQ0hPQ1ZUM0FQcTZqVHpFcVdRc2EySVphbHU3OFBQem5iUWdhb0xZS0hF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m9yQmVxNzI2eGdDSWVQSGZx?= =?utf-8?B?U1pVeHpkckdyalFMaXRlaUxVTU5XWm1WYVdTNUFuS0QzT296MmpyR1RXRzNE?= =?utf-8?B?VG9mZlhjVFduWmQwWDVlWUU5VFRwWmtKM3k3UDM0SGNxZnMxK0NURndsUVJv?= =?utf-8?B?VFNxdE1TVWYzbjUyYTVWR0drVUpiUnFZalNhTnhacDh3d0JndVR2eTBqeEJB?= =?utf-8?B?UjdRUVJrZ2ZWSXgxSGEreHVnTngwRG1vbGZvWnIzWmVxS2dLdVF3T1JJZDlj?= =?utf-8?B?N0tLUW9pOEpFMTh1WktzTDlybnJTNzdpRWlqNzM4THE4Wld1RzAzMExiamFi?= =?utf-8?B?SUZrd1ZLaEtOc1krUzljZmZNbVBTOCs5N1AvQ1lpbXBVbGZoSDJVZ0s2eklh?= =?utf-8?B?QzB3WTNhajd0cGxjTlFqZTRxN1kvSFA1VkVINkFxWTAxS01IL1cwZWNxWnFF?= =?utf-8?B?Vm41S1VQOUJlM2N1dXIrdGxldEhWVDNWQldkSkprQTIwLzZZM0V6UEVCTDkr?= =?utf-8?B?RzIrbDdLVEk2MWV0RlJDanB6SEtXRUxKRW12Nk04Q0RyNllRRFFHOENBUVlG?= =?utf-8?B?ZzU2Q2ZpL3dETlIyaXdkblNVUGFRUEphQUVEMWt6dXlMMERQTVh2clZKMjc1?= =?utf-8?Q?zs6cqUq/ydi3VdNSZSGV?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR07MB9522.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dElIanRub3ZmRk95dGNpVDhSZTQ5eGxibXF2QWJyRy9HenNUSVdiYk1lei9X?= =?utf-8?B?SWJyZlQ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TRmZjZEa0FIRXRYUHNjUG5o?= =?utf-8?B?YkRXbi9xQTdDODNvaCsraVlDcUFCOGxmbnBLcHBWWnZaSTh4RHQ3QStkL2V3?= =?utf-8?B?SnRrMHFuMUNGR1VLTGZEVk9NcHVYMzRXc2dxNndzOEo3dVM3QXpLejZKN1kr?= =?utf-8?B?RHM5QVpNZk5KUlhrdXYxeXdaSVFVbWlRMnNiR2hCQ0E3Q0MyVVRPVXUxVUtT?= =?utf-8?B?cU1iUm02NEZUVnpwK20vaFVUeTZzcnNkVHVmcEZCTldHZ1hadUduN3dkdGNW?= =?utf-8?B?aEtPL05HV1BFRUtVczNIRDFRV0s3K1U5RDV4Ym9yQTFCU1lSbk1yQTkzL2pH?= =?utf-8?B?K3c9PQ==?= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56c67173-b682-4923-e1d6-08dcbb68e7fa X-MS-Exchange-CrossTenant-AuthSource: DU2PR07MB9522.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 07:24:02.3707 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FYup7AGAnLYJjOid/NmxFryc+DuOgKvPtsSotA/eUBcBoOAfV6sn/QYaV2CBEIo2FaV8Ss7M6mBltV2TSqJ2Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB8445 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 --------------g7MWQsMyDsQ0zQpFqLzwcKC8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Dear all, I'm a DPDK newbie, but I hope anyway you are gonna consider my comments or help me to understand the code a little bit better. 1) Aren't you updating the variable two times? for example, in 'acc100_enqueue_enc_cb',     you update both 'enqueued_count' and 'enqueue_err_count' and then you call     'acc_update_qstat_enqueue' which does exactly the same thing but also updates 'enqueue_depth_avail'. 2) You reset the queue stats when '*_queue_stop' is called, wouldn't be better to reset the statistics when a queue is started? so that, if I want, I can still access the statistics of a stopped queue to see the counters. All the best, Mattia On 13/08/2024 01:42, Nicolas Chautru wrote: > CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information. > > > > Introducing common function for queue stats update > within the acc PMDs. > > Signed-off-by: Nicolas Chautru > --- > drivers/baseband/acc/acc_common.h | 18 ++++++++ > drivers/baseband/acc/rte_acc100_pmd.c | 45 ++++++-------------- > drivers/baseband/acc/rte_vrb_pmd.c | 61 +++++++++------------------ > 3 files changed, 50 insertions(+), 74 deletions(-) > > diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h > index e249f37e38..06a88360de 100644 > --- a/drivers/baseband/acc/acc_common.h > +++ b/drivers/baseband/acc/acc_common.h > @@ -1555,6 +1555,24 @@ acc_aq_avail(struct rte_bbdev_queue_data *q_data, uint16_t num_ops) > return aq_avail; > } > > +/* Update queue stats during enqueue. */ > +static inline void > +acc_update_qstat_enqueue(struct rte_bbdev_queue_data *q_data, > + uint16_t enq_count, uint16_t enq_err_count) > +{ > + q_data->queue_stats.enqueued_count += enq_count; > + q_data->queue_stats.enqueue_err_count += enq_err_count; > + q_data->queue_stats.enqueue_depth_avail = acc_aq_avail(q_data, 0); > +} > + > +/* Update queue stats during dequeue. */ > +static inline void > +acc_update_qstat_dequeue(struct rte_bbdev_queue_data *q_data, uint16_t deq_count) > +{ > + q_data->queue_stats.dequeued_count += deq_count; > + q_data->queue_stats.enqueue_depth_avail = acc_aq_avail(q_data, 0); > +} > + > /* Calculates number of CBs in processed encoder TB based on 'r' and input > * length. > */ > diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c > index ab69350080..d2a0a36e12 100644 > --- a/drivers/baseband/acc/rte_acc100_pmd.c > +++ b/drivers/baseband/acc/rte_acc100_pmd.c > @@ -892,6 +892,7 @@ acc100_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) > dev->data->queues[queue_id].queue_stats.dequeue_err_count = 0; > dev->data->queues[queue_id].queue_stats.enqueue_warn_count = 0; > dev->data->queues[queue_id].queue_stats.dequeue_warn_count = 0; > + dev->data->queues[queue_id].queue_stats.enqueue_depth_avail = 0; > > return 0; > } > @@ -3196,9 +3197,7 @@ acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -3245,9 +3244,7 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, desc_idx, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -3284,9 +3281,7 @@ acc100_enqueue_enc_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -3322,9 +3317,7 @@ acc100_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -3388,9 +3381,7 @@ acc100_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -3426,9 +3417,7 @@ acc100_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -3468,9 +3457,7 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -3505,9 +3492,7 @@ acc100_enqueue_dec_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -3897,8 +3882,7 @@ acc100_dequeue_enc(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_descs; > > - /* Update enqueue stats */ > - q_data->queue_stats.dequeued_count += dequeued_ops; > + acc_update_qstat_dequeue(q_data, dequeued_ops); > > return dequeued_ops; > } > @@ -3940,8 +3924,7 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_descs; > > - /* Update enqueue stats */ > - q_data->queue_stats.dequeued_count += dequeued_ops; > + acc_update_qstat_dequeue(q_data, dequeued_ops); > > return dequeued_ops; > } > @@ -3986,8 +3969,7 @@ acc100_dequeue_dec(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_cbs; > > - /* Update enqueue stats */ > - q_data->queue_stats.dequeued_count += i; > + acc_update_qstat_dequeue(q_data, i); > > return i; > } > @@ -4033,8 +4015,7 @@ acc100_dequeue_ldpc_dec(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_cbs; > > - /* Update enqueue stats */ > - q_data->queue_stats.dequeued_count += i; > + acc_update_qstat_dequeue(q_data, i); > > return i; > } > diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c > index 585dc49bd6..630b514f03 100644 > --- a/drivers/baseband/acc/rte_vrb_pmd.c > +++ b/drivers/baseband/acc/rte_vrb_pmd.c > @@ -1109,6 +1109,7 @@ vrb_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) > dev->data->queues[queue_id].queue_stats.dequeue_err_count = 0; > dev->data->queues[queue_id].queue_stats.enqueue_warn_count = 0; > dev->data->queues[queue_id].queue_stats.dequeue_warn_count = 0; > + dev->data->queues[queue_id].queue_stats.enqueue_depth_avail = 0; > return 0; > } > > @@ -2738,9 +2739,7 @@ vrb_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -2778,9 +2777,7 @@ vrb_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, desc_idx, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -2817,9 +2814,7 @@ vrb_enqueue_enc_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -2864,9 +2859,7 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -2926,9 +2919,7 @@ vrb_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -2961,9 +2952,7 @@ vrb_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -3004,9 +2993,7 @@ vrb_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -3041,9 +3028,7 @@ vrb_enqueue_dec_tb(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > > return i; > } > @@ -3453,8 +3438,7 @@ vrb_dequeue_enc(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_descs; > > - /* Update enqueue stats. */ > - q_data->queue_stats.dequeued_count += dequeued_ops; > + acc_update_qstat_dequeue(q_data, dequeued_ops); > > return dequeued_ops; > } > @@ -3496,8 +3480,7 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_descs; > > - /* Update enqueue stats. */ > - q_data->queue_stats.dequeued_count += dequeued_ops; > + acc_update_qstat_dequeue(q_data, dequeued_ops); > > return dequeued_ops; > } > @@ -3535,8 +3518,7 @@ vrb_dequeue_dec(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_cbs; > > - /* Update enqueue stats */ > - q_data->queue_stats.dequeued_count += i; > + acc_update_qstat_dequeue(q_data, i); > > return i; > } > @@ -3575,8 +3557,7 @@ vrb_dequeue_ldpc_dec(struct rte_bbdev_queue_data *q_data, > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_cbs; > > - /* Update enqueue stats. */ > - q_data->queue_stats.dequeued_count += i; > + acc_update_qstat_dequeue(q_data, i); > > return i; > } > @@ -3782,9 +3763,7 @@ vrb_enqueue_fft(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, i, &q_data->queue_stats); > > - /* Update stats */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -3851,8 +3830,7 @@ vrb_dequeue_fft(struct rte_bbdev_queue_data *q_data, > > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_cbs; > - /* Update enqueue stats. */ > - q_data->queue_stats.dequeued_count += i; > + acc_update_qstat_dequeue(q_data, i); > return i; > } > > @@ -4106,9 +4084,7 @@ vrb2_enqueue_mldts(struct rte_bbdev_queue_data *q_data, > > acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats); > > - /* Update stats. */ > - q_data->queue_stats.enqueued_count += i; > - q_data->queue_stats.enqueue_err_count += num - i; > + acc_update_qstat_enqueue(q_data, i, num - i); > return i; > } > > @@ -4207,8 +4183,9 @@ vrb2_dequeue_mldts(struct rte_bbdev_queue_data *q_data, > > q->aq_dequeued += aq_dequeued; > q->sw_ring_tail += dequeued_cbs; > - /* Update enqueue stats. */ > - q_data->queue_stats.dequeued_count += i; > + > + acc_update_qstat_dequeue(q_data, i); > + > return i; > } > > -- > 2.34.1 > --------------g7MWQsMyDsQ0zQpFqLzwcKC8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Dear all,

I'm a DPDK newbie, but I hope anyway you are gonna consider my
comments or help me to understand the code a little bit better.

1) Aren't you updating the variable two times? for example, in 'acc100_enqueue_enc_cb',
    you update both 'enqueued_count' and 'enqueue_err_count' and then you call
    'acc_update_qstat_enqueue' which does exactly the same thing but also updates 'enqueue_depth_avail'.

2) You reset the queue stats when '*_queue_stop' is called, wouldn't be better to reset the statistics when a queue is started? so that, if I want, I can still access the statistics of a stopped queue to see the counters.

All the best, Mattia

On 13/08/2024 01:42, Nicolas Chautru wrote:
CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.



Introducing common function for queue stats update
within the acc PMDs.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 drivers/baseband/acc/acc_common.h     | 18 ++++++++
 drivers/baseband/acc/rte_acc100_pmd.c | 45 ++++++--------------
 drivers/baseband/acc/rte_vrb_pmd.c    | 61 +++++++++------------------
 3 files changed, 50 insertions(+), 74 deletions(-)

diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h
index e249f37e38..06a88360de 100644
--- a/drivers/baseband/acc/acc_common.h
+++ b/drivers/baseband/acc/acc_common.h
@@ -1555,6 +1555,24 @@ acc_aq_avail(struct rte_bbdev_queue_data *q_data, uint16_t num_ops)
        return aq_avail;
 }

+/* Update queue stats during enqueue. */
+static inline void
+acc_update_qstat_enqueue(struct rte_bbdev_queue_data *q_data,
+               uint16_t enq_count, uint16_t enq_err_count)
+{
+       q_data->queue_stats.enqueued_count += enq_count;
+       q_data->queue_stats.enqueue_err_count += enq_err_count;
+       q_data->queue_stats.enqueue_depth_avail = acc_aq_avail(q_data, 0);
+}
+
+/* Update queue stats during dequeue. */
+static inline void
+acc_update_qstat_dequeue(struct rte_bbdev_queue_data *q_data, uint16_t deq_count)
+{
+       q_data->queue_stats.dequeued_count += deq_count;
+       q_data->queue_stats.enqueue_depth_avail = acc_aq_avail(q_data, 0);
+}
+
 /* Calculates number of CBs in processed encoder TB based on 'r' and input
  * length.
  */
diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index ab69350080..d2a0a36e12 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -892,6 +892,7 @@ acc100_queue_stop(struct rte_bbdev *dev, uint16_t queue_id)
        dev->data->queues[queue_id].queue_stats.dequeue_err_count = 0;
        dev->data->queues[queue_id].queue_stats.enqueue_warn_count = 0;
        dev->data->queues[queue_id].queue_stats.dequeue_warn_count = 0;
+       dev->data->queues[queue_id].queue_stats.enqueue_depth_avail = 0;

        return 0;
 }
@@ -3196,9 +3197,7 @@ acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -3245,9 +3244,7 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, desc_idx, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -3284,9 +3281,7 @@ acc100_enqueue_enc_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -3322,9 +3317,7 @@ acc100_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -3388,9 +3381,7 @@ acc100_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -3426,9 +3417,7 @@ acc100_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -3468,9 +3457,7 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -3505,9 +3492,7 @@ acc100_enqueue_dec_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -3897,8 +3882,7 @@ acc100_dequeue_enc(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_descs;

-       /* Update enqueue stats */
-       q_data->queue_stats.dequeued_count += dequeued_ops;
+       acc_update_qstat_dequeue(q_data, dequeued_ops);

        return dequeued_ops;
 }
@@ -3940,8 +3924,7 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_descs;

-       /* Update enqueue stats */
-       q_data->queue_stats.dequeued_count += dequeued_ops;
+       acc_update_qstat_dequeue(q_data, dequeued_ops);

        return dequeued_ops;
 }
@@ -3986,8 +3969,7 @@ acc100_dequeue_dec(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_cbs;

-       /* Update enqueue stats */
-       q_data->queue_stats.dequeued_count += i;
+       acc_update_qstat_dequeue(q_data, i);

        return i;
 }
@@ -4033,8 +4015,7 @@ acc100_dequeue_ldpc_dec(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_cbs;

-       /* Update enqueue stats */
-       q_data->queue_stats.dequeued_count += i;
+       acc_update_qstat_dequeue(q_data, i);

        return i;
 }
diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
index 585dc49bd6..630b514f03 100644
--- a/drivers/baseband/acc/rte_vrb_pmd.c
+++ b/drivers/baseband/acc/rte_vrb_pmd.c
@@ -1109,6 +1109,7 @@ vrb_queue_stop(struct rte_bbdev *dev, uint16_t queue_id)
        dev->data->queues[queue_id].queue_stats.dequeue_err_count = 0;
        dev->data->queues[queue_id].queue_stats.enqueue_warn_count = 0;
        dev->data->queues[queue_id].queue_stats.dequeue_warn_count = 0;
+       dev->data->queues[queue_id].queue_stats.enqueue_depth_avail = 0;
        return 0;
 }

@@ -2738,9 +2739,7 @@ vrb_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -2778,9 +2777,7 @@ vrb_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, desc_idx, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -2817,9 +2814,7 @@ vrb_enqueue_enc_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -2864,9 +2859,7 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -2926,9 +2919,7 @@ vrb_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -2961,9 +2952,7 @@ vrb_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -3004,9 +2993,7 @@ vrb_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -3041,9 +3028,7 @@ vrb_enqueue_dec_tb(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);

        return i;
 }
@@ -3453,8 +3438,7 @@ vrb_dequeue_enc(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_descs;

-       /* Update enqueue stats. */
-       q_data->queue_stats.dequeued_count += dequeued_ops;
+       acc_update_qstat_dequeue(q_data, dequeued_ops);

        return dequeued_ops;
 }
@@ -3496,8 +3480,7 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_descs;

-       /* Update enqueue stats. */
-       q_data->queue_stats.dequeued_count += dequeued_ops;
+       acc_update_qstat_dequeue(q_data, dequeued_ops);

        return dequeued_ops;
 }
@@ -3535,8 +3518,7 @@ vrb_dequeue_dec(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_cbs;

-       /* Update enqueue stats */
-       q_data->queue_stats.dequeued_count += i;
+       acc_update_qstat_dequeue(q_data, i);

        return i;
 }
@@ -3575,8 +3557,7 @@ vrb_dequeue_ldpc_dec(struct rte_bbdev_queue_data *q_data,
        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_cbs;

-       /* Update enqueue stats. */
-       q_data->queue_stats.dequeued_count += i;
+       acc_update_qstat_dequeue(q_data, i);

        return i;
 }
@@ -3782,9 +3763,7 @@ vrb_enqueue_fft(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, i, &q_data->queue_stats);

-       /* Update stats */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -3851,8 +3830,7 @@ vrb_dequeue_fft(struct rte_bbdev_queue_data *q_data,

        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_cbs;
-       /* Update enqueue stats. */
-       q_data->queue_stats.dequeued_count += i;
+       acc_update_qstat_dequeue(q_data, i);
        return i;
 }

@@ -4106,9 +4084,7 @@ vrb2_enqueue_mldts(struct rte_bbdev_queue_data *q_data,

        acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats);

-       /* Update stats. */
-       q_data->queue_stats.enqueued_count += i;
-       q_data->queue_stats.enqueue_err_count += num - i;
+       acc_update_qstat_enqueue(q_data, i, num - i);
        return i;
 }

@@ -4207,8 +4183,9 @@ vrb2_dequeue_mldts(struct rte_bbdev_queue_data *q_data,

        q->aq_dequeued += aq_dequeued;
        q->sw_ring_tail += dequeued_cbs;
-       /* Update enqueue stats. */
-       q_data->queue_stats.dequeued_count += i;
+
+       acc_update_qstat_dequeue(q_data, i);
+
        return i;
 }

--
2.34.1

--------------g7MWQsMyDsQ0zQpFqLzwcKC8--