[v2,27/32] common/cnxk: configure PFC on SPB aura

Message ID 20230524100407.3796139-27-ndabilpuram@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers
Series [v2,01/32] common/cnxk: allocate dynamic BPIDs |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram May 24, 2023, 10:04 a.m. UTC
  From: Sunil Kumar Kori <skori@marvell.com>

A RQ can be configured with lpb_aura and spb_aura at the same time
and both can contribute to generate aura based back pressure from
NIX to RPM.

But currently PFC configuration are applied on lpb_aura only and
spb_aura does not contribute to create back pressure.

Patch adds support for the same.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/common/cnxk/roc_nix.h    | 1 +
 drivers/common/cnxk/roc_nix_fc.c | 6 ++++++
 2 files changed, 7 insertions(+)
  

Patch

diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h
index 548854952b..f60e546c01 100644
--- a/drivers/common/cnxk/roc_nix.h
+++ b/drivers/common/cnxk/roc_nix.h
@@ -198,6 +198,7 @@  struct roc_nix_fc_cfg {
 			uint16_t cq_drop;
 			bool enable;
 			uint64_t pool;
+			uint64_t spb_pool;
 			uint64_t pool_drop_pct;
 		} rq_cfg;
 
diff --git a/drivers/common/cnxk/roc_nix_fc.c b/drivers/common/cnxk/roc_nix_fc.c
index 0bbc233376..b6956cec39 100644
--- a/drivers/common/cnxk/roc_nix_fc.c
+++ b/drivers/common/cnxk/roc_nix_fc.c
@@ -303,6 +303,12 @@  nix_fc_rq_config_set(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
 				      fc_cfg->rq_cfg.enable, roc_nix->force_rx_aura_bp,
 				      fc_cfg->rq_cfg.tc, pool_drop_pct);
 
+		if (rq->spb_ena) {
+			roc_nix_fc_npa_bp_cfg(roc_nix, fc_cfg->rq_cfg.spb_pool,
+					      fc_cfg->rq_cfg.enable, roc_nix->force_rx_aura_bp,
+					      fc_cfg->rq_cfg.tc, pool_drop_pct);
+		}
+
 		if (roc_nix->local_meta_aura_ena && roc_nix->meta_aura_handle)
 			roc_nix_fc_npa_bp_cfg(roc_nix, roc_nix->meta_aura_handle,
 					      fc_cfg->rq_cfg.enable, roc_nix->force_rx_aura_bp,