Skip to contentSkip to conversation

cnxk: Add HALO support for CN20K mempool

PATCH Superseded Nawal Kishor 4 participants 18 messages Dec 4, 2025 – Feb 19 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover cnxk: Add HALO support for CN20K mempool

This patch series introduces HALO support for the CN20K platform. On earlier platforms (CN9K/CN10K), the NPA mempool required separate aura and pool contexts even for a 1:1 aura-to-pool mapping. This led to unnecessary context usage for the most common use case.

With CN20K, HALOs allow replacing this 1:1 aura/pool model with a single combined context, reducing context consumption and simplifying mempool management.

Patch 1 adds HALO creation support in the ROC common layer. Patch 2 integrates HALO usage into the CN20K mempool driver and adds a new "halo_ena" devarg to enable or disable this feature.

Nawal Kishor (2):
common/cnxk: add support for halos
mempool/cnxk: add halo support in mempool

 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 drivers/mempool/cnxk/cn10k_mempool_ops.c      |  19 +-
 drivers/mempool/cnxk/cn20k_mempool_ops.c      |  60 ++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c       |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |  40 ++-
 drivers/mempool/cnxk/cnxk_mempool.h           |  16 +-
 drivers/mempool/cnxk/cnxk_mempool_ops.c       |  11 +-
 drivers/mempool/cnxk/meson.build              |   1 +
 21 files changed, 750 insertions(+), 92 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/2 common/cnxk: add support for halos

In cn9k/cn10k NPA mempool creation required the creation of atleast one aura and pool context. Even, if the mapping between aura and pool was 1:1 (i.e, one aura mapped to one pool), separate contexts were required for aura and pool. This wasted the context space and most of common use case for NPA mempool is 1:1 mapping between aura and pool.

In cn20k, 1:1 aura pool mapping can now be replaced by using halos. Halos allow the creation of only one context which contains the information required for both aura and pool.

This patch adds the support for creation of Halos in ROC.

---
 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 14 files changed, 630 insertions(+), 63 deletions(-)
drivers/common/cnxk/hw/npa.h +81 -0
index 4fd1f9a64b..e421c70e01 100644
@@ -118,6 +118,7 @@
 
 #define NPA_AQ_CTYPE_AURA (0x0ull)
 #define NPA_AQ_CTYPE_POOL (0x1ull)
+#define NPA_AQ_CTYPE_HALO (0x2ull)
 
 #define NPA_BPINTF_NIX0_RX (0x0ull)
 #define NPA_BPINTF_NIX1_RX (0x1ull)
@@ -456,6 +457,86 @@ struct npa_cn20k_pool_s {
 	uint64_t rsvd_1023_960 : 64; /* W15 */
 };
 
+/* NPA halo context structure [CN20K] */
+struct npa_cn20k_halo_s {
+	uint64_t stack_base : 64; /* W0 */
+	uint64_t ena : 1; /* W1 */
+	uint64_t nat_align : 1;
+	uint64_t reserved_67_66 : 2;
+	uint64_t stack_caching : 1;
+	uint64_t reserved_71_69 : 3;
+	uint64_t aura_drop_ena : 1;
+	uint64_t reserved_79_73 : 7;
+	uint64_t aura_drop : 8;
+	uint64_t buf_offset : 12;
+	uint64_t reserved_103_100 : 4;
+	uint64_t buf_size : 12;
+	uint64_t reserved_119_116 : 4;
+	uint64_t ref_cnt_prof : 3;
+	uint64_t reserved_127_123 : 5;
+	uint64_t stack_max_pages : 32; /* W2 */
+	uint64_t stack_pages : 32;
+	uint64_t bp_0 : 7; /* W3 */
+	uint64_t bp_1 : 7;
+	uint64_t bp_2 : 7;
+	uint64_t bp_3 : 7;
+	uint64_t bp_4 : 7;
+	uint64_t bp_5 : 7;
+	uint64_t bp_6 : 7;
+	uint64_t bp_7 : 7;
+	uint64_t bp_ena_0 : 1;
+	uint64_t bp_ena_1 : 1;
+	uint64_t bp_ena_2 : 1;
+	uint64_t bp_ena_3 : 1;
+	uint64_t bp_ena_4 : 1;
+	uint64_t bp_ena_5 : 1;
+	uint64_t bp_ena_6 : 1;
+	uint64_t bp_ena_7 : 1;
+	uint64_t stack_offset : 4; /* W4 */
+	uint64_t reserved_263_260 : 4;
+	uint64_t shift : 6;
+	uint64_t reserved_271_270 : 2;
+	uint64_t avg_level : 8;
+	uint64_t avg_con : 9;
+	uint64_t fc_ena : 1;
+	uint64_t fc_stype : 2;
+	uint64_t fc_hyst_bits : 4;
+	uint64_t fc_up_crossing : 1;
+	uint64_t reserved_299_297 : 3;
+	uint64_t update_time : 16;
+	uint64_t reserved_319_316 : 4;
+	uint64_t fc_addr : 64;   /* W5 */
+	uint64_t ptr_start : 64; /* W6 */
+	uint64_t ptr_end : 64;   /* W7 */
+	uint64_t bpid_0 : 12; /* W8 */
+	uint64_t reserved_535_524 : 12;
+	uint64_t err_int : 8;
+	uint64_t err_int_ena : 8;
+	uint64_t thresh_int : 1;
+	uint64_t thresh_int_ena : 1;
+	uint64_t thresh_up : 1;
+	uint64_t reserved_555_555 : 1;
+	uint64_t thresh_qint_idx : 7;
+	uint64_t reserved_563_563 : 1;
+	uint64_t err_qint_idx : 7;
+	uint64_t reserved_575_571 : 5;
+	uint64_t thresh : 36; /* W9 */
+	uint64_t reserved_615_612 : 4;
+	uint64_t fc_msh_dst : 11;
+	uint64_t reserved_630_627 : 4;
+	uint64_t op_dpc_ena : 1;
+	uint64_t op_dpc_set : 5;
+	uint64_t reserved_637_637 : 1;
+	uint64_t stream_ctx : 1;
+	uint64_t unified_ctx : 1;
+	uint64_t reserved_703_640 : 64; /* W10 */
+	uint64_t reserved_767_704 : 64; /* W11 */
+	uint64_t reserved_831_768 : 64; /* W12 */
+	uint64_t reserved_895_832 : 64; /* W13 */
+	uint64_t reserved_959_896 : 64; /* W14 */
+	uint64_t reserved_1023_960 : 64; /* W15 */
+};
+
 /* NPA queue interrupt context hardware structure */
 struct npa_qint_hw_s {
 	uint32_t count : 22;
drivers/common/cnxk/roc_idev.c +25 -0
index 84812f73e0..6aa5b10ee9 100644
@@ -33,6 +33,7 @@ idev_set_defaults(struct idev_cfg *idev)
 	idev->npa = NULL;
 	idev->npa_pf_func = 0;
 	idev->max_pools = 128;
+	idev->halo_ena = 0;
 	idev->lmt_pf_func = 0;
 	idev->lmt_base_addr = 0;
 	idev->num_lmtlines = 0;
@@ -123,6 +124,30 @@ roc_idev_npa_maxpools_set(uint32_t max_pools)
 		__atomic_store_n(&idev->max_pools, max_pools, __ATOMIC_RELEASE);
 }
 
