Skip to contentSkip to conversation

baseband/acc: fix ring memory allocation logic\

PATCH Applied Nicolas Chautru 2 participants 4 messages Nov 8, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover baseband/acc: fix ring memory allocation logic\

Hi Maxime,

v2: following your suggestion which is best indeed.

Can you please review and apply that fix for 24.11.

Thanks,
Nic

Nicolas Chautru (1):
baseband/acc: fix ring memory allocation logic

 drivers/baseband/acc/acc_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/1 baseband/acc: fix ring memory allocation logic

Allowing ring memory allocation whose end address is aligned with 64 MB. Previous logic was off by one.

Fixes 060e76729302 ("baseband/acc100: add queue configuration")
---
 drivers/baseband/acc/acc_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/baseband/acc/acc_common.h +1 -1
index 4c60b7896b..bf218332be 100644
@@ -795,7 +795,7 @@ alloc_sw_rings_min_mem(struct rte_bbdev *dev, struct acc_device *d,
 				sw_rings_base, ACC_SIZE_64MBYTE);
 		next_64mb_align_addr_iova = sw_rings_base_iova +
 				next_64mb_align_offset;
-		sw_ring_iova_end_addr = sw_rings_base_iova + dev_sw_ring_size;
+		sw_ring_iova_end_addr = sw_rings_base_iova + dev_sw_ring_size - 1;
 
 		/* Check if the end of the sw ring memory block is before the
 		 * start of next 64MB aligned mem address
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#2 lore raw

Re: [PATCH v2 1/1] baseband/acc: fix ring memory allocation logic

Quoted 16 lines · Nicolas Chautru

Allowing ring memory allocation whose end address is aligned with 64 MB. Previous logic was off by one.

Fixes 060e76729302 ("baseband/acc100: add queue configuration")
---
  drivers/baseband/acc/acc_common.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/baseband/acc/acc_common.h +0 -0
index 4c60b7896b..bf218332be 100644

drivers/baseband/acc/acc_common.h alloc_sw_rings_min_mem(struct rte_bbdev *dev, struct acc_device *d, · line 801

Quoted 8 lines
drivers/baseband/acc/acc_common.h +1 -1
@@ -795,7 +795,7 @@ alloc_sw_rings_min_mem(struct rte_bbdev *dev, struct acc_device *d,
  				sw_rings_base, ACC_SIZE_64MBYTE);
  		next_64mb_align_addr_iova = sw_rings_base_iova +
  				next_64mb_align_offset;
-		sw_ring_iova_end_addr = sw_rings_base_iova + dev_sw_ring_size;
+		sw_ring_iova_end_addr = sw_rings_base_iova + dev_sw_ring_size - 1;
 
  		/* Check if the end of the sw ring memory block is before the
  		 * start of next 64MB aligned mem address

Thanks,
Maxime

#3 lore raw

Re: [PATCH v2 1/1] baseband/acc: fix ring memory allocation logic

In reply to Nicolas Chautru
Quoted 11 lines · Nicolas Chautru

Allowing ring memory allocation whose end address is aligned with 64 MB. Previous logic was off by one.

Fixes 060e76729302 ("baseband/acc100: add queue configuration")
---
  drivers/baseband/acc/acc_common.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to next-baseband/for-main

Thanks,
Maxime