DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Hernan Vargas <hernan.vargas@intel.com>,
	dev@dpdk.org, gakhil@marvell.com, trix@redhat.com
Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com
Subject: Re: [PATCH v2 05/10] baseband/acc: enhance SW ring alignment
Date: Tue, 8 Oct 2024 09:51:40 +0200	[thread overview]
Message-ID: <e04ee275-1606-4475-90bb-a3b2692d60a5@redhat.com> (raw)
In-Reply-To: <20241003204912.131319-6-hernan.vargas@intel.com>



On 10/3/24 22:49, Hernan Vargas wrote:
> Calculate the aligned total size required for queue rings, ensuring that
> the size is a power of two for proper memory allocation.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   drivers/baseband/acc/acc_common.h | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h
> index 0d1c26166ff2..8ac1ca001c1d 100644
> --- a/drivers/baseband/acc/acc_common.h
> +++ b/drivers/baseband/acc/acc_common.h
> @@ -767,19 +767,20 @@ alloc_sw_rings_min_mem(struct rte_bbdev *dev, struct acc_device *d,
>   	int i = 0;
>   	uint32_t q_sw_ring_size = ACC_MAX_QUEUE_DEPTH * get_desc_len();
>   	uint32_t dev_sw_ring_size = q_sw_ring_size * num_queues;
> -	/* Free first in case this is a reconfiguration */
> +	uint32_t alignment = q_sw_ring_size * rte_align32pow2(num_queues);
> +	/* Free first in case this is dev_sw_ring_size, q_sw_ring_size, socket); reconfiguration */

There is a copy/paste mistake in the comment?

>   	rte_free(d->sw_rings_base);
>   
>   	/* Find an aligned block of memory to store sw rings */
>   	while (i < ACC_SW_RING_MEM_ALLOC_ATTEMPTS) {
>   		/*
>   		 * sw_ring allocated memory is guaranteed to be aligned to
> -		 * q_sw_ring_size at the condition that the requested size is
> +		 * alignment at the condition that the requested size is

This comment is really unclear "aligned to alignment"

>   		 * less than the page size
>   		 */
>   		sw_rings_base = rte_zmalloc_socket(
>   				dev->device->driver->name,
> -				dev_sw_ring_size, q_sw_ring_size, socket);
> +				dev_sw_ring_size, alignment, socket);
>   
>   		if (sw_rings_base == NULL) {
>   			rte_acc_log(ERR,


  reply	other threads:[~2024-10-08  7:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 20:49 [PATCH v2 00/10] acc baseband PMD fix and updates for 24.11 Hernan Vargas
2024-10-03 20:49 ` [PATCH v2 01/10] baseband/acc: fix access to deallocated mem Hernan Vargas
2024-10-03 20:49 ` [PATCH v2 02/10] baseband/acc: queue allocation refactor Hernan Vargas
2024-10-04 12:08   ` Maxime Coquelin
2024-10-04 18:19     ` Chautru, Nicolas
2024-10-07  9:31       ` Maxime Coquelin
2024-10-07 16:45         ` Chautru, Nicolas
2024-10-08  7:38           ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 03/10] baseband/acc: configure max queues per device Hernan Vargas
2024-10-08  7:43   ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 04/10] baseband/acc: future proof structure comparison Hernan Vargas
2024-10-08  7:49   ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 05/10] baseband/acc: enhance SW ring alignment Hernan Vargas
2024-10-08  7:51   ` Maxime Coquelin [this message]
2024-10-08 20:19     ` Chautru, Nicolas
2024-10-03 20:49 ` [PATCH v2 06/10] baseband/acc: remove soft output bypass Hernan Vargas
2024-10-08  8:00   ` Maxime Coquelin
2024-10-09 16:38     ` Chautru, Nicolas
2024-10-03 20:49 ` [PATCH v2 07/10] baseband/acc: algorithm tuning for LDPC decoder Hernan Vargas
2024-10-08  8:06   ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 08/10] baseband/acc: remove check on HARQ memory Hernan Vargas
2024-10-08  8:08   ` Maxime Coquelin
2024-10-08 15:38     ` Chautru, Nicolas
2024-10-03 20:49 ` [PATCH v2 09/10] baseband/acc: reset ring data valid bit Hernan Vargas
2024-10-08  8:08   ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 10/10] baseband/acc: cosmetic changes Hernan Vargas
2024-10-08  8:11   ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e04ee275-1606-4475-90bb-a3b2692d60a5@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hernan.vargas@intel.com \
    --cc=nicolas.chautru@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).