+int
+roc_idev_npa_halo_ena_get(void)
+{
+	struct idev_cfg *idev;
+	int halo_ena;
+
+	idev = idev_get_cfg();
+	halo_ena = 0;
+	if (idev != NULL)
+		halo_ena = __atomic_load_n(&idev->halo_ena, __ATOMIC_ACQUIRE);
+
+	return halo_ena;
+}
+
+void
+roc_idev_npa_halo_ena_set(int halo_ena)
+{
+	struct idev_cfg *idev;
+
+	idev = idev_get_cfg();
+	if (idev != NULL)
+		__atomic_store_n(&idev->halo_ena, halo_ena, __ATOMIC_RELEASE);
+}
+
 uint16_t
 idev_npa_lf_active(struct dev *dev)
 {
drivers/common/cnxk/roc_idev.h +3 -0
index 6edb5f83b2..3803963b07 100644
@@ -8,6 +8,9 @@
 uint32_t __roc_api roc_idev_npa_maxpools_get(void);
 void __roc_api roc_idev_npa_maxpools_set(uint32_t max_pools);
 
+int __roc_api roc_idev_npa_halo_ena_get(void);
+void __roc_api roc_idev_npa_halo_ena_set(int halo_ena);
+
 /* LMT */
 uint64_t __roc_api roc_idev_lmt_base_addr_get(void);
 uint16_t __roc_api roc_idev_num_lmtlines_get(void);
drivers/common/cnxk/roc_idev_priv.h +1 -0
index 98b6286bfe..dde555535b 100644
@@ -30,6 +30,7 @@ struct idev_cfg {
 	struct npa_lf *npa;
 	uint16_t npa_refcnt;
 	uint32_t max_pools;
+	int halo_ena;
 	uint16_t lmt_pf_func;
 	uint16_t num_lmtlines;
 	uint64_t lmt_base_addr;
drivers/common/cnxk/roc_mbox.h +6 -0
index 3e913fa13c..3176c87382 100644
@@ -1397,6 +1397,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == WRITE/INIT and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 	/* Mask data when op == WRITE (1=write, 0=don't write) */
 	union {
@@ -1404,6 +1406,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura_mask;
 		/* Valid when op == WRITE and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool_mask;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo_mask;
 	};
 };
 
@@ -1414,6 +1418,8 @@ struct npa_cn20k_aq_enq_rsp {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == READ and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == READ and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 };
 
drivers/common/cnxk/roc_nix.h +1 -0
index 326decde2b..aa197eb95e 100644
@@ -595,6 +595,7 @@ struct roc_nix {
 	uintptr_t lmt_base;
 	bool io_enabled;
 	bool rx_ptp_ena;
+	bool sqb_halo_ena;
 	uint16_t cints;
 	uint32_t buf_sz;
 	uint64_t meta_aura_handle;
drivers/common/cnxk/roc_nix_queue.c +31 -15

59 lines not on this page · raw message

drivers/common/cnxk/roc_npa.c +245 -23

443 lines not on this page · raw message

drivers/common/cnxk/roc_npa.h +17 -3
index 336a43f95c..18808e5873 100644
@@ -21,7 +21,9 @@
 
 #define ROC_AURA_OP_LIMIT_MASK (BIT_ULL(36) - 1)
 
-#define ROC_NPA_MAX_BLOCK_SZ		   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN9K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN10K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN20K	   (256 * 1024)
 #define ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS 512
 #define ROC_CN10K_NPA_BATCH_FREE_MAX_PTRS  15U
 #define ROC_CN10K_NPA_BATCH_FREE_BURST_MAX 16U
@@ -36,6 +38,17 @@
  */
 #define ROC_CN9K_NPA_BULK_ALLOC_MAX_PTRS 30
 
+static inline uint32_t
+roc_npa_max_block_size(void)
+{
+	if (roc_model_is_cn20k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN20K;
+	else if (roc_model_is_cn10k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN10K;
+	else
+		return ROC_NPA_MAX_BLOCK_SZ_CN9K;
+}
+
 /*
  * Generate 64bit handle to have optimized alloc and free aura operation.
  * 0 - ROC_AURA_ID_MASK for storing the aura_id.
@@ -767,8 +780,9 @@ 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_FORCE_OPAQUE_MODE_F BIT(1)
+#define ROC_NPA_ZERO_AURA_F		BIT(0)
+#define ROC_NPA_FORCE_OPAQUE_MODE_F	BIT(1)
+#define ROC_NPA_HALO_F			BIT(2)
 
 /* Enumerations */
 enum roc_npa_buf_type {
drivers/common/cnxk/roc_npa_debug.c +189 -12

243 lines not on this page · raw message

drivers/common/cnxk/roc_npa_priv.h +3 -0
index 0223e4a438..e437fe831a 100644
@@ -14,6 +14,8 @@ enum npa_error_status {
 	NPA_ERR_AURA_POOL_FINI = -517,
 	NPA_ERR_BASE_INVALID = -518,
 	NPA_ERR_DEVICE_NOT_BOUNDED = -519,
+	NPA_ERR_HALO_INIT = -520,
+	NPA_ERR_HALO_FINI = -521,
 };
 
 struct npa_lf {
@@ -55,6 +57,7 @@ struct npa_aura_attr {
 	uint64_t shift;
 	uint64_t limit;
 	uint8_t bp_ena;
+	bool halo;
 	union {
 		uint8_t bp;	      /* CN9K, CN10K */
 		uint8_t bp_thresh[8]; /* CN20K */
drivers/common/cnxk/roc_platform_base_symbols.c +2 -0
index 43095741f5..79dd18fbd7 100644
@@ -85,6 +85,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha256_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha512_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_set)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_get)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_set)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_lmt_base_addr_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_num_lmtlines_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_cpt_get)
drivers/common/cnxk/roc_sso.c +25 -10
index 1d82e5b978..b07454a7f0 100644
@@ -834,8 +834,6 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 			uint32_t nb_xae, uint32_t xae_waes,
 			uint32_t xaq_buf_size, uint16_t nb_hwgrp)
 {
-	struct npa_pool_s pool;
-	struct npa_aura_s aura;
 	plt_iova_t iova;
 	uint32_t i;
 	int rc;
@@ -877,15 +875,32 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 		goto free_fc;
 	}
 
-	memset(&pool, 0, sizeof(struct npa_pool_s));
-	pool.nat_align = 1;
+	if (roc_model_is_cn20k() && xaq->halo_ena) {
+		struct npa_cn20k_halo_s halo;
+
+		memset(&halo, 0, sizeof(struct npa_cn20k_halo_s));
+		halo.nat_align = 1;
+		halo.fc_ena = 1;
+		halo.fc_addr = (uint64_t)xaq->fc;
+		halo.fc_hyst_bits = 0; /* Store count on all updates */
+		halo.unified_ctx = 1;
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 NULL, (struct npa_pool_s *)&halo, ROC_NPA_HALO_F);
+	} else {
+		struct npa_pool_s pool;
+		struct npa_aura_s aura;
+
+		memset(&pool, 0, sizeof(struct npa_pool_s));
+		pool.nat_align = 1;
+
+		memset(&aura, 0, sizeof(aura));
+		aura.fc_ena = 1;
+		aura.fc_addr = (uint64_t)xaq->fc;
+		aura.fc_hyst_bits = 0; /* Store count on all updates */
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 &aura, &pool, 0);
+	}
 
-	memset(&aura, 0, sizeof(aura));
-	aura.fc_ena = 1;
-	aura.fc_addr = (uint64_t)xaq->fc;
-	aura.fc_hyst_bits = 0; /* Store count on all updates */
-	rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
-				 &aura, &pool, 0);
 	if (rc) {
 		plt_err("Failed to create XAQ pool");
 		goto npa_fail;
drivers/common/cnxk/roc_sso.h +1 -0
index f1ad34bcc7..9d8356abb1 100644
@@ -43,6 +43,7 @@ struct roc_sso_xaq_data {
 	uint32_t nb_xae;
 	uint32_t xaq_lmt;
 	uint64_t aura_handle;
+	int halo_ena;
 	void *fc;
 	void *mem;
 };
Signature · 1 line
2.48.1
#2 lore raw

v2 cover cnxk: add HALO support for CN20K mempool

This series of patches adds support for HALO in CNXK mempool driver.

Changes in v2:
* Fixed compilation warnings.

Nawal Kishor (2):
common/cnxk: add support for halos
mempool/cnxk: add halo support in mempool

 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 drivers/mempool/cnxk/cn10k_mempool_ops.c      |  19 +-
 drivers/mempool/cnxk/cn20k_mempool_ops.c      |  60 ++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c       |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |  40 ++-
 drivers/mempool/cnxk/cnxk_mempool.h           |  16 +-
 drivers/mempool/cnxk/cnxk_mempool_ops.c       |  11 +-
 drivers/mempool/cnxk/meson.build              |   1 +
 21 files changed, 750 insertions(+), 92 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
Signature · 1 line
2.48.1
#3 lore raw

PATCH v2 1/2 common/cnxk: add support for halos

In cn9k/cn10k NPA mempool creation required the creation of at least one aura and pool context. Even, if the mapping between aura and pool was 1:1 (i.e, one aura mapped to one pool), separate contexts were required for aura and pool. This wasted the context space and most of common use case for NPA mempool is 1:1 mapping between aura and pool.

In cn20k, 1:1 aura pool mapping can now be replaced by using halos. Halos allow the creation of only one context which contains the information required for both aura and pool.

This patch adds the support for creation of Halos in ROC.

---
v2:
* Fixed compilation warnings.

 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 14 files changed, 630 insertions(+), 63 deletions(-)
drivers/common/cnxk/hw/npa.h +81 -0
index 4fd1f9a64b..e421c70e01 100644
@@ -118,6 +118,7 @@
 
 #define NPA_AQ_CTYPE_AURA (0x0ull)
 #define NPA_AQ_CTYPE_POOL (0x1ull)
+#define NPA_AQ_CTYPE_HALO (0x2ull)
 
 #define NPA_BPINTF_NIX0_RX (0x0ull)
 #define NPA_BPINTF_NIX1_RX (0x1ull)
@@ -456,6 +457,86 @@ struct npa_cn20k_pool_s {
 	uint64_t rsvd_1023_960 : 64; /* W15 */
 };
 
+/* NPA halo context structure [CN20K] */
+struct npa_cn20k_halo_s {
+	uint64_t stack_base : 64; /* W0 */
+	uint64_t ena : 1; /* W1 */
+	uint64_t nat_align : 1;
+	uint64_t reserved_67_66 : 2;
+	uint64_t stack_caching : 1;
+	uint64_t reserved_71_69 : 3;
+	uint64_t aura_drop_ena : 1;
+	uint64_t reserved_79_73 : 7;
+	uint64_t aura_drop : 8;
+	uint64_t buf_offset : 12;
+	uint64_t reserved_103_100 : 4;
+	uint64_t buf_size : 12;
+	uint64_t reserved_119_116 : 4;
+	uint64_t ref_cnt_prof : 3;
+	uint64_t reserved_127_123 : 5;
+	uint64_t stack_max_pages : 32; /* W2 */
+	uint64_t stack_pages : 32;
+	uint64_t bp_0 : 7; /* W3 */
+	uint64_t bp_1 : 7;
+	uint64_t bp_2 : 7;
+	uint64_t bp_3 : 7;
+	uint64_t bp_4 : 7;
+	uint64_t bp_5 : 7;
+	uint64_t bp_6 : 7;
+	uint64_t bp_7 : 7;
+	uint64_t bp_ena_0 : 1;
+	uint64_t bp_ena_1 : 1;
+	uint64_t bp_ena_2 : 1;
+	uint64_t bp_ena_3 : 1;
+	uint64_t bp_ena_4 : 1;
+	uint64_t bp_ena_5 : 1;
+	uint64_t bp_ena_6 : 1;
+	uint64_t bp_ena_7 : 1;
+	uint64_t stack_offset : 4; /* W4 */
+	uint64_t reserved_263_260 : 4;
+	uint64_t shift : 6;
+	uint64_t reserved_271_270 : 2;
+	uint64_t avg_level : 8;
+	uint64_t avg_con : 9;
+	uint64_t fc_ena : 1;
+	uint64_t fc_stype : 2;
+	uint64_t fc_hyst_bits : 4;
+	uint64_t fc_up_crossing : 1;
+	uint64_t reserved_299_297 : 3;
+	uint64_t update_time : 16;
+	uint64_t reserved_319_316 : 4;
+	uint64_t fc_addr : 64;   /* W5 */
+	uint64_t ptr_start : 64; /* W6 */
+	uint64_t ptr_end : 64;   /* W7 */
+	uint64_t bpid_0 : 12; /* W8 */
+	uint64_t reserved_535_524 : 12;
+	uint64_t err_int : 8;
+	uint64_t err_int_ena : 8;
+	uint64_t thresh_int : 1;
+	uint64_t thresh_int_ena : 1;
+	uint64_t thresh_up : 1;
+	uint64_t reserved_555_555 : 1;
+	uint64_t thresh_qint_idx : 7;
+	uint64_t reserved_563_563 : 1;
+	uint64_t err_qint_idx : 7;
+	uint64_t reserved_575_571 : 5;
+	uint64_t thresh : 36; /* W9 */
+	uint64_t reserved_615_612 : 4;
+	uint64_t fc_msh_dst : 11;
+	uint64_t reserved_630_627 : 4;
+	uint64_t op_dpc_ena : 1;
+	uint64_t op_dpc_set : 5;
+	uint64_t reserved_637_637 : 1;
+	uint64_t stream_ctx : 1;
+	uint64_t unified_ctx : 1;
+	uint64_t reserved_703_640 : 64; /* W10 */
+	uint64_t reserved_767_704 : 64; /* W11 */
+	uint64_t reserved_831_768 : 64; /* W12 */
+	uint64_t reserved_895_832 : 64; /* W13 */
+	uint64_t reserved_959_896 : 64; /* W14 */
+	uint64_t reserved_1023_960 : 64; /* W15 */
+};
+
 /* NPA queue interrupt context hardware structure */
 struct npa_qint_hw_s {
 	uint32_t count : 22;
drivers/common/cnxk/roc_idev.c +25 -0
index 84812f73e0..6aa5b10ee9 100644
@@ -33,6 +33,7 @@ idev_set_defaults(struct idev_cfg *idev)
 	idev->npa = NULL;
 	idev->npa_pf_func = 0;
 	idev->max_pools = 128;
+	idev->halo_ena = 0;
 	idev->lmt_pf_func = 0;
 	idev->lmt_base_addr = 0;
 	idev->num_lmtlines = 0;
@@ -123,6 +124,30 @@ roc_idev_npa_maxpools_set(uint32_t max_pools)
 		__atomic_store_n(&idev->max_pools, max_pools, __ATOMIC_RELEASE);
 }
 
+int
+roc_idev_npa_halo_ena_get(void)
+{
+	struct idev_cfg *idev;
+	int halo_ena;
+
+	idev = idev_get_cfg();
+	halo_ena = 0;
+	if (idev != NULL)
+		halo_ena = __atomic_load_n(&idev->halo_ena, __ATOMIC_ACQUIRE);
+
+	return halo_ena;
+}
+
+void
+roc_idev_npa_halo_ena_set(int halo_ena)
+{
+	struct idev_cfg *idev;
+
+	idev = idev_get_cfg();
+	if (idev != NULL)
+		__atomic_store_n(&idev->halo_ena, halo_ena, __ATOMIC_RELEASE);
+}
+
 uint16_t
 idev_npa_lf_active(struct dev *dev)
 {
drivers/common/cnxk/roc_idev.h +3 -0
index 6edb5f83b2..3803963b07 100644
@@ -8,6 +8,9 @@
 uint32_t __roc_api roc_idev_npa_maxpools_get(void);
 void __roc_api roc_idev_npa_maxpools_set(uint32_t max_pools);
 
+int __roc_api roc_idev_npa_halo_ena_get(void);
+void __roc_api roc_idev_npa_halo_ena_set(int halo_ena);
+
 /* LMT */
 uint64_t __roc_api roc_idev_lmt_base_addr_get(void);
 uint16_t __roc_api roc_idev_num_lmtlines_get(void);
drivers/common/cnxk/roc_idev_priv.h +1 -0
index 98b6286bfe..dde555535b 100644
@@ -30,6 +30,7 @@ struct idev_cfg {
 	struct npa_lf *npa;
 	uint16_t npa_refcnt;
 	uint32_t max_pools;
+	int halo_ena;
 	uint16_t lmt_pf_func;
 	uint16_t num_lmtlines;
 	uint64_t lmt_base_addr;
drivers/common/cnxk/roc_mbox.h +6 -0
index 3e913fa13c..3176c87382 100644
@@ -1397,6 +1397,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == WRITE/INIT and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 	/* Mask data when op == WRITE (1=write, 0=don't write) */
 	union {
@@ -1404,6 +1406,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura_mask;
 		/* Valid when op == WRITE and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool_mask;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo_mask;
 	};
 };
 
@@ -1414,6 +1418,8 @@ struct npa_cn20k_aq_enq_rsp {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == READ and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == READ and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 };
 
drivers/common/cnxk/roc_nix.h +1 -0
index 326decde2b..aa197eb95e 100644
@@ -595,6 +595,7 @@ struct roc_nix {
 	uintptr_t lmt_base;
 	bool io_enabled;
 	bool rx_ptp_ena;
+	bool sqb_halo_ena;
 	uint16_t cints;
 	uint32_t buf_sz;
 	uint64_t meta_aura_handle;
drivers/common/cnxk/roc_nix_queue.c +31 -15

59 lines not on this page · raw message

drivers/common/cnxk/roc_npa.c +245 -23

443 lines not on this page · raw message

drivers/common/cnxk/roc_npa.h +17 -3
index 336a43f95c..18808e5873 100644
@@ -21,7 +21,9 @@
 
 #define ROC_AURA_OP_LIMIT_MASK (BIT_ULL(36) - 1)
 
-#define ROC_NPA_MAX_BLOCK_SZ		   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN9K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN10K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN20K	   (256 * 1024)
 #define ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS 512
 #define ROC_CN10K_NPA_BATCH_FREE_MAX_PTRS  15U
 #define ROC_CN10K_NPA_BATCH_FREE_BURST_MAX 16U
@@ -36,6 +38,17 @@
  */
 #define ROC_CN9K_NPA_BULK_ALLOC_MAX_PTRS 30
 
+static inline uint32_t
+roc_npa_max_block_size(void)
+{
+	if (roc_model_is_cn20k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN20K;
+	else if (roc_model_is_cn10k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN10K;
+	else
+		return ROC_NPA_MAX_BLOCK_SZ_CN9K;
+}
+
 /*
  * Generate 64bit handle to have optimized alloc and free aura operation.
  * 0 - ROC_AURA_ID_MASK for storing the aura_id.
@@ -767,8 +780,9 @@ 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_FORCE_OPAQUE_MODE_F BIT(1)
+#define ROC_NPA_ZERO_AURA_F		BIT(0)
+#define ROC_NPA_FORCE_OPAQUE_MODE_F	BIT(1)
+#define ROC_NPA_HALO_F			BIT(2)
 
 /* Enumerations */
 enum roc_npa_buf_type {
drivers/common/cnxk/roc_npa_debug.c +189 -12

243 lines not on this page · raw message

drivers/common/cnxk/roc_npa_priv.h +3 -0
index 0223e4a438..e437fe831a 100644
@@ -14,6 +14,8 @@ enum npa_error_status {
 	NPA_ERR_AURA_POOL_FINI = -517,
 	NPA_ERR_BASE_INVALID = -518,
 	NPA_ERR_DEVICE_NOT_BOUNDED = -519,
+	NPA_ERR_HALO_INIT = -520,
+	NPA_ERR_HALO_FINI = -521,
 };
 
 struct npa_lf {
@@ -55,6 +57,7 @@ struct npa_aura_attr {
 	uint64_t shift;
 	uint64_t limit;
 	uint8_t bp_ena;
+	bool halo;
 	union {
 		uint8_t bp;	      /* CN9K, CN10K */
 		uint8_t bp_thresh[8]; /* CN20K */
drivers/common/cnxk/roc_platform_base_symbols.c +2 -0
index 43095741f5..79dd18fbd7 100644
@@ -85,6 +85,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha256_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha512_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_set)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_get)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_set)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_lmt_base_addr_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_num_lmtlines_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_cpt_get)
drivers/common/cnxk/roc_sso.c +25 -10
index 1d82e5b978..b07454a7f0 100644
@@ -834,8 +834,6 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 			uint32_t nb_xae, uint32_t xae_waes,
 			uint32_t xaq_buf_size, uint16_t nb_hwgrp)
 {
-	struct npa_pool_s pool;
-	struct npa_aura_s aura;
 	plt_iova_t iova;
 	uint32_t i;
 	int rc;
@@ -877,15 +875,32 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 		goto free_fc;
 	}
 
-	memset(&pool, 0, sizeof(struct npa_pool_s));
-	pool.nat_align = 1;
+	if (roc_model_is_cn20k() && xaq->halo_ena) {
+		struct npa_cn20k_halo_s halo;
+
+		memset(&halo, 0, sizeof(struct npa_cn20k_halo_s));
+		halo.nat_align = 1;
+		halo.fc_ena = 1;
+		halo.fc_addr = (uint64_t)xaq->fc;
+		halo.fc_hyst_bits = 0; /* Store count on all updates */
+		halo.unified_ctx = 1;
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 NULL, (struct npa_pool_s *)&halo, ROC_NPA_HALO_F);
+	} else {
+		struct npa_pool_s pool;
+		struct npa_aura_s aura;
+
+		memset(&pool, 0, sizeof(struct npa_pool_s));
+		pool.nat_align = 1;
+
+		memset(&aura, 0, sizeof(aura));
+		aura.fc_ena = 1;
+		aura.fc_addr = (uint64_t)xaq->fc;
+		aura.fc_hyst_bits = 0; /* Store count on all updates */
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 &aura, &pool, 0);
+	}
 
-	memset(&aura, 0, sizeof(aura));
-	aura.fc_ena = 1;
-	aura.fc_addr = (uint64_t)xaq->fc;
-	aura.fc_hyst_bits = 0; /* Store count on all updates */
-	rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
-				 &aura, &pool, 0);
 	if (rc) {
 		plt_err("Failed to create XAQ pool");
 		goto npa_fail;
drivers/common/cnxk/roc_sso.h +1 -0
index f1ad34bcc7..9d8356abb1 100644
@@ -43,6 +43,7 @@ struct roc_sso_xaq_data {
 	uint32_t nb_xae;
 	uint32_t xaq_lmt;
 	uint64_t aura_handle;
+	int halo_ena;
 	void *fc;
 	void *mem;
 };
Signature · 1 line
2.48.1
#4 lore raw

PATCH v2 2/2 mempool/cnxk: add halo support in mempool

In reply to Nawal Kishor

This patch adds the support of halos in CN20K mempool driver. It introduces a new devargs parameter "halo_ena" to enable or disable halo feature. If halo_ena is set to 1, halos will be enabled for NPA pools created by the mempool driver.

---
v2:
* Fixed compilation warnings.

 drivers/mempool/cnxk/cn10k_mempool_ops.c | 19 ++++----
 drivers/mempool/cnxk/cn20k_mempool_ops.c | 60 ++++++++++++++++++++++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c  |  2 +-
 drivers/mempool/cnxk/cnxk_mempool.c      | 40 +++++++++++-----
 drivers/mempool/cnxk/cnxk_mempool.h      | 16 ++++++-
 drivers/mempool/cnxk/cnxk_mempool_ops.c  | 11 +++--
 drivers/mempool/cnxk/meson.build         |  1 +
 7 files changed, 120 insertions(+), 29 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
drivers/mempool/cnxk/cn10k_mempool_ops.c +8 -11
index a5be0ccafe..09f900a850 100644
@@ -2,9 +2,6 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_mempool.h>
-
-#include "roc_api.h"
 #include "cnxk_mempool.h"
 
 #define BATCH_ALLOC_SZ              ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS
@@ -79,7 +76,7 @@ batch_op_data_set(uint64_t pool_id, struct batch_op_data *op_data)
 	batch_op_data_tbl[aura] = op_data;
 }
 
-static int
+int
 batch_op_init(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -109,7 +106,7 @@ batch_op_init(struct rte_mempool *mp)
 	return 0;
 }
 
-static void
+void
 batch_op_fini(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -149,7 +146,7 @@ batch_op_fini(struct rte_mempool *mp)
 	rte_wmb();
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 		  unsigned int n)
 {
@@ -181,7 +178,7 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 	return 0;
 }
 
-static unsigned int
+unsigned int
 cn10k_mempool_get_count(const struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -326,7 +323,7 @@ mempool_deq_batch_sync(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return count;
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	struct batch_op_data *op_data;
@@ -353,7 +350,7 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return 0;
 }
 
-static int
+int
 cn10k_mempool_alloc(struct rte_mempool *mp)
 {
 	uint32_t block_size;
@@ -376,7 +373,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 		block_size += padding;
 	}
 
-	rc = cnxk_mempool_alloc(mp);
+	rc = cnxk_mempool_alloc(mp, 0);
 	if (rc)
 		return rc;
 
@@ -392,7 +389,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 	return rc;
 }
 
-static void
+void
 cn10k_mempool_free(struct rte_mempool *mp)
 {
 	batch_op_fini(mp);
drivers/mempool/cnxk/cn20k_mempool_ops.c new file +60 -0

60 lines not on this page · raw message

drivers/mempool/cnxk/cn9k_mempool_ops.c +1 -1
index b7967f8085..8248071cb7 100644
@@ -72,7 +72,7 @@ cn9k_mempool_alloc(struct rte_mempool *mp)
 	padding = ((block_size / ROC_ALIGN) % 2) ? 0 : ROC_ALIGN;
 	mp->trailer_size += padding;
 
-	return cnxk_mempool_alloc(mp);
+	return cnxk_mempool_alloc(mp, 0);
 }
 
 static struct rte_mempool_ops cn9k_mempool_ops = {
drivers/mempool/cnxk/cnxk_mempool.c +29 -11
index 6ff11d8004..6939fccff4 100644
@@ -18,6 +18,7 @@
 #define CNXK_NPA_DEV_NAME	 RTE_STR(cnxk_npa_dev_)
 #define CNXK_NPA_DEV_NAME_LEN	 (sizeof(CNXK_NPA_DEV_NAME) + PCI_PRI_STR_SIZE)
 #define CNXK_NPA_MAX_POOLS_PARAM "max_pools"
+#define CNXK_NPA_HALO_ENA_PARAM	 "halo_ena"
 
 static inline uint32_t
 npa_aura_size_to_u32(uint8_t val)
@@ -46,30 +47,46 @@ parse_max_pools_handler(const char *key, const char *value, void *extra_args)
 	return 0;
 }
 
-static inline uint32_t
-parse_max_pools(struct rte_devargs *devargs)
+static int
+parse_halo_ena_handler(const char *key, const char *value, void *extra_args)
+{
+	RTE_SET_USED(key);
+	uint8_t val;
+
+	val = atoi(value);
+	if (val != 0 && val != 1)
+		return -EINVAL;
+
+	*(uint8_t *)extra_args = val;
+	return 0;
+}
+
+static int
+cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
 {
 	uint32_t max_pools = npa_aura_size_to_u32(NPA_AURA_SZ_128);
+	struct rte_devargs *devargs = pci_dev->device.devargs;
 	struct rte_kvargs *kvlist;
+	uint32_t halo_ena = 0;
 
 	if (devargs == NULL)
-		goto exit;
+		goto null_devargs;
 	kvlist = rte_kvargs_parse(devargs->args, NULL);
 	if (kvlist == NULL)
 		goto exit;
 
 	rte_kvargs_process(kvlist, CNXK_NPA_MAX_POOLS_PARAM,
 			   &parse_max_pools_handler, &max_pools);
+	rte_kvargs_process(kvlist, CNXK_NPA_HALO_ENA_PARAM,
+			   &parse_halo_ena_handler, &halo_ena);
 	rte_kvargs_free(kvlist);
-exit:
-	return max_pools;
-}
 
-static int
-cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
-{
-	roc_idev_npa_maxpools_set(parse_max_pools(pci_dev->device.devargs));
+null_devargs:
+	roc_idev_npa_maxpools_set(max_pools);
+	roc_idev_npa_halo_ena_set(halo_ena);
 	return 0;
+exit:
+	return -EINVAL;
 }
 
 static inline char *
@@ -201,7 +218,8 @@ RTE_PMD_REGISTER_PCI(mempool_cnxk, npa_pci);
 RTE_PMD_REGISTER_PCI_TABLE(mempool_cnxk, npa_pci_map);
 RTE_PMD_REGISTER_KMOD_DEP(mempool_cnxk, "vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(mempool_cnxk,
-			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>");
+			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>"
+			      CNXK_NPA_HALO_ENA_PARAM "=<0-1>");
 
 RTE_INIT(cnxk_mempool_parse_devargs)
 {
drivers/mempool/cnxk/cnxk_mempool.h +14 -2
index 669e617952..941290061e 100644
@@ -7,6 +7,8 @@
 
 #include <rte_mempool.h>
 
+#include "roc_api.h"
+
 enum cnxk_mempool_flags {
 	/* This flag is used to ensure that only aura zero is allocated.
 	 * If aura zero is not available, then mempool creation fails.
@@ -47,7 +49,7 @@ int cnxk_mempool_populate(struct rte_mempool *mp, unsigned int max_objs,
 			  void *vaddr, rte_iova_t iova, size_t len,
 			  rte_mempool_populate_obj_cb_t *obj_cb,
 			  void *obj_cb_arg);
-int cnxk_mempool_alloc(struct rte_mempool *mp);
+int cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags);
 void cnxk_mempool_free(struct rte_mempool *mp);
 
 int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
@@ -55,6 +57,16 @@ int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 int __rte_hot cnxk_mempool_deq(struct rte_mempool *mp, void **obj_table,
 			       unsigned int n);
 
+int batch_op_init(struct rte_mempool *mp);
+void batch_op_fini(struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
+				unsigned int n);
+unsigned int cn10k_mempool_get_count(const struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table,
+				unsigned int n);
+int cn10k_mempool_alloc(struct rte_mempool *mp);
+void cn10k_mempool_free(struct rte_mempool *mp);
+
 int cn10k_mempool_plt_init(void);
 
-#endif
+#endif /* _CNXK_MEMPOOL_H_ */
drivers/mempool/cnxk/cnxk_mempool_ops.c +7 -4
index 5c7fcea487..01b6247fbb 100644
@@ -70,9 +70,9 @@ cnxk_mempool_calc_mem_size(const struct rte_mempool *mp, uint32_t obj_num,
 }
 
 int
-cnxk_mempool_alloc(struct rte_mempool *mp)
+cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags)
 {
-	uint32_t block_count, flags, roc_flags = 0;
+	uint32_t block_count, flags;
 	uint64_t aura_handle = 0;
 	struct npa_aura_s aura;
 	struct npa_pool_s pool;
@@ -98,7 +98,7 @@ cnxk_mempool_alloc(struct rte_mempool *mp)
 
 	flags = CNXK_MEMPOOL_FLAGS(mp);
 	if (flags & CNXK_MEMPOOL_F_ZERO_AURA) {
-		roc_flags = ROC_NPA_ZERO_AURA_F;
+		roc_flags |= ROC_NPA_ZERO_AURA_F;
 	} else if (flags & CNXK_MEMPOOL_F_CUSTOM_AURA) {
 		struct npa_aura_s *paura;
 
@@ -192,9 +192,12 @@ cnxk_mempool_plt_init(void)
 
 	if (roc_model_is_cn9k()) {
 		rte_mbuf_set_platform_mempool_ops("cn9k_mempool_ops");
-	} else if (roc_model_is_cn10k() || roc_model_is_cn20k()) {
+	} else if (roc_model_is_cn10k()) {
 		rte_mbuf_set_platform_mempool_ops("cn10k_mempool_ops");
 		rc = cn10k_mempool_plt_init();
+	} else if (roc_model_is_cn20k()) {
+		rte_mbuf_set_platform_mempool_ops("cn20k_mempool_ops");
+		rc = cn10k_mempool_plt_init();
 	}
 	return rc;
 }
drivers/mempool/cnxk/meson.build +1 -0
index e388cce26a..7722264320 100644
@@ -14,6 +14,7 @@ sources = files(
         'cnxk_mempool_telemetry.c',
         'cn9k_mempool_ops.c',
         'cn10k_mempool_ops.c',
+        'cn20k_mempool_ops.c',
         'cn10k_hwpool_ops.c',
 )
 
Signature · 1 line
2.48.1
#5 lore raw

v3 cover Add HALO support for CN20K mempool

This series of patches adds support for HALO in CNXK mempool driver.

Changes in v3:
* Added documentation for HALO support in CNXK mempool driver.

Nawal Kishor (2):
common/cnxk: add support for halos
mempool/cnxk: add halo support in mempool

 doc/guides/mempool/cnxk.rst                   |  24 +-
 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 drivers/mempool/cnxk/cn10k_mempool_ops.c      |  19 +-
 drivers/mempool/cnxk/cn20k_mempool_ops.c      |  60 ++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c       |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |  40 ++-
 drivers/mempool/cnxk/cnxk_mempool.h           |  16 +-
 drivers/mempool/cnxk/cnxk_mempool_ops.c       |  11 +-
 drivers/mempool/cnxk/meson.build              |   1 +
 22 files changed, 771 insertions(+), 95 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
Signature · 1 line
2.48.1
#6 lore raw

PATCH v3 1/2 common/cnxk: add support for halos

In cn9k/cn10k, NPA mempool creation required the creation of at least one aura and pool context. Even, if the mapping between aura and pool was 1:1 (i.e, one aura mapped to one pool), separate contexts were required for aura and pool. This wasted the context space and most of common use case for NPA mempool is 1:1 mapping between aura and pool.

In cn20k, 1:1 aura pool mapping can now be replaced by using halos. Halos allow the creation of only one context which contains the information required for both aura and pool.

This patch adds the support for creation of Halos in ROC.

---
 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 14 files changed, 630 insertions(+), 63 deletions(-)
drivers/common/cnxk/hw/npa.h +81 -0
index 4fd1f9a64b..e421c70e01 100644
@@ -118,6 +118,7 @@
 
 #define NPA_AQ_CTYPE_AURA (0x0ull)
 #define NPA_AQ_CTYPE_POOL (0x1ull)
+#define NPA_AQ_CTYPE_HALO (0x2ull)
 
 #define NPA_BPINTF_NIX0_RX (0x0ull)
 #define NPA_BPINTF_NIX1_RX (0x1ull)
@@ -456,6 +457,86 @@ struct npa_cn20k_pool_s {
 	uint64_t rsvd_1023_960 : 64; /* W15 */
 };
 
+/* NPA halo context structure [CN20K] */
+struct npa_cn20k_halo_s {
+	uint64_t stack_base : 64; /* W0 */
+	uint64_t ena : 1; /* W1 */
+	uint64_t nat_align : 1;
+	uint64_t reserved_67_66 : 2;
+	uint64_t stack_caching : 1;
+	uint64_t reserved_71_69 : 3;
+	uint64_t aura_drop_ena : 1;
+	uint64_t reserved_79_73 : 7;
+	uint64_t aura_drop : 8;
+	uint64_t buf_offset : 12;
+	uint64_t reserved_103_100 : 4;
+	uint64_t buf_size : 12;
+	uint64_t reserved_119_116 : 4;
+	uint64_t ref_cnt_prof : 3;
+	uint64_t reserved_127_123 : 5;
+	uint64_t stack_max_pages : 32; /* W2 */
+	uint64_t stack_pages : 32;
+	uint64_t bp_0 : 7; /* W3 */
+	uint64_t bp_1 : 7;
+	uint64_t bp_2 : 7;
+	uint64_t bp_3 : 7;
+	uint64_t bp_4 : 7;
+	uint64_t bp_5 : 7;
+	uint64_t bp_6 : 7;
+	uint64_t bp_7 : 7;
+	uint64_t bp_ena_0 : 1;
+	uint64_t bp_ena_1 : 1;
+	uint64_t bp_ena_2 : 1;
+	uint64_t bp_ena_3 : 1;
+	uint64_t bp_ena_4 : 1;
+	uint64_t bp_ena_5 : 1;
+	uint64_t bp_ena_6 : 1;
+	uint64_t bp_ena_7 : 1;
+	uint64_t stack_offset : 4; /* W4 */
+	uint64_t reserved_263_260 : 4;
+	uint64_t shift : 6;
+	uint64_t reserved_271_270 : 2;
+	uint64_t avg_level : 8;
+	uint64_t avg_con : 9;
+	uint64_t fc_ena : 1;
+	uint64_t fc_stype : 2;
+	uint64_t fc_hyst_bits : 4;
+	uint64_t fc_up_crossing : 1;
+	uint64_t reserved_299_297 : 3;
+	uint64_t update_time : 16;
+	uint64_t reserved_319_316 : 4;
+	uint64_t fc_addr : 64;   /* W5 */
+	uint64_t ptr_start : 64; /* W6 */
+	uint64_t ptr_end : 64;   /* W7 */
+	uint64_t bpid_0 : 12; /* W8 */
+	uint64_t reserved_535_524 : 12;
+	uint64_t err_int : 8;
+	uint64_t err_int_ena : 8;
+	uint64_t thresh_int : 1;
+	uint64_t thresh_int_ena : 1;
+	uint64_t thresh_up : 1;
+	uint64_t reserved_555_555 : 1;
+	uint64_t thresh_qint_idx : 7;
+	uint64_t reserved_563_563 : 1;
+	uint64_t err_qint_idx : 7;
+	uint64_t reserved_575_571 : 5;
+	uint64_t thresh : 36; /* W9 */
+	uint64_t reserved_615_612 : 4;
+	uint64_t fc_msh_dst : 11;
+	uint64_t reserved_630_627 : 4;
+	uint64_t op_dpc_ena : 1;
+	uint64_t op_dpc_set : 5;
+	uint64_t reserved_637_637 : 1;
+	uint64_t stream_ctx : 1;
+	uint64_t unified_ctx : 1;
+	uint64_t reserved_703_640 : 64; /* W10 */
+	uint64_t reserved_767_704 : 64; /* W11 */
+	uint64_t reserved_831_768 : 64; /* W12 */
+	uint64_t reserved_895_832 : 64; /* W13 */
+	uint64_t reserved_959_896 : 64; /* W14 */
+	uint64_t reserved_1023_960 : 64; /* W15 */
+};
+
 /* NPA queue interrupt context hardware structure */
 struct npa_qint_hw_s {
 	uint32_t count : 22;
drivers/common/cnxk/roc_idev.c +25 -0
index 84812f73e0..6aa5b10ee9 100644
@@ -33,6 +33,7 @@ idev_set_defaults(struct idev_cfg *idev)
 	idev->npa = NULL;
 	idev->npa_pf_func = 0;
 	idev->max_pools = 128;
+	idev->halo_ena = 0;
 	idev->lmt_pf_func = 0;
 	idev->lmt_base_addr = 0;
 	idev->num_lmtlines = 0;
@@ -123,6 +124,30 @@ roc_idev_npa_maxpools_set(uint32_t max_pools)
 		__atomic_store_n(&idev->max_pools, max_pools, __ATOMIC_RELEASE);
 }
 
+int
+roc_idev_npa_halo_ena_get(void)
+{
+	struct idev_cfg *idev;
+	int halo_ena;
+
+	idev = idev_get_cfg();
+	halo_ena = 0;
+	if (idev != NULL)
+		halo_ena = __atomic_load_n(&idev->halo_ena, __ATOMIC_ACQUIRE);
+
+	return halo_ena;
+}
+
+void
+roc_idev_npa_halo_ena_set(int halo_ena)
+{
+	struct idev_cfg *idev;
+
+	idev = idev_get_cfg();
+	if (idev != NULL)
+		__atomic_store_n(&idev->halo_ena, halo_ena, __ATOMIC_RELEASE);
+}
+
 uint16_t
 idev_npa_lf_active(struct dev *dev)
 {
drivers/common/cnxk/roc_idev.h +3 -0
index 6edb5f83b2..3803963b07 100644
@@ -8,6 +8,9 @@
 uint32_t __roc_api roc_idev_npa_maxpools_get(void);
 void __roc_api roc_idev_npa_maxpools_set(uint32_t max_pools);
 
+int __roc_api roc_idev_npa_halo_ena_get(void);
+void __roc_api roc_idev_npa_halo_ena_set(int halo_ena);
+
 /* LMT */
 uint64_t __roc_api roc_idev_lmt_base_addr_get(void);
 uint16_t __roc_api roc_idev_num_lmtlines_get(void);
drivers/common/cnxk/roc_idev_priv.h +1 -0
index 98b6286bfe..dde555535b 100644
@@ -30,6 +30,7 @@ struct idev_cfg {
 	struct npa_lf *npa;
 	uint16_t npa_refcnt;
 	uint32_t max_pools;
+	int halo_ena;
 	uint16_t lmt_pf_func;
 	uint16_t num_lmtlines;
 	uint64_t lmt_base_addr;
drivers/common/cnxk/roc_mbox.h +6 -0
index 3e913fa13c..3176c87382 100644
@@ -1397,6 +1397,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == WRITE/INIT and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 	/* Mask data when op == WRITE (1=write, 0=don't write) */
 	union {
@@ -1404,6 +1406,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura_mask;
 		/* Valid when op == WRITE and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool_mask;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo_mask;
 	};
 };
 
@@ -1414,6 +1418,8 @@ struct npa_cn20k_aq_enq_rsp {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == READ and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == READ and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 };
 
drivers/common/cnxk/roc_nix.h +1 -0
index 326decde2b..aa197eb95e 100644
@@ -595,6 +595,7 @@ struct roc_nix {
 	uintptr_t lmt_base;
 	bool io_enabled;
 	bool rx_ptp_ena;
+	bool sqb_halo_ena;
 	uint16_t cints;
 	uint32_t buf_sz;
 	uint64_t meta_aura_handle;
drivers/common/cnxk/roc_nix_queue.c +31 -15

59 lines not on this page · raw message

drivers/common/cnxk/roc_npa.c +245 -23

443 lines not on this page · raw message

drivers/common/cnxk/roc_npa.h +17 -3
index 336a43f95c..18808e5873 100644
@@ -21,7 +21,9 @@
 
 #define ROC_AURA_OP_LIMIT_MASK (BIT_ULL(36) - 1)
 
-#define ROC_NPA_MAX_BLOCK_SZ		   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN9K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN10K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN20K	   (256 * 1024)
 #define ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS 512
 #define ROC_CN10K_NPA_BATCH_FREE_MAX_PTRS  15U
 #define ROC_CN10K_NPA_BATCH_FREE_BURST_MAX 16U
@@ -36,6 +38,17 @@
  */
 #define ROC_CN9K_NPA_BULK_ALLOC_MAX_PTRS 30
 
+static inline uint32_t
+roc_npa_max_block_size(void)
+{
+	if (roc_model_is_cn20k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN20K;
+	else if (roc_model_is_cn10k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN10K;
+	else
+		return ROC_NPA_MAX_BLOCK_SZ_CN9K;
+}
+
 /*
  * Generate 64bit handle to have optimized alloc and free aura operation.
  * 0 - ROC_AURA_ID_MASK for storing the aura_id.
@@ -767,8 +780,9 @@ 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_FORCE_OPAQUE_MODE_F BIT(1)
+#define ROC_NPA_ZERO_AURA_F		BIT(0)
+#define ROC_NPA_FORCE_OPAQUE_MODE_F	BIT(1)
+#define ROC_NPA_HALO_F			BIT(2)
 
 /* Enumerations */
 enum roc_npa_buf_type {
drivers/common/cnxk/roc_npa_debug.c +189 -12

243 lines not on this page · raw message

drivers/common/cnxk/roc_npa_priv.h +3 -0
index 0223e4a438..e437fe831a 100644
@@ -14,6 +14,8 @@ enum npa_error_status {
 	NPA_ERR_AURA_POOL_FINI = -517,
 	NPA_ERR_BASE_INVALID = -518,
 	NPA_ERR_DEVICE_NOT_BOUNDED = -519,
+	NPA_ERR_HALO_INIT = -520,
+	NPA_ERR_HALO_FINI = -521,
 };
 
 struct npa_lf {
@@ -55,6 +57,7 @@ struct npa_aura_attr {
 	uint64_t shift;
 	uint64_t limit;
 	uint8_t bp_ena;
+	bool halo;
 	union {
 		uint8_t bp;	      /* CN9K, CN10K */
 		uint8_t bp_thresh[8]; /* CN20K */
drivers/common/cnxk/roc_platform_base_symbols.c +2 -0
index 43095741f5..79dd18fbd7 100644
@@ -85,6 +85,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha256_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha512_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_set)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_get)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_set)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_lmt_base_addr_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_num_lmtlines_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_cpt_get)
drivers/common/cnxk/roc_sso.c +25 -10
index 1d82e5b978..b07454a7f0 100644
@@ -834,8 +834,6 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 			uint32_t nb_xae, uint32_t xae_waes,
 			uint32_t xaq_buf_size, uint16_t nb_hwgrp)
 {
-	struct npa_pool_s pool;
-	struct npa_aura_s aura;
 	plt_iova_t iova;
 	uint32_t i;
 	int rc;
@@ -877,15 +875,32 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 		goto free_fc;
 	}
 
-	memset(&pool, 0, sizeof(struct npa_pool_s));
-	pool.nat_align = 1;
+	if (roc_model_is_cn20k() && xaq->halo_ena) {
+		struct npa_cn20k_halo_s halo;
+
+		memset(&halo, 0, sizeof(struct npa_cn20k_halo_s));
+		halo.nat_align = 1;
+		halo.fc_ena = 1;
+		halo.fc_addr = (uint64_t)xaq->fc;
+		halo.fc_hyst_bits = 0; /* Store count on all updates */
+		halo.unified_ctx = 1;
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 NULL, (struct npa_pool_s *)&halo, ROC_NPA_HALO_F);
+	} else {
+		struct npa_pool_s pool;
+		struct npa_aura_s aura;
+
+		memset(&pool, 0, sizeof(struct npa_pool_s));
+		pool.nat_align = 1;
+
+		memset(&aura, 0, sizeof(aura));
+		aura.fc_ena = 1;
+		aura.fc_addr = (uint64_t)xaq->fc;
+		aura.fc_hyst_bits = 0; /* Store count on all updates */
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 &aura, &pool, 0);
+	}
 
-	memset(&aura, 0, sizeof(aura));
-	aura.fc_ena = 1;
-	aura.fc_addr = (uint64_t)xaq->fc;
-	aura.fc_hyst_bits = 0; /* Store count on all updates */
-	rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
-				 &aura, &pool, 0);
 	if (rc) {
 		plt_err("Failed to create XAQ pool");
 		goto npa_fail;
drivers/common/cnxk/roc_sso.h +1 -0
index f1ad34bcc7..9d8356abb1 100644
@@ -43,6 +43,7 @@ struct roc_sso_xaq_data {
 	uint32_t nb_xae;
 	uint32_t xaq_lmt;
 	uint64_t aura_handle;
+	int halo_ena;
 	void *fc;
 	void *mem;
 };
Signature · 1 line
2.48.1
#7 lore raw

PATCH v3 2/2 mempool/cnxk: add halo support in mempool

In reply to Nawal Kishor

This patch adds the support of halos in CN20K mempool driver. It introduces a new devargs parameter "halo_ena" to enable or disable halo feature. If halo_ena is set to 1, halos will be enabled for NPA pools created by the mempool driver.

---
v3:
* Added details about the new "halo_ena" parameter in the documentation.

 doc/guides/mempool/cnxk.rst              | 24 ++++++++--
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 19 ++++----
 drivers/mempool/cnxk/cn20k_mempool_ops.c | 60 ++++++++++++++++++++++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c  |  2 +-
 drivers/mempool/cnxk/cnxk_mempool.c      | 40 +++++++++++-----
 drivers/mempool/cnxk/cnxk_mempool.h      | 16 ++++++-
 drivers/mempool/cnxk/cnxk_mempool_ops.c  | 11 +++--
 drivers/mempool/cnxk/meson.build         |  1 +
 8 files changed, 141 insertions(+), 32 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
doc/guides/mempool/cnxk.rst +21 -3
index 3d0729245a..178ff99acf 100644
@@ -5,7 +5,7 @@ cnxk NPA Mempool Driver
 =======================
 
 The cnxk NPA PMD (**librte_mempool_cnxk**) provides mempool driver support for
-the integrated mempool device found in **Marvell OCTEON CN9K/CN10K** SoC family.
+the integrated mempool device found in **Marvell OCTEON CN9K/CN10K/CN20K** SoC family.
 
 More information about cnxk SoC can be found at `Marvell Official Website
 <https://www.marvell.com/embedded-processors/infrastructure-processors/>`_.
@@ -30,6 +30,11 @@ CN10k NPA supports:
 - Batch dequeue of up to 512 pointers with single instruction.
 - Batch enqueue of up to 15 pointers with single instruction.
 
+CN20k NPA supports:
+
+- HALO support for 1:1 aura-pool mapping, which uses a single unified context
+  instead of separate aura and pool contexts, saving HW context space.
+
 Prerequisites and Compilation procedure
 ---------------------------------------
 
@@ -56,11 +61,24 @@ Runtime Config Options
   With the above configuration, the driver will set up only 512 mempools for
   the given application to save HW resources.
 
+- ``HALO enable`` (default ``0``)
+
+  The HALO feature is available on CN20K platforms and allows 1:1 aura-pool
+  mapping to use a single unified context instead of separate aura and pool
+  contexts, saving HW context space. This parameter enables or disables HALO
+  support for NPA pools created by the mempool driver.
+  For example::
+
+    -a 0002:02:00.0,halo_ena=1
+
+  With the above configuration, HALO support will be enabled for mempools created
+  on CN20K platforms.
+
 .. note::
 
    Since this configuration is per application, the end user needs to
-   provide ``max_pools`` parameter to the first PCIe device probed by the given
-   application.
+   provide ``max_pools`` and/or ``halo_ena`` parameter to the first PCIe device
+   probed by the given application.
 
 Debugging Options
 ~~~~~~~~~~~~~~~~~
drivers/mempool/cnxk/cn10k_mempool_ops.c +8 -11
index a5be0ccafe..09f900a850 100644
@@ -2,9 +2,6 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_mempool.h>
-
-#include "roc_api.h"
 #include "cnxk_mempool.h"
 
 #define BATCH_ALLOC_SZ              ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS
@@ -79,7 +76,7 @@ batch_op_data_set(uint64_t pool_id, struct batch_op_data *op_data)
 	batch_op_data_tbl[aura] = op_data;
 }
 
-static int
+int
 batch_op_init(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -109,7 +106,7 @@ batch_op_init(struct rte_mempool *mp)
 	return 0;
 }
 
-static void
+void
 batch_op_fini(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -149,7 +146,7 @@ batch_op_fini(struct rte_mempool *mp)
 	rte_wmb();
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 		  unsigned int n)
 {
@@ -181,7 +178,7 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 	return 0;
 }
 
-static unsigned int
+unsigned int
 cn10k_mempool_get_count(const struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -326,7 +323,7 @@ mempool_deq_batch_sync(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return count;
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	struct batch_op_data *op_data;
@@ -353,7 +350,7 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return 0;
 }
 
-static int
+int
 cn10k_mempool_alloc(struct rte_mempool *mp)
 {
 	uint32_t block_size;
@@ -376,7 +373,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 		block_size += padding;
 	}
 
-	rc = cnxk_mempool_alloc(mp);
+	rc = cnxk_mempool_alloc(mp, 0);
 	if (rc)
 		return rc;
 
@@ -392,7 +389,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 	return rc;
 }
 
-static void
+void
 cn10k_mempool_free(struct rte_mempool *mp)
 {
 	batch_op_fini(mp);
drivers/mempool/cnxk/cn20k_mempool_ops.c new file +60 -0

60 lines not on this page · raw message

drivers/mempool/cnxk/cn9k_mempool_ops.c +1 -1
index b7967f8085..8248071cb7 100644
@@ -72,7 +72,7 @@ cn9k_mempool_alloc(struct rte_mempool *mp)
 	padding = ((block_size / ROC_ALIGN) % 2) ? 0 : ROC_ALIGN;
 	mp->trailer_size += padding;
 
-	return cnxk_mempool_alloc(mp);
+	return cnxk_mempool_alloc(mp, 0);
 }
 
 static struct rte_mempool_ops cn9k_mempool_ops = {
drivers/mempool/cnxk/cnxk_mempool.c +29 -11
index 6ff11d8004..6939fccff4 100644
@@ -18,6 +18,7 @@
 #define CNXK_NPA_DEV_NAME	 RTE_STR(cnxk_npa_dev_)
 #define CNXK_NPA_DEV_NAME_LEN	 (sizeof(CNXK_NPA_DEV_NAME) + PCI_PRI_STR_SIZE)
 #define CNXK_NPA_MAX_POOLS_PARAM "max_pools"
+#define CNXK_NPA_HALO_ENA_PARAM	 "halo_ena"
 
 static inline uint32_t
 npa_aura_size_to_u32(uint8_t val)
@@ -46,30 +47,46 @@ parse_max_pools_handler(const char *key, const char *value, void *extra_args)
 	return 0;
 }
 
-static inline uint32_t
-parse_max_pools(struct rte_devargs *devargs)
+static int
+parse_halo_ena_handler(const char *key, const char *value, void *extra_args)
+{
+	RTE_SET_USED(key);
+	uint8_t val;
+
+	val = atoi(value);
+	if (val != 0 && val != 1)
+		return -EINVAL;
+
+	*(uint8_t *)extra_args = val;
+	return 0;
+}
+
+static int
+cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
 {
 	uint32_t max_pools = npa_aura_size_to_u32(NPA_AURA_SZ_128);
+	struct rte_devargs *devargs = pci_dev->device.devargs;
 	struct rte_kvargs *kvlist;
+	uint32_t halo_ena = 0;
 
 	if (devargs == NULL)
-		goto exit;
+		goto null_devargs;
 	kvlist = rte_kvargs_parse(devargs->args, NULL);
 	if (kvlist == NULL)
 		goto exit;
 
 	rte_kvargs_process(kvlist, CNXK_NPA_MAX_POOLS_PARAM,
 			   &parse_max_pools_handler, &max_pools);
+	rte_kvargs_process(kvlist, CNXK_NPA_HALO_ENA_PARAM,
+			   &parse_halo_ena_handler, &halo_ena);
 	rte_kvargs_free(kvlist);
-exit:
-	return max_pools;
-}
 
-static int
-cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
-{
-	roc_idev_npa_maxpools_set(parse_max_pools(pci_dev->device.devargs));
+null_devargs:
+	roc_idev_npa_maxpools_set(max_pools);
+	roc_idev_npa_halo_ena_set(halo_ena);
 	return 0;
+exit:
+	return -EINVAL;
 }
 
 static inline char *
@@ -201,7 +218,8 @@ RTE_PMD_REGISTER_PCI(mempool_cnxk, npa_pci);
 RTE_PMD_REGISTER_PCI_TABLE(mempool_cnxk, npa_pci_map);
 RTE_PMD_REGISTER_KMOD_DEP(mempool_cnxk, "vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(mempool_cnxk,
-			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>");
+			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>"
+			      CNXK_NPA_HALO_ENA_PARAM "=<0-1>");
 
 RTE_INIT(cnxk_mempool_parse_devargs)
 {
drivers/mempool/cnxk/cnxk_mempool.h +14 -2
index 669e617952..941290061e 100644
@@ -7,6 +7,8 @@
 
 #include <rte_mempool.h>
 
+#include "roc_api.h"
+
 enum cnxk_mempool_flags {
 	/* This flag is used to ensure that only aura zero is allocated.
 	 * If aura zero is not available, then mempool creation fails.
@@ -47,7 +49,7 @@ int cnxk_mempool_populate(struct rte_mempool *mp, unsigned int max_objs,
 			  void *vaddr, rte_iova_t iova, size_t len,
 			  rte_mempool_populate_obj_cb_t *obj_cb,
 			  void *obj_cb_arg);
-int cnxk_mempool_alloc(struct rte_mempool *mp);
+int cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags);
 void cnxk_mempool_free(struct rte_mempool *mp);
 
 int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
@@ -55,6 +57,16 @@ int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 int __rte_hot cnxk_mempool_deq(struct rte_mempool *mp, void **obj_table,
 			       unsigned int n);
 
+int batch_op_init(struct rte_mempool *mp);
+void batch_op_fini(struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
+				unsigned int n);
+unsigned int cn10k_mempool_get_count(const struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table,
+				unsigned int n);
+int cn10k_mempool_alloc(struct rte_mempool *mp);
+void cn10k_mempool_free(struct rte_mempool *mp);
+
 int cn10k_mempool_plt_init(void);
 
-#endif
+#endif /* _CNXK_MEMPOOL_H_ */
drivers/mempool/cnxk/cnxk_mempool_ops.c +7 -4
index 5c7fcea487..01b6247fbb 100644
@@ -70,9 +70,9 @@ cnxk_mempool_calc_mem_size(const struct rte_mempool *mp, uint32_t obj_num,
 }
 
 int
-cnxk_mempool_alloc(struct rte_mempool *mp)
+cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags)
 {
-	uint32_t block_count, flags, roc_flags = 0;
+	uint32_t block_count, flags;
 	uint64_t aura_handle = 0;
 	struct npa_aura_s aura;
 	struct npa_pool_s pool;
@@ -98,7 +98,7 @@ cnxk_mempool_alloc(struct rte_mempool *mp)
 
 	flags = CNXK_MEMPOOL_FLAGS(mp);
 	if (flags & CNXK_MEMPOOL_F_ZERO_AURA) {
-		roc_flags = ROC_NPA_ZERO_AURA_F;
+		roc_flags |= ROC_NPA_ZERO_AURA_F;
 	} else if (flags & CNXK_MEMPOOL_F_CUSTOM_AURA) {
 		struct npa_aura_s *paura;
 
@@ -192,9 +192,12 @@ cnxk_mempool_plt_init(void)
 
 	if (roc_model_is_cn9k()) {
 		rte_mbuf_set_platform_mempool_ops("cn9k_mempool_ops");
-	} else if (roc_model_is_cn10k() || roc_model_is_cn20k()) {
+	} else if (roc_model_is_cn10k()) {
 		rte_mbuf_set_platform_mempool_ops("cn10k_mempool_ops");
 		rc = cn10k_mempool_plt_init();
+	} else if (roc_model_is_cn20k()) {
+		rte_mbuf_set_platform_mempool_ops("cn20k_mempool_ops");
+		rc = cn10k_mempool_plt_init();
 	}
 	return rc;
 }
drivers/mempool/cnxk/meson.build +1 -0
index e388cce26a..7722264320 100644
@@ -14,6 +14,7 @@ sources = files(
         'cnxk_mempool_telemetry.c',
         'cn9k_mempool_ops.c',
         'cn10k_mempool_ops.c',
+        'cn20k_mempool_ops.c',
         'cn10k_hwpool_ops.c',
 )
 
Signature · 1 line
2.48.1
#8 lore raw

Re: [PATCH v3 0/2] Add HALO support for CN20K mempool

In reply to Nawal Kishor
Quoted 24 lines · Nawal Kishor

This series of patches adds support for HALO in CNXK mempool driver.

Changes in v3:
* Added documentation for HALO support in CNXK mempool driver.

Nawal Kishor (2):
common/cnxk: add support for halos
mempool/cnxk: add halo support in mempool

 doc/guides/mempool/cnxk.rst                   |  24 +-
 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
Quoted 8 lines
 drivers/common/cnxk/roc_sso.h                 |   1 +
 drivers/mempool/cnxk/cn10k_mempool_ops.c      |  19 +-
 drivers/mempool/cnxk/cn20k_mempool_ops.c      |  60 ++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c       |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |  40 ++-
 drivers/mempool/cnxk/cnxk_mempool.h           |  16 +-
 drivers/mempool/cnxk/cnxk_mempool_ops.c       |  11 +-
 drivers/mempool/cnxk/meson.build              |   1 +

Pleaesto add roc_feature_npa_has_halo() in drivers/common/cnxk/roc_features.h. instead of relying on cn20k() checks as applicable. Good to merge next version.

Quoted 6 lines
 22 files changed, 771 insertions(+), 95 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c

--
2.48.1

#9 lore raw

v4 cover Add HALO support for CN20K mempool

In reply to Nawal Kishor

This series of patches adds support for HALO in CNXK mempool driver.

Changes in v4:
* Added roc_feature_npa_has_halo() as per review comments.

Nawal Kishor (2):
common/cnxk: add support for halos
mempool/cnxk: add halo support in mempool

 doc/guides/mempool/cnxk.rst                   |  24 +-
 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_features.h            |   7 +
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 drivers/mempool/cnxk/cn10k_mempool_ops.c      |  19 +-
 drivers/mempool/cnxk/cn20k_mempool_ops.c      |  60 ++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c       |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |  40 ++-
 drivers/mempool/cnxk/cnxk_mempool.h           |  16 +-
 drivers/mempool/cnxk/cnxk_mempool_ops.c       |  11 +-
 drivers/mempool/cnxk/meson.build              |   1 +
 23 files changed, 778 insertions(+), 95 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
Signature · 1 line
2.48.1
#10 lore raw

PATCH v4 1/2 common/cnxk: add support for halos

In cn9k/cn10k NPA mempool creation required the creation of at least one aura and pool context. Even, if the mapping between aura and pool was 1:1 (i.e, one aura mapped to one pool), separate contexts were required for aura and pool. This wasted the context space and most of common use case for NPA mempool is 1:1 mapping between aura and pool.

In cn20k, 1:1 aura pool mapping can now be replaced by using halos. Halos allow the creation of only one context which contains the information required for both aura and pool.

This patch adds the support for creation of Halos in ROC.

---
Changes in v4:
* Addressed review comments.

 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_features.h            |   7 +
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 15 files changed, 637 insertions(+), 63 deletions(-)
drivers/common/cnxk/hw/npa.h +81 -0
index 4fd1f9a64b..e421c70e01 100644
@@ -118,6 +118,7 @@
 
 #define NPA_AQ_CTYPE_AURA (0x0ull)
 #define NPA_AQ_CTYPE_POOL (0x1ull)
+#define NPA_AQ_CTYPE_HALO (0x2ull)
 
 #define NPA_BPINTF_NIX0_RX (0x0ull)
 #define NPA_BPINTF_NIX1_RX (0x1ull)
@@ -456,6 +457,86 @@ struct npa_cn20k_pool_s {
 	uint64_t rsvd_1023_960 : 64; /* W15 */
 };
 
+/* NPA halo context structure [CN20K] */
+struct npa_cn20k_halo_s {
+	uint64_t stack_base : 64; /* W0 */
+	uint64_t ena : 1; /* W1 */
+	uint64_t nat_align : 1;
+	uint64_t reserved_67_66 : 2;
+	uint64_t stack_caching : 1;
+	uint64_t reserved_71_69 : 3;
+	uint64_t aura_drop_ena : 1;
+	uint64_t reserved_79_73 : 7;
+	uint64_t aura_drop : 8;
+	uint64_t buf_offset : 12;
+	uint64_t reserved_103_100 : 4;
+	uint64_t buf_size : 12;
+	uint64_t reserved_119_116 : 4;
+	uint64_t ref_cnt_prof : 3;
+	uint64_t reserved_127_123 : 5;
+	uint64_t stack_max_pages : 32; /* W2 */
+	uint64_t stack_pages : 32;
+	uint64_t bp_0 : 7; /* W3 */
+	uint64_t bp_1 : 7;
+	uint64_t bp_2 : 7;
+	uint64_t bp_3 : 7;
+	uint64_t bp_4 : 7;
+	uint64_t bp_5 : 7;
+	uint64_t bp_6 : 7;
+	uint64_t bp_7 : 7;
+	uint64_t bp_ena_0 : 1;
+	uint64_t bp_ena_1 : 1;
+	uint64_t bp_ena_2 : 1;
+	uint64_t bp_ena_3 : 1;
+	uint64_t bp_ena_4 : 1;
+	uint64_t bp_ena_5 : 1;
+	uint64_t bp_ena_6 : 1;
+	uint64_t bp_ena_7 : 1;
+	uint64_t stack_offset : 4; /* W4 */
+	uint64_t reserved_263_260 : 4;
+	uint64_t shift : 6;
+	uint64_t reserved_271_270 : 2;
+	uint64_t avg_level : 8;
+	uint64_t avg_con : 9;
+	uint64_t fc_ena : 1;
+	uint64_t fc_stype : 2;
+	uint64_t fc_hyst_bits : 4;
+	uint64_t fc_up_crossing : 1;
+	uint64_t reserved_299_297 : 3;
+	uint64_t update_time : 16;
+	uint64_t reserved_319_316 : 4;
+	uint64_t fc_addr : 64;   /* W5 */
+	uint64_t ptr_start : 64; /* W6 */
+	uint64_t ptr_end : 64;   /* W7 */
+	uint64_t bpid_0 : 12; /* W8 */
+	uint64_t reserved_535_524 : 12;
+	uint64_t err_int : 8;
+	uint64_t err_int_ena : 8;
+	uint64_t thresh_int : 1;
+	uint64_t thresh_int_ena : 1;
+	uint64_t thresh_up : 1;
+	uint64_t reserved_555_555 : 1;
+	uint64_t thresh_qint_idx : 7;
+	uint64_t reserved_563_563 : 1;
+	uint64_t err_qint_idx : 7;
+	uint64_t reserved_575_571 : 5;
+	uint64_t thresh : 36; /* W9 */
+	uint64_t reserved_615_612 : 4;
+	uint64_t fc_msh_dst : 11;
+	uint64_t reserved_630_627 : 4;
+	uint64_t op_dpc_ena : 1;
+	uint64_t op_dpc_set : 5;
+	uint64_t reserved_637_637 : 1;
+	uint64_t stream_ctx : 1;
+	uint64_t unified_ctx : 1;
+	uint64_t reserved_703_640 : 64; /* W10 */
+	uint64_t reserved_767_704 : 64; /* W11 */
+	uint64_t reserved_831_768 : 64; /* W12 */
+	uint64_t reserved_895_832 : 64; /* W13 */
+	uint64_t reserved_959_896 : 64; /* W14 */
+	uint64_t reserved_1023_960 : 64; /* W15 */
+};
+
 /* NPA queue interrupt context hardware structure */
 struct npa_qint_hw_s {
 	uint32_t count : 22;
drivers/common/cnxk/roc_features.h +7 -0
index 9c6adfe058..3c34041d76 100644
@@ -137,4 +137,11 @@ roc_feature_nix_has_16b_align(void)
 {
 	return roc_model_is_cn20k();
 }
+
+static inline bool
+roc_feature_npa_has_halo(void)
+{
+	return roc_model_is_cn20k();
+}
+
 #endif
drivers/common/cnxk/roc_idev.c +25 -0
index 84812f73e0..6aa5b10ee9 100644
@@ -33,6 +33,7 @@ idev_set_defaults(struct idev_cfg *idev)
 	idev->npa = NULL;
 	idev->npa_pf_func = 0;
 	idev->max_pools = 128;
+	idev->halo_ena = 0;
 	idev->lmt_pf_func = 0;
 	idev->lmt_base_addr = 0;
 	idev->num_lmtlines = 0;
@@ -123,6 +124,30 @@ roc_idev_npa_maxpools_set(uint32_t max_pools)
 		__atomic_store_n(&idev->max_pools, max_pools, __ATOMIC_RELEASE);
 }
 
+int
+roc_idev_npa_halo_ena_get(void)
+{
+	struct idev_cfg *idev;
+	int halo_ena;
+
+	idev = idev_get_cfg();
+	halo_ena = 0;
+	if (idev != NULL)
+		halo_ena = __atomic_load_n(&idev->halo_ena, __ATOMIC_ACQUIRE);
+
+	return halo_ena;
+}
+
+void
+roc_idev_npa_halo_ena_set(int halo_ena)
+{
+	struct idev_cfg *idev;
+
+	idev = idev_get_cfg();
+	if (idev != NULL)
+		__atomic_store_n(&idev->halo_ena, halo_ena, __ATOMIC_RELEASE);
+}
+
 uint16_t
 idev_npa_lf_active(struct dev *dev)
 {
drivers/common/cnxk/roc_idev.h +3 -0
index 6edb5f83b2..3803963b07 100644
@@ -8,6 +8,9 @@
 uint32_t __roc_api roc_idev_npa_maxpools_get(void);
 void __roc_api roc_idev_npa_maxpools_set(uint32_t max_pools);
 
+int __roc_api roc_idev_npa_halo_ena_get(void);
+void __roc_api roc_idev_npa_halo_ena_set(int halo_ena);
+
 /* LMT */
 uint64_t __roc_api roc_idev_lmt_base_addr_get(void);
 uint16_t __roc_api roc_idev_num_lmtlines_get(void);
drivers/common/cnxk/roc_idev_priv.h +1 -0
index 98b6286bfe..dde555535b 100644
@@ -30,6 +30,7 @@ struct idev_cfg {
 	struct npa_lf *npa;
 	uint16_t npa_refcnt;
 	uint32_t max_pools;
+	int halo_ena;
 	uint16_t lmt_pf_func;
 	uint16_t num_lmtlines;
 	uint64_t lmt_base_addr;
drivers/common/cnxk/roc_mbox.h +6 -0
index 3e913fa13c..3176c87382 100644
@@ -1397,6 +1397,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == WRITE/INIT and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 	/* Mask data when op == WRITE (1=write, 0=don't write) */
 	union {
@@ -1404,6 +1406,8 @@ struct npa_cn20k_aq_enq_req {
 		__io struct npa_cn20k_aura_s aura_mask;
 		/* Valid when op == WRITE and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool_mask;
+		/* Valid when op == WRITE/INIT and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo_mask;
 	};
 };
 
@@ -1414,6 +1418,8 @@ struct npa_cn20k_aq_enq_rsp {
 		__io struct npa_cn20k_aura_s aura;
 		/* Valid when op == READ and ctype == POOL */
 		__io struct npa_cn20k_pool_s pool;
+		/* Valid when op == READ and ctype == HALO */
+		__io struct npa_cn20k_halo_s halo;
 	};
 };
 
drivers/common/cnxk/roc_nix.h +1 -0
index 326decde2b..aa197eb95e 100644
@@ -595,6 +595,7 @@ struct roc_nix {
 	uintptr_t lmt_base;
 	bool io_enabled;
 	bool rx_ptp_ena;
+	bool sqb_halo_ena;
 	uint16_t cints;
 	uint32_t buf_sz;
 	uint64_t meta_aura_handle;
drivers/common/cnxk/roc_nix_queue.c +31 -15

59 lines not on this page · raw message

drivers/common/cnxk/roc_npa.c +245 -23

443 lines not on this page · raw message

drivers/common/cnxk/roc_npa.h +17 -3
index 336a43f95c..18808e5873 100644
@@ -21,7 +21,9 @@
 
 #define ROC_AURA_OP_LIMIT_MASK (BIT_ULL(36) - 1)
 
-#define ROC_NPA_MAX_BLOCK_SZ		   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN9K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN10K	   (128 * 1024)
+#define ROC_NPA_MAX_BLOCK_SZ_CN20K	   (256 * 1024)
 #define ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS 512
 #define ROC_CN10K_NPA_BATCH_FREE_MAX_PTRS  15U
 #define ROC_CN10K_NPA_BATCH_FREE_BURST_MAX 16U
@@ -36,6 +38,17 @@
  */
 #define ROC_CN9K_NPA_BULK_ALLOC_MAX_PTRS 30
 
+static inline uint32_t
+roc_npa_max_block_size(void)
+{
+	if (roc_model_is_cn20k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN20K;
+	else if (roc_model_is_cn10k())
+		return ROC_NPA_MAX_BLOCK_SZ_CN10K;
+	else
+		return ROC_NPA_MAX_BLOCK_SZ_CN9K;
+}
+
 /*
  * Generate 64bit handle to have optimized alloc and free aura operation.
  * 0 - ROC_AURA_ID_MASK for storing the aura_id.
@@ -767,8 +780,9 @@ 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_FORCE_OPAQUE_MODE_F BIT(1)
+#define ROC_NPA_ZERO_AURA_F		BIT(0)
+#define ROC_NPA_FORCE_OPAQUE_MODE_F	BIT(1)
+#define ROC_NPA_HALO_F			BIT(2)
 
 /* Enumerations */
 enum roc_npa_buf_type {
drivers/common/cnxk/roc_npa_debug.c +189 -12

243 lines not on this page · raw message

drivers/common/cnxk/roc_npa_priv.h +3 -0
index 0223e4a438..e437fe831a 100644
@@ -14,6 +14,8 @@ enum npa_error_status {
 	NPA_ERR_AURA_POOL_FINI = -517,
 	NPA_ERR_BASE_INVALID = -518,
 	NPA_ERR_DEVICE_NOT_BOUNDED = -519,
+	NPA_ERR_HALO_INIT = -520,
+	NPA_ERR_HALO_FINI = -521,
 };
 
 struct npa_lf {
@@ -55,6 +57,7 @@ struct npa_aura_attr {
 	uint64_t shift;
 	uint64_t limit;
 	uint8_t bp_ena;
+	bool halo;
 	union {
 		uint8_t bp;	      /* CN9K, CN10K */
 		uint8_t bp_thresh[8]; /* CN20K */
drivers/common/cnxk/roc_platform_base_symbols.c +2 -0
index 43095741f5..79dd18fbd7 100644
@@ -85,6 +85,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha256_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_hash_sha512_gen)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_maxpools_set)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_get)
+RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_npa_halo_ena_set)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_lmt_base_addr_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_num_lmtlines_get)
 RTE_EXPORT_INTERNAL_SYMBOL(roc_idev_cpt_get)
drivers/common/cnxk/roc_sso.c +25 -10
index 1d82e5b978..b674dcf70c 100644
@@ -834,8 +834,6 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 			uint32_t nb_xae, uint32_t xae_waes,
 			uint32_t xaq_buf_size, uint16_t nb_hwgrp)
 {
-	struct npa_pool_s pool;
-	struct npa_aura_s aura;
 	plt_iova_t iova;
 	uint32_t i;
 	int rc;
@@ -877,15 +875,32 @@ sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 		goto free_fc;
 	}
 
-	memset(&pool, 0, sizeof(struct npa_pool_s));
-	pool.nat_align = 1;
+	if (roc_feature_npa_has_halo() && xaq->halo_ena) {
+		struct npa_cn20k_halo_s halo;
+
+		memset(&halo, 0, sizeof(struct npa_cn20k_halo_s));
+		halo.nat_align = 1;
+		halo.fc_ena = 1;
+		halo.fc_addr = (uint64_t)xaq->fc;
+		halo.fc_hyst_bits = 0; /* Store count on all updates */
+		halo.unified_ctx = 1;
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 NULL, (struct npa_pool_s *)&halo, ROC_NPA_HALO_F);
+	} else {
+		struct npa_pool_s pool;
+		struct npa_aura_s aura;
+
+		memset(&pool, 0, sizeof(struct npa_pool_s));
+		pool.nat_align = 1;
+
+		memset(&aura, 0, sizeof(aura));
+		aura.fc_ena = 1;
+		aura.fc_addr = (uint64_t)xaq->fc;
+		aura.fc_hyst_bits = 0; /* Store count on all updates */
+		rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
+					 &aura, &pool, 0);
+	}
 
-	memset(&aura, 0, sizeof(aura));
-	aura.fc_ena = 1;
-	aura.fc_addr = (uint64_t)xaq->fc;
-	aura.fc_hyst_bits = 0; /* Store count on all updates */
-	rc = roc_npa_pool_create(&xaq->aura_handle, xaq_buf_size, xaq->nb_xaq,
-				 &aura, &pool, 0);
 	if (rc) {
 		plt_err("Failed to create XAQ pool");
 		goto npa_fail;
drivers/common/cnxk/roc_sso.h +1 -0
index f1ad34bcc7..9d8356abb1 100644
@@ -43,6 +43,7 @@ struct roc_sso_xaq_data {
 	uint32_t nb_xae;
 	uint32_t xaq_lmt;
 	uint64_t aura_handle;
+	int halo_ena;
 	void *fc;
 	void *mem;
 };
Signature · 1 line
2.48.1
#11 lore raw

Re: [PATCH v4 1/2] common/cnxk: add support for halos

drivers/common/cnxk/roc_idev.c roc_idev_npa_maxpools_set(uint32_t max_pools) · line 136

Quoted 10 lines · On Tue, 17 Feb 2026 16:09:21 +0530 Nawal Kishor <[email protected]> wrote:
drivers/common/cnxk/roc_idev.c +10 -0
+int
+roc_idev_npa_halo_ena_get(void)
+{
+	struct idev_cfg *idev;
+	int halo_ena;
+
+	idev = idev_get_cfg();
+	halo_ena = 0;
+	if (idev != NULL)
+		halo_ena = __atomic_load_n(&idev->halo_ena, __ATOMIC_ACQUIRE);

Do not use __atomic_load_n, DPDK has migrated to rte_atomic_load_explicit

drivers/common/cnxk/roc_idev_priv.h struct idev_cfg { · line 33

Quoted 9 lines
drivers/common/cnxk/roc_idev_priv.h +1 -0
index 98b6286bfe..dde555535b 100644
@@ -30,6 +30,7 @@ struct idev_cfg {
 	struct npa_lf *npa;
 	uint16_t npa_refcnt;
 	uint32_t max_pools;
+	int halo_ena;

Using int for a flag value is legacy C code style. Use bool to save space and have some type safety.

drivers/common/cnxk/roc_idev_priv.h struct idev_cfg {

Quoted 10 lines
drivers/common/cnxk/roc_idev_priv.h +10 -0
+	if (roc_feature_npa_has_halo() && roc_nix->sqb_halo_ena) {
+		struct npa_cn20k_halo_s halo;
+
+		memset(&halo, 0, sizeof(struct npa_cn20k_halo_s));
+		halo.nat_align = 1;
+		halo.fc_ena = 1;
+		halo.fc_stype = 0x3; /* STSTP */
+		halo.fc_addr = (uint64_t)sq->fc;
+		halo.fc_hyst_bits = 0; /* Store count on all updates */
+		halo.unified_ctx = 1;

Using structure initialization is preferred over memset and individual values.

#12 lore raw

PATCH v4 2/2 mempool/cnxk: add halo support in mempool

In reply to Nawal Kishor

This patch adds the support of halos in CN20K mempool driver. It introduces a new devargs parameter "halo_ena" to enable or disable halo feature. If halo_ena is set to 1, halos will be enabled for NPA pools created by the mempool driver.

---

 doc/guides/mempool/cnxk.rst              | 24 ++++++++--
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 19 ++++----
 drivers/mempool/cnxk/cn20k_mempool_ops.c | 60 ++++++++++++++++++++++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c  |  2 +-
 drivers/mempool/cnxk/cnxk_mempool.c      | 40 +++++++++++-----
 drivers/mempool/cnxk/cnxk_mempool.h      | 16 ++++++-
 drivers/mempool/cnxk/cnxk_mempool_ops.c  | 11 +++--
 drivers/mempool/cnxk/meson.build         |  1 +
 8 files changed, 141 insertions(+), 32 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
doc/guides/mempool/cnxk.rst +21 -3
index 3d0729245a..178ff99acf 100644
@@ -5,7 +5,7 @@ cnxk NPA Mempool Driver
 =======================
 
 The cnxk NPA PMD (**librte_mempool_cnxk**) provides mempool driver support for
-the integrated mempool device found in **Marvell OCTEON CN9K/CN10K** SoC family.
+the integrated mempool device found in **Marvell OCTEON CN9K/CN10K/CN20K** SoC family.
 
 More information about cnxk SoC can be found at `Marvell Official Website
 <https://www.marvell.com/embedded-processors/infrastructure-processors/>`_.
@@ -30,6 +30,11 @@ CN10k NPA supports:
 - Batch dequeue of up to 512 pointers with single instruction.
 - Batch enqueue of up to 15 pointers with single instruction.
 
+CN20k NPA supports:
+
+- HALO support for 1:1 aura-pool mapping, which uses a single unified context
+  instead of separate aura and pool contexts, saving HW context space.
+
 Prerequisites and Compilation procedure
 ---------------------------------------
 
@@ -56,11 +61,24 @@ Runtime Config Options
   With the above configuration, the driver will set up only 512 mempools for
   the given application to save HW resources.
 
+- ``HALO enable`` (default ``0``)
+
+  The HALO feature is available on CN20K platforms and allows 1:1 aura-pool
+  mapping to use a single unified context instead of separate aura and pool
+  contexts, saving HW context space. This parameter enables or disables HALO
+  support for NPA pools created by the mempool driver.
+  For example::
+
+    -a 0002:02:00.0,halo_ena=1
+
+  With the above configuration, HALO support will be enabled for mempools created
+  on CN20K platforms.
+
 .. note::
 
    Since this configuration is per application, the end user needs to
-   provide ``max_pools`` parameter to the first PCIe device probed by the given
-   application.
+   provide ``max_pools`` and/or ``halo_ena`` parameter to the first PCIe device
+   probed by the given application.
 
 Debugging Options
 ~~~~~~~~~~~~~~~~~
drivers/mempool/cnxk/cn10k_mempool_ops.c +8 -11
index a5be0ccafe..09f900a850 100644
@@ -2,9 +2,6 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_mempool.h>
-
-#include "roc_api.h"
 #include "cnxk_mempool.h"
 
 #define BATCH_ALLOC_SZ              ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS
@@ -79,7 +76,7 @@ batch_op_data_set(uint64_t pool_id, struct batch_op_data *op_data)
 	batch_op_data_tbl[aura] = op_data;
 }
 
-static int
+int
 batch_op_init(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -109,7 +106,7 @@ batch_op_init(struct rte_mempool *mp)
 	return 0;
 }
 
-static void
+void
 batch_op_fini(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -149,7 +146,7 @@ batch_op_fini(struct rte_mempool *mp)
 	rte_wmb();
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 		  unsigned int n)
 {
@@ -181,7 +178,7 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 	return 0;
 }
 
-static unsigned int
+unsigned int
 cn10k_mempool_get_count(const struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -326,7 +323,7 @@ mempool_deq_batch_sync(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return count;
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	struct batch_op_data *op_data;
@@ -353,7 +350,7 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return 0;
 }
 
-static int
+int
 cn10k_mempool_alloc(struct rte_mempool *mp)
 {
 	uint32_t block_size;
@@ -376,7 +373,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 		block_size += padding;
 	}
 
-	rc = cnxk_mempool_alloc(mp);
+	rc = cnxk_mempool_alloc(mp, 0);
 	if (rc)
 		return rc;
 
@@ -392,7 +389,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 	return rc;
 }
 
-static void
+void
 cn10k_mempool_free(struct rte_mempool *mp)
 {
 	batch_op_fini(mp);
drivers/mempool/cnxk/cn20k_mempool_ops.c new file +60 -0

60 lines not on this page · raw message

drivers/mempool/cnxk/cn9k_mempool_ops.c +1 -1
index b7967f8085..8248071cb7 100644
@@ -72,7 +72,7 @@ cn9k_mempool_alloc(struct rte_mempool *mp)
 	padding = ((block_size / ROC_ALIGN) % 2) ? 0 : ROC_ALIGN;
 	mp->trailer_size += padding;
 
-	return cnxk_mempool_alloc(mp);
+	return cnxk_mempool_alloc(mp, 0);
 }
 
 static struct rte_mempool_ops cn9k_mempool_ops = {
drivers/mempool/cnxk/cnxk_mempool.c +29 -11
index 6ff11d8004..6939fccff4 100644
@@ -18,6 +18,7 @@
 #define CNXK_NPA_DEV_NAME	 RTE_STR(cnxk_npa_dev_)
 #define CNXK_NPA_DEV_NAME_LEN	 (sizeof(CNXK_NPA_DEV_NAME) + PCI_PRI_STR_SIZE)
 #define CNXK_NPA_MAX_POOLS_PARAM "max_pools"
+#define CNXK_NPA_HALO_ENA_PARAM	 "halo_ena"
 
 static inline uint32_t
 npa_aura_size_to_u32(uint8_t val)
@@ -46,30 +47,46 @@ parse_max_pools_handler(const char *key, const char *value, void *extra_args)
 	return 0;
 }
 
-static inline uint32_t
-parse_max_pools(struct rte_devargs *devargs)
+static int
+parse_halo_ena_handler(const char *key, const char *value, void *extra_args)
+{
+	RTE_SET_USED(key);
+	uint8_t val;
+
+	val = atoi(value);
+	if (val != 0 && val != 1)
+		return -EINVAL;
+
+	*(uint8_t *)extra_args = val;
+	return 0;
+}
+
+static int
+cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
 {
 	uint32_t max_pools = npa_aura_size_to_u32(NPA_AURA_SZ_128);
+	struct rte_devargs *devargs = pci_dev->device.devargs;
 	struct rte_kvargs *kvlist;
+	uint32_t halo_ena = 0;
 
 	if (devargs == NULL)
-		goto exit;
+		goto null_devargs;
 	kvlist = rte_kvargs_parse(devargs->args, NULL);
 	if (kvlist == NULL)
 		goto exit;
 
 	rte_kvargs_process(kvlist, CNXK_NPA_MAX_POOLS_PARAM,
 			   &parse_max_pools_handler, &max_pools);
+	rte_kvargs_process(kvlist, CNXK_NPA_HALO_ENA_PARAM,
+			   &parse_halo_ena_handler, &halo_ena);
 	rte_kvargs_free(kvlist);
-exit:
-	return max_pools;
-}
 
-static int
-cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
-{
-	roc_idev_npa_maxpools_set(parse_max_pools(pci_dev->device.devargs));
+null_devargs:
+	roc_idev_npa_maxpools_set(max_pools);
+	roc_idev_npa_halo_ena_set(halo_ena);
 	return 0;
+exit:
+	return -EINVAL;
 }
 
 static inline char *
@@ -201,7 +218,8 @@ RTE_PMD_REGISTER_PCI(mempool_cnxk, npa_pci);
 RTE_PMD_REGISTER_PCI_TABLE(mempool_cnxk, npa_pci_map);
 RTE_PMD_REGISTER_KMOD_DEP(mempool_cnxk, "vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(mempool_cnxk,
-			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>");
+			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>"
+			      CNXK_NPA_HALO_ENA_PARAM "=<0-1>");
 
 RTE_INIT(cnxk_mempool_parse_devargs)
 {
drivers/mempool/cnxk/cnxk_mempool.h +14 -2
index 669e617952..941290061e 100644
@@ -7,6 +7,8 @@
 
 #include <rte_mempool.h>
 
+#include "roc_api.h"
+
 enum cnxk_mempool_flags {
 	/* This flag is used to ensure that only aura zero is allocated.
 	 * If aura zero is not available, then mempool creation fails.
@@ -47,7 +49,7 @@ int cnxk_mempool_populate(struct rte_mempool *mp, unsigned int max_objs,
 			  void *vaddr, rte_iova_t iova, size_t len,
 			  rte_mempool_populate_obj_cb_t *obj_cb,
 			  void *obj_cb_arg);
-int cnxk_mempool_alloc(struct rte_mempool *mp);
+int cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags);
 void cnxk_mempool_free(struct rte_mempool *mp);
 
 int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
@@ -55,6 +57,16 @@ int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 int __rte_hot cnxk_mempool_deq(struct rte_mempool *mp, void **obj_table,
 			       unsigned int n);
 
+int batch_op_init(struct rte_mempool *mp);
+void batch_op_fini(struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
+				unsigned int n);
+unsigned int cn10k_mempool_get_count(const struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table,
+				unsigned int n);
+int cn10k_mempool_alloc(struct rte_mempool *mp);
+void cn10k_mempool_free(struct rte_mempool *mp);
+
 int cn10k_mempool_plt_init(void);
 
-#endif
+#endif /* _CNXK_MEMPOOL_H_ */
drivers/mempool/cnxk/cnxk_mempool_ops.c +7 -4
index 5c7fcea487..01b6247fbb 100644
@@ -70,9 +70,9 @@ cnxk_mempool_calc_mem_size(const struct rte_mempool *mp, uint32_t obj_num,
 }
 
 int
-cnxk_mempool_alloc(struct rte_mempool *mp)
+cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags)
 {
-	uint32_t block_count, flags, roc_flags = 0;
+	uint32_t block_count, flags;
 	uint64_t aura_handle = 0;
 	struct npa_aura_s aura;
 	struct npa_pool_s pool;
@@ -98,7 +98,7 @@ cnxk_mempool_alloc(struct rte_mempool *mp)
 
 	flags = CNXK_MEMPOOL_FLAGS(mp);
 	if (flags & CNXK_MEMPOOL_F_ZERO_AURA) {
-		roc_flags = ROC_NPA_ZERO_AURA_F;
+		roc_flags |= ROC_NPA_ZERO_AURA_F;
 	} else if (flags & CNXK_MEMPOOL_F_CUSTOM_AURA) {
 		struct npa_aura_s *paura;
 
@@ -192,9 +192,12 @@ cnxk_mempool_plt_init(void)
 
 	if (roc_model_is_cn9k()) {
 		rte_mbuf_set_platform_mempool_ops("cn9k_mempool_ops");
-	} else if (roc_model_is_cn10k() || roc_model_is_cn20k()) {
+	} else if (roc_model_is_cn10k()) {
 		rte_mbuf_set_platform_mempool_ops("cn10k_mempool_ops");
 		rc = cn10k_mempool_plt_init();
+	} else if (roc_model_is_cn20k()) {
+		rte_mbuf_set_platform_mempool_ops("cn20k_mempool_ops");
+		rc = cn10k_mempool_plt_init();
 	}
 	return rc;
 }
drivers/mempool/cnxk/meson.build +1 -0
index e388cce26a..7722264320 100644
@@ -14,6 +14,7 @@ sources = files(
         'cnxk_mempool_telemetry.c',
         'cn9k_mempool_ops.c',
         'cn10k_mempool_ops.c',
+        'cn20k_mempool_ops.c',
         'cn10k_hwpool_ops.c',
 )
 
Signature · 1 line
2.48.1
#13 lore raw

Re: [PATCH v4 2/2] mempool/cnxk: add halo support in mempool

drivers/mempool/cnxk/cn20k_mempool_ops.c line 59

Quoted 11 lines · On Tue, 17 Feb 2026 16:09:22 +0530 Nawal Kishor <[email protected]> wrote:
drivers/mempool/cnxk/cn20k_mempool_ops.c new file +11 -0
+static struct rte_mempool_ops cn20k_mempool_ops = {
+	.name = "cn20k_mempool_ops",
+	.alloc = cn20k_mempool_alloc,
+	.free = cn10k_mempool_free,
+	.enqueue = cn10k_mempool_enq,
+	.dequeue = cn10k_mempool_deq,
+	.get_count = cn10k_mempool_get_count,
+	.calc_mem_size = cnxk_mempool_calc_mem_size,
+	.populate = cnxk_mempool_populate,
+};
+

If possible ops structures should be const to protect from modification.

drivers/mempool/cnxk/cnxk_mempool.c parse_max_pools_handler(const char *key, const char *value, void *extra_args) · line 53

Quoted 4 lines
drivers/mempool/cnxk/cnxk_mempool.c +4 -0
+static int
+parse_halo_ena_handler(const char *key, const char *value, void *extra_args)
+{
+	RTE_SET_USED(key);

Prefer __rte_unused attribute

drivers/mempool/cnxk/cnxk_mempool.c parse_max_pools_handler(const char *key, const char *value, void *extra_args) · line 62

Quoted 9 lines
drivers/mempool/cnxk/cnxk_mempool.c +9 -0
+	uint8_t val;
+
+	val = atoi(value);
+	if (val != 0 && val != 1)
+		return -EINVAL;
+
+	*(uint8_t *)extra_args = val;
+	return 0;
+}

Using atoi() allows non-string values. You should be using a more robust handler.

Actually kvargs should have handlers for common types, but that is an enhancement.

#14 lore raw

Re: [PATCH v2 0/2] cnxk: add HALO support for CN20K mempool

In reply to Nawal Kishor
Quoted 24 lines · On Fri, 5 Dec 2025 11:21:32 +0530 Nawal Kishor <[email protected]> wrote:

This series of patches adds support for HALO in CNXK mempool driver.

Changes in v2:
* Fixed compilation warnings.

Nawal Kishor (2):
common/cnxk: add support for halos
mempool/cnxk: add halo support in mempool

 drivers/common/cnxk/hw/npa.h                  |  81 ++++++
 drivers/common/cnxk/roc_idev.c                |  25 ++
 drivers/common/cnxk/roc_idev.h                |   3 +
 drivers/common/cnxk/roc_idev_priv.h           |   1 +
 drivers/common/cnxk/roc_mbox.h                |   6 +
 drivers/common/cnxk/roc_nix.h                 |   1 +
 drivers/common/cnxk/roc_nix_queue.c           |  46 ++-
 drivers/common/cnxk/roc_npa.c                 | 268 ++++++++++++++++--
 drivers/common/cnxk/roc_npa.h                 |  20 +-
 drivers/common/cnxk/roc_npa_debug.c           | 201 ++++++++++++-
 drivers/common/cnxk/roc_npa_priv.h            |   3 +
 .../common/cnxk/roc_platform_base_symbols.c   |   2 +
 drivers/common/cnxk/roc_sso.c                 |  35 ++-
 drivers/common/cnxk/roc_sso.h                 |   1 +
 drivers/mempool/cnxk/cn10k_mempool_ops.c      |  19 +-
Quoted 9 lines
 drivers/mempool/cnxk/cn20k_mempool_ops.c      |  60 ++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c       |   2 +-
 drivers/mempool/cnxk/cnxk_mempool.c           |  40 ++-
 drivers/mempool/cnxk/cnxk_mempool.h           |  16 +-
 drivers/mempool/cnxk/cnxk_mempool_ops.c       |  11 +-
 drivers/mempool/cnxk/meson.build              |   1 +
 21 files changed, 750 insertions(+), 92 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c

This patch never got merged because of CI build failures. Fix and resubmit.

AI review also says:

## Patch Review: cnxk halo support (2-patch series)

### Patch 1/2: common/cnxk: add support for halos

#### Commit Message ✓

| Criterion | Status | Notes |
|-----------|--------|-------|
| Subject ≤60 chars | ✓ | 33 characters |
| Correct prefix | ✓ | `common/cnxk:` is appropriate |
| Lowercase after colon | ✓ | |
| Imperative mood | ✓ | "add support" |
| No trailing period | ✓ | |
| Body wrapped ≤75 chars | ✓ | |
| Body not starting with "It" | ✓ | Starts with "In cn9k/cn10k..." |
| Signed-off-by present | ✓ | Real name and valid email |

#### Code Issues

**Warning: Implicit pointer comparison (multiple locations)**

The AGENTS.md specifies:

Quoted 1 line

if (!p) /* Bad - don't use ! on pointers */

Several instances use !ptr style:

```c
// roc_npa.c - npa_halo_alloc()
if (!lf || !halo || !aura_handle)
    return NPA_ERR_PARAM;

// roc_npa.c - npa_halo_free()  
if (!lf || !aura_handle)
    return NPA_ERR_PARAM;
```

**Suggested fix:**

```c
if (lf == NULL || halo == NULL || aura_handle == NULL)
    return NPA_ERR_PARAM;
```

---

**Warning: Non-portable format specifier**

In roc_npa_debug.c, function npa_halo_dump():

```c
npa_dump("W9: thresh \t\t%lu\nW9: fc_msh_dst \t\t%d",
         (unsigned long)halo->thresh, halo->fc_msh_dst);
```

The AGENTS.md specifies:

Quoted 1 line

Forbidden: %lld, %llu, %llx → Preferred: %PRId64, %PRIu64, %PRIx64

While %lu with an explicit cast is technically different, for consistency with the rest of the file (which uses %"PRIx64" patterns), this should use:

```c
npa_dump("W9: thresh \t\t%" PRIu64 "\nW9: fc_msh_dst \t\t%d",
         (uint64_t)halo->thresh, halo->fc_msh_dst);
```

---

**Warning: New API functions not marked __rte_experimental**

New public APIs added to roc_idev.h:

```c
int __roc_api roc_idev_npa_halo_ena_get(void);
void __roc_api roc_idev_npa_halo_ena_set(int halo_ena);
```

And new inline function in roc_npa.h:

```c
static inline uint32_t
roc_npa_max_block_size(void)
```

Per AGENTS.md:

Quoted 1 line

New APIs must be marked as __rte_experimental

**Note:** These are internal (__roc_api) functions in the ROC layer, so __rte_experimental may not strictly apply - this depends on whether the ROC API is considered public. However, the pattern in other ROC files should be followed.

---

**Info: Good practices observed**
- Proper error code additions (NPA_ERR_HALO_INIT, NPA_ERR_HALO_FINI)
- Symbol exports added via RTE_EXPORT_INTERNAL_SYMBOL
- Hardware structure properly defined with bitfields
- Consistent use of mbox_get()/mbox_put() patterns

---

### Patch 2/2: mempool/cnxk: add halo support in mempool

#### Commit Message ✓

| Criterion | Status | Notes |
|-----------|--------|-------|
| Subject ≤60 chars | ✓ | 40 characters |
| Correct prefix | ✓ | `mempool/cnxk:` is appropriate |
| Lowercase after colon | ✓ | |
| Imperative mood | ✓ | "add" |
| No trailing period | ✓ | |
| Body wrapped ≤75 chars | ✓ | |
| Body not starting with "It" | ✓ | Starts with "This patch..." |
| Signed-off-by present | ✓ | |

#### License ✓

New file cn20k_mempool_ops.c:

```c
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(C) 2025 Marvell.
 */
```

- SPDX on first line ✓
- Copyright follows ✓
- Blank line before includes ✓
- BSD-3-Clause appropriate for driver ✓

#### Code Issues

**Warning: Devargs parameter string formatting**

In cnxk_mempool.c:

```c
RTE_PMD_REGISTER_PARAM_STRING(mempool_cnxk,
                  CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>"
                  CNXK_NPA_HALO_ENA_PARAM "=<0-1>");
```

The two parameter strings will concatenate without a space separator, resulting in:
max_pools=<128-1048576>halo_ena=<0-1>

**Suggested fix:**

```c
RTE_PMD_REGISTER_PARAM_STRING(mempool_cnxk,
                  CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576> "
                  CNXK_NPA_HALO_ENA_PARAM "=<0-1>");
```

---

**Info: meson.build ordering**

The file list in meson.build is not alphabetically ordered:

```python
sources = files(
        ...
        'cn9k_mempool_ops.c',
        'cn10k_mempool_ops.c',
        'cn20k_mempool_ops.c',
        'cn10k_hwpool_ops.c',
)
```

Per AGENTS.md: "Lists alphabetically ordered". However, this follows the existing convention in the file (which was already non-alphabetical), so this is an existing technical debt rather than a new issue introduced by this patch.

---

**Info: Documentation consideration**

The new halo_ena devargs parameter should ideally be documented in the driver documentation (doc/guides/mempool/cnxk.rst or similar) so users understand what it does and when to use it.

---

### Summary

| Severity | Count | Items |
|----------|-------|-------|
| **Error** | 0 | None |
| **Warning** | 4 | Implicit pointer checks, format specifier, experimental marking, devargs spacing |
| **Info** | 2 | meson.build ordering (pre-existing), documentation gap |

#### Recommended Actions

1. **Should fix:** Change !ptr to ptr == NULL for pointer comparisons
2. **Should fix:** Use PRIu64 format specifier in npa_halo_dump()
3. **Should fix:** Add space between devargs parameter strings
4. **Consider:** Add documentation for the new halo_ena parameter
5. **Consider:** Verify __rte_experimental policy for internal ROC APIs

The patches are generally well-structured and follow DPDK conventions. The issues identified are relatively minor style/consistency items rather than functional problems.

#15 lore raw

RE: [PATCH v2 0/2] cnxk: add HALO support for CN20K mempool

Quoted 12 lines

**Warning: Non-portable format specifier**

In roc_npa_debug.c, function npa_halo_dump():

```c
npa_dump("W9: thresh \t\t%lu\nW9: fc_msh_dst \t\t%d",
         (unsigned long)halo->thresh, halo->fc_msh_dst);
```

The AGENTS.md specifies:

Quoted 1 line

Forbidden: %lld, %llu, %llx → Preferred: %PRId64, %PRIu64,

%PRIx64

Quoted 7 lines

While %lu with an explicit cast is technically different, for consistency with the rest of the file (which uses %"PRIx64" patterns), this should use:

```c
npa_dump("W9: thresh \t\t%" PRIu64 "\nW9: fc_msh_dst \t\t%d",
         (uint64_t)halo->thresh, halo->fc_msh_dst);
```

I'm not sure I agree with this, because the AI suggested fix casts halo->thresh to 64 bit on 32 bit architectures (which there is no need for).

#16 lore raw

Re: [EXTERNAL] Re: [PATCH v2 0/2] cnxk: add HALO support for CN20K mempool

In reply to Stephen Hemminger

Hi Stephen,

Quoted 2 lines

‎This patch never got merged because of CI build failures. Fix and resubmit.

Acknowledged, I will fix and push v3.

Thanks
Nawal Kishor

#17 lore raw

PATCH 2/2 mempool/cnxk: add halo support in mempool

In reply to Nawal Kishor

This patch adds the support of halos in CN20K mempool driver. It introduces a new devargs parameter "halo_ena" to enable or disable halo feature. If halo_ena is set to 1, halos will be enabled for NPA pools created by the mempool driver.

---
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 19 ++++----
 drivers/mempool/cnxk/cn20k_mempool_ops.c | 60 ++++++++++++++++++++++++
 drivers/mempool/cnxk/cn9k_mempool_ops.c  |  2 +-
 drivers/mempool/cnxk/cnxk_mempool.c      | 40 +++++++++++-----
 drivers/mempool/cnxk/cnxk_mempool.h      | 16 ++++++-
 drivers/mempool/cnxk/cnxk_mempool_ops.c  | 11 +++--
 drivers/mempool/cnxk/meson.build         |  1 +
 7 files changed, 120 insertions(+), 29 deletions(-)
 create mode 100644 drivers/mempool/cnxk/cn20k_mempool_ops.c
drivers/mempool/cnxk/cn10k_mempool_ops.c +8 -11
index a5be0ccafe..09f900a850 100644
@@ -2,9 +2,6 @@
  * Copyright(C) 2021 Marvell.
  */
 
-#include <rte_mempool.h>
-
-#include "roc_api.h"
 #include "cnxk_mempool.h"
 
 #define BATCH_ALLOC_SZ              ROC_CN10K_NPA_BATCH_ALLOC_MAX_PTRS
@@ -79,7 +76,7 @@ batch_op_data_set(uint64_t pool_id, struct batch_op_data *op_data)
 	batch_op_data_tbl[aura] = op_data;
 }
 
-static int
+int
 batch_op_init(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -109,7 +106,7 @@ batch_op_init(struct rte_mempool *mp)
 	return 0;
 }
 
-static void
+void
 batch_op_fini(struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -149,7 +146,7 @@ batch_op_fini(struct rte_mempool *mp)
 	rte_wmb();
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 		  unsigned int n)
 {
@@ -181,7 +178,7 @@ cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 	return 0;
 }
 
-static unsigned int
+unsigned int
 cn10k_mempool_get_count(const struct rte_mempool *mp)
 {
 	struct batch_op_data *op_data;
@@ -326,7 +323,7 @@ mempool_deq_batch_sync(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return count;
 }
 
-static int __rte_hot
+int __rte_hot
 cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	struct batch_op_data *op_data;
@@ -353,7 +350,7 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 	return 0;
 }
 
-static int
+int
 cn10k_mempool_alloc(struct rte_mempool *mp)
 {
 	uint32_t block_size;
@@ -376,7 +373,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 		block_size += padding;
 	}
 
-	rc = cnxk_mempool_alloc(mp);
+	rc = cnxk_mempool_alloc(mp, 0);
 	if (rc)
 		return rc;
 
@@ -392,7 +389,7 @@ cn10k_mempool_alloc(struct rte_mempool *mp)
 	return rc;
 }
 
-static void
+void
 cn10k_mempool_free(struct rte_mempool *mp)
 {
 	batch_op_fini(mp);
drivers/mempool/cnxk/cn20k_mempool_ops.c new file +60 -0

60 lines not on this page · raw message

drivers/mempool/cnxk/cn9k_mempool_ops.c +1 -1
index b7967f8085..8248071cb7 100644
@@ -72,7 +72,7 @@ cn9k_mempool_alloc(struct rte_mempool *mp)
 	padding = ((block_size / ROC_ALIGN) % 2) ? 0 : ROC_ALIGN;
 	mp->trailer_size += padding;
 
-	return cnxk_mempool_alloc(mp);
+	return cnxk_mempool_alloc(mp, 0);
 }
 
 static struct rte_mempool_ops cn9k_mempool_ops = {
drivers/mempool/cnxk/cnxk_mempool.c +29 -11
index 6ff11d8004..6939fccff4 100644
@@ -18,6 +18,7 @@
 #define CNXK_NPA_DEV_NAME	 RTE_STR(cnxk_npa_dev_)
 #define CNXK_NPA_DEV_NAME_LEN	 (sizeof(CNXK_NPA_DEV_NAME) + PCI_PRI_STR_SIZE)
 #define CNXK_NPA_MAX_POOLS_PARAM "max_pools"
+#define CNXK_NPA_HALO_ENA_PARAM	 "halo_ena"
 
 static inline uint32_t
 npa_aura_size_to_u32(uint8_t val)
@@ -46,30 +47,46 @@ parse_max_pools_handler(const char *key, const char *value, void *extra_args)
 	return 0;
 }
 
-static inline uint32_t
-parse_max_pools(struct rte_devargs *devargs)
+static int
+parse_halo_ena_handler(const char *key, const char *value, void *extra_args)
+{
+	RTE_SET_USED(key);
+	uint8_t val;
+
+	val = atoi(value);
+	if (val != 0 && val != 1)
+		return -EINVAL;
+
+	*(uint8_t *)extra_args = val;
+	return 0;
+}
+
+static int
+cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
 {
 	uint32_t max_pools = npa_aura_size_to_u32(NPA_AURA_SZ_128);
+	struct rte_devargs *devargs = pci_dev->device.devargs;
 	struct rte_kvargs *kvlist;
+	uint32_t halo_ena = 0;
 
 	if (devargs == NULL)
-		goto exit;
+		goto null_devargs;
 	kvlist = rte_kvargs_parse(devargs->args, NULL);
 	if (kvlist == NULL)
 		goto exit;
 
 	rte_kvargs_process(kvlist, CNXK_NPA_MAX_POOLS_PARAM,
 			   &parse_max_pools_handler, &max_pools);
+	rte_kvargs_process(kvlist, CNXK_NPA_HALO_ENA_PARAM,
+			   &parse_halo_ena_handler, &halo_ena);
 	rte_kvargs_free(kvlist);
-exit:
-	return max_pools;
-}
 
-static int
-cnxk_mempool_plt_parse_devargs(struct rte_pci_device *pci_dev)
-{
-	roc_idev_npa_maxpools_set(parse_max_pools(pci_dev->device.devargs));
+null_devargs:
+	roc_idev_npa_maxpools_set(max_pools);
+	roc_idev_npa_halo_ena_set(halo_ena);
 	return 0;
+exit:
+	return -EINVAL;
 }
 
 static inline char *
@@ -201,7 +218,8 @@ RTE_PMD_REGISTER_PCI(mempool_cnxk, npa_pci);
 RTE_PMD_REGISTER_PCI_TABLE(mempool_cnxk, npa_pci_map);
 RTE_PMD_REGISTER_KMOD_DEP(mempool_cnxk, "vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(mempool_cnxk,
-			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>");
+			      CNXK_NPA_MAX_POOLS_PARAM "=<128-1048576>"
+			      CNXK_NPA_HALO_ENA_PARAM "=<0-1>");
 
 RTE_INIT(cnxk_mempool_parse_devargs)
 {
drivers/mempool/cnxk/cnxk_mempool.h +14 -2
index 669e617952..941290061e 100644
@@ -7,6 +7,8 @@
 
 #include <rte_mempool.h>
 
+#include "roc_api.h"
+
 enum cnxk_mempool_flags {
 	/* This flag is used to ensure that only aura zero is allocated.
 	 * If aura zero is not available, then mempool creation fails.
@@ -47,7 +49,7 @@ int cnxk_mempool_populate(struct rte_mempool *mp, unsigned int max_objs,
 			  void *vaddr, rte_iova_t iova, size_t len,
 			  rte_mempool_populate_obj_cb_t *obj_cb,
 			  void *obj_cb_arg);
-int cnxk_mempool_alloc(struct rte_mempool *mp);
+int cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags);
 void cnxk_mempool_free(struct rte_mempool *mp);
 
 int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
@@ -55,6 +57,16 @@ int __rte_hot cnxk_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
 int __rte_hot cnxk_mempool_deq(struct rte_mempool *mp, void **obj_table,
 			       unsigned int n);
 
+int batch_op_init(struct rte_mempool *mp);
+void batch_op_fini(struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_enq(struct rte_mempool *mp, void *const *obj_table,
+				unsigned int n);
+unsigned int cn10k_mempool_get_count(const struct rte_mempool *mp);
+int __rte_hot cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table,
+				unsigned int n);
+int cn10k_mempool_alloc(struct rte_mempool *mp);
+void cn10k_mempool_free(struct rte_mempool *mp);
+
 int cn10k_mempool_plt_init(void);
 
-#endif
+#endif /* _CNXK_MEMPOOL_H_ */
drivers/mempool/cnxk/cnxk_mempool_ops.c +7 -4
index 5c7fcea487..01b6247fbb 100644
@@ -70,9 +70,9 @@ cnxk_mempool_calc_mem_size(const struct rte_mempool *mp, uint32_t obj_num,
 }
 
 int
-cnxk_mempool_alloc(struct rte_mempool *mp)
+cnxk_mempool_alloc(struct rte_mempool *mp, uint64_t roc_flags)
 {
-	uint32_t block_count, flags, roc_flags = 0;
+	uint32_t block_count, flags;
 	uint64_t aura_handle = 0;
 	struct npa_aura_s aura;
 	struct npa_pool_s pool;
@@ -98,7 +98,7 @@ cnxk_mempool_alloc(struct rte_mempool *mp)
 
 	flags = CNXK_MEMPOOL_FLAGS(mp);
 	if (flags & CNXK_MEMPOOL_F_ZERO_AURA) {
-		roc_flags = ROC_NPA_ZERO_AURA_F;
+		roc_flags |= ROC_NPA_ZERO_AURA_F;
 	} else if (flags & CNXK_MEMPOOL_F_CUSTOM_AURA) {
 		struct npa_aura_s *paura;
 
@@ -192,9 +192,12 @@ cnxk_mempool_plt_init(void)
 
 	if (roc_model_is_cn9k()) {
 		rte_mbuf_set_platform_mempool_ops("cn9k_mempool_ops");
-	} else if (roc_model_is_cn10k() || roc_model_is_cn20k()) {
+	} else if (roc_model_is_cn10k()) {
 		rte_mbuf_set_platform_mempool_ops("cn10k_mempool_ops");
 		rc = cn10k_mempool_plt_init();
+	} else if (roc_model_is_cn20k()) {
+		rte_mbuf_set_platform_mempool_ops("cn20k_mempool_ops");
+		rc = cn10k_mempool_plt_init();
 	}
 	return rc;
 }
drivers/mempool/cnxk/meson.build +1 -0
index e388cce26a..7722264320 100644
@@ -14,6 +14,7 @@ sources = files(
         'cnxk_mempool_telemetry.c',
         'cn9k_mempool_ops.c',
         'cn10k_mempool_ops.c',
+        'cn20k_mempool_ops.c',
         'cn10k_hwpool_ops.c',
 )
 
Signature · 1 line
2.48.1