Skip to contentSkip to conversation

common/cnxk: add flag for enabling opaque mode

PATCH In review Nawal Kishor 2 participants 2 messages Mar 4, 2025 – Apr 1, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: add flag for enabling opaque mode

Added flag that overrides the default natural alignment mode and uses opaque mode.

---
 drivers/common/cnxk/roc_npa.c | 3 +++
 drivers/common/cnxk/roc_npa.h | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +3 -0
index a33f9a8499..d5ebfbfc11 100644
@@ -669,6 +669,9 @@ roc_npa_pool_create(uint64_t *aura_handle, uint32_t block_size,
 		pool = &defpool;
 	}
 
+	if (flags & ROC_NPA_FORCE_OPAQUE_MODE_F)
+		pool->nat_align = 0;
+
 	rc = npa_aura_pool_pair_alloc(lf, block_size, block_count, aura, pool,
 				      aura_handle, flags);
 	if (rc) {
drivers/common/cnxk/roc_npa.h +2 -1
index 8525038810..853c0fed43 100644
@@ -767,7 +767,8 @@ int __roc_api roc_npa_dev_init(struct roc_npa *roc_npa);
 int __roc_api roc_npa_dev_fini(struct roc_npa *roc_npa);
 
 /* Flags to pool create */
-#define ROC_NPA_ZERO_AURA_F BIT(0)
+#define ROC_NPA_ZERO_AURA_F	    BIT(0)
+#define ROC_NPA_FORCE_OPAQUE_MODE_F BIT(1)
 
 /* Enumerations */
 enum roc_npa_buf_type {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Nawal Kishor <[email protected]>
Sent: Tuesday, March 4, 2025 10:55 AM
To: [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Harman Kalra <[email protected]>
Cc: Jerin Jacob <[email protected]>; Ashwin Sekhar T K <[email protected]>; Nawal Kishor <[email protected]>
Subject: [PATCH] common/cnxk: add flag for enabling opaque mode

Quoted 4 lines

Added flag that overrides the default natural alignment mode and uses opaque mode.

Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-main. Thanks

common/cnxk: support enabling opaque mode

Added flag that overrides the default natural alignment mode and uses opaque mode.

Quoted 36 lines
---
 drivers/common/cnxk/roc_npa.c | 3 +++
 drivers/common/cnxk/roc_npa.h | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.c +3 -0
index a33f9a8499..d5ebfbfc11 100644
@@ -669,6 +669,9 @@ roc_npa_pool_create(uint64_t *aura_handle, uint32_t
 block_size,
 		pool = &defpool;
 	}
 
+	if (flags & ROC_NPA_FORCE_OPAQUE_MODE_F)
+		pool->nat_align = 0;
+
 	rc = npa_aura_pool_pair_alloc(lf, block_size, block_count, aura, pool,
 				      aura_handle, flags);
drivers/common/cnxk/roc_npa.c +0 -0
 	if (rc) {
drivers/common/cnxk/roc_npa.h +2 -2
index 8525038810..853c0fed43 100644
@@ -767,7 +767,8 @@ int __roc_api roc_npa_dev_init(struct roc_npa
 *roc_npa);  int __roc_api roc_npa_dev_fini(struct roc_npa *roc_npa);
 
 /* Flags to pool create */
-#define ROC_NPA_ZERO_AURA_F BIT(0)
+#define ROC_NPA_ZERO_AURA_F	    BIT(0)
+#define ROC_NPA_FORCE_OPAQUE_MODE_F BIT(1)
 
 /* Enumerations */
 enum roc_npa_buf_type {
--

2.34.1