common/cnxk: add flag for enabling opaque mode

Message ID 20250304052525.796933-1-nkishor@marvell.com (mailing list archive)
State Accepted
Delegated to: Jerin Jacob
Headers
Series common/cnxk: add flag for enabling opaque mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Nawal Kishor March 4, 2025, 5:25 a.m. UTC
Added flag that overrides the default natural alignment mode and uses
opaque mode.

Signed-off-by: Nawal Kishor <nkishor@marvell.com>
---
 drivers/common/cnxk/roc_npa.c | 3 +++
 drivers/common/cnxk/roc_npa.h | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob April 1, 2025, 9:50 a.m. UTC | #1
> -----Original Message-----
> From: Nawal Kishor <nkishor@marvell.com>
> Sent: Tuesday, March 4, 2025 10:55 AM
> To: dev@dpdk.org; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>;
> Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>
> Cc: Jerin Jacob <jerinj@marvell.com>; Ashwin Sekhar T K
> <asekhar@marvell.com>; Nawal Kishor <nkishor@marvell.com>
> Subject: [PATCH] common/cnxk: add flag for enabling opaque mode
> 
> Added flag that overrides the default natural alignment mode and uses opaque
> mode.
> 
> Signed-off-by: Nawal Kishor <nkishor@marvell.com>

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.

    Signed-off-by: Nawal Kishor <nkishor@marvell.com>


> ---
>  drivers/common/cnxk/roc_npa.c | 3 +++
>  drivers/common/cnxk/roc_npa.h | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/common/cnxk/roc_npa.c b/drivers/common/cnxk/roc_npa.c
> index a33f9a8499..d5ebfbfc11 100644
> --- a/drivers/common/cnxk/roc_npa.c
> +++ b/drivers/common/cnxk/roc_npa.c
> @@ -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) {
> diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h
> index 8525038810..853c0fed43 100644
> --- a/drivers/common/cnxk/roc_npa.h
> +++ b/drivers/common/cnxk/roc_npa.h
> @@ -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
  

Patch

diff --git a/drivers/common/cnxk/roc_npa.c b/drivers/common/cnxk/roc_npa.c
index a33f9a8499..d5ebfbfc11 100644
--- a/drivers/common/cnxk/roc_npa.c
+++ b/drivers/common/cnxk/roc_npa.c
@@ -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) {
diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h
index 8525038810..853c0fed43 100644
--- a/drivers/common/cnxk/roc_npa.h
+++ b/drivers/common/cnxk/roc_npa.h
@@ -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 {