Skip to contentSkip to conversation

common/cnxk: align npa stack to roc cache line size

PATCH Applied Ashwin Sekhar T K 3 participants 6 messages Aug 30, 2021 – Sep 21, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: align npa stack to roc cache line size

NPA stack should be aligned to ROC cache line size.

Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")
---
 drivers/common/cnxk/roc_npa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +1 -1
index d064d125c1..a0d2cc8f19 100644
@@ -194,7 +194,7 @@ npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
 {
 	const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
 
-	return plt_memzone_reserve_cache_align(mz_name, size);
+	return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
 }
 
 static inline int
Signature · 1 line
2.32.0
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 6 lines · Ashwin Sekhar T K

NPA stack should be aligned to ROC cache line size.

Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 20 lines
---
 drivers/common/cnxk/roc_npa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +1 -2
index d064d125c1..a0d2cc8f19 100644
@@ -194,7 +194,7 @@ npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
 {
        const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
 
-       return plt_memzone_reserve_cache_align(mz_name, size);
+       return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
 }
 
 static inline int
--

2.32.0

#2 lore raw
In reply to Ashwin Sekhar T K
Quoted 2 lines · Ashwin Sekhar T K

NPA stack should be aligned to ROC cache line size.

Can you please document the long versions of 'NPA' & 'ROC' abbreviations?

Also for the patch title, since abbreviations needs to be uppercase, to automate the check for these abbreviations, can you please add them to './devtools/words-case.txt' in separate patch.

And can you add some more context on the reasoning of the change, why it should be aligned to cache line?
What is the impact user/application sees if it is not aligned, and after aligned?

Thanks,
ferruh

Quoted 21 lines
Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")
---
 drivers/common/cnxk/roc_npa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +1 -1
index d064d125c1..a0d2cc8f19 100644
@@ -194,7 +194,7 @@ npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
 {
 	const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
 
-	return plt_memzone_reserve_cache_align(mz_name, size);
+	return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
 }
 
 static inline int
#3 lore raw
Quoted 10 lines · Ferruh Yigit
Quoted 2 lines · Ashwin Sekhar T K

NPA stack should be aligned to ROC cache line size.

Can you please document the long versions of 'NPA' & 'ROC' abbreviations?

Also for the patch title, since abbreviations needs to be uppercase, to automate the check for these abbreviations, can you please add them to './devtools/words-case.txt' in separate patch.

Please do add NIX, NPC, CPT, SSO, LBK, MCAM too.

Quoted 29 lines

And can you add some more context on the reasoning of the change, why it should be aligned to cache line?
What is the impact user/application sees if it is not aligned, and after aligned?

Thanks,
ferruh

Quoted 21 lines
Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")
---
 drivers/common/cnxk/roc_npa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +1 -1
index d064d125c1..a0d2cc8f19 100644
@@ -194,7 +194,7 @@ npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
 {
      const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
 
-     return plt_memzone_reserve_cache_align(mz_name, size);
+     return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
 }
 
 static inline int
#4 lore raw

PATCH v2 1/1 common/cnxk: align NPA stack to ROC cache line size

In reply to Ashwin Sekhar T K

Network Pool accelerator (NPA) is part of ROC (Rest Of Chip). So NPA structures should be aligned to ROC Cache line size and not CPU cache line size.

Non alignment of NPA stack to ROC cache line will result in undefined runtime NPA behaviour.

Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")
---
 drivers/common/cnxk/roc_npa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +1 -1
index d064d125c1..a0d2cc8f19 100644
@@ -194,7 +194,7 @@ npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
 {
 	const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
 
-	return plt_memzone_reserve_cache_align(mz_name, size);
+	return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
 }
 
 static inline int
Signature · 1 line
2.32.0
Applied
#5 lore raw

Re: [dpdk-dev] [PATCH v2] common/cnxk: align NPA stack to ROC cache line size

Quoted 5 lines · Ashwin Sekhar T K

Network Pool accelerator (NPA) is part of ROC (Rest Of Chip). So NPA structures should be aligned to ROC Cache line size and not CPU cache line size.

Quoted 7 lines

Non alignment of NPA stack to ROC cache line will result in undefined runtime NPA behaviour.

Fixes f765f5611240 ("common/cnxk: add NPA pool HW operations")

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 20 lines
---
 drivers/common/cnxk/roc_npa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +1 -2
index d064d125c1..a0d2cc8f19 100644
@@ -194,7 +194,7 @@ npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
 {
        const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
 
-       return plt_memzone_reserve_cache_align(mz_name, size);
+       return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
 }
 
 static inline int
--

2.32.0