From: Kommula Shiva Shankar <[email protected]> This patch enables CQ stashing for better CQE processing performance
Signed-off-by: Kommula Shiva Shankar <[email protected]> --- drivers/common/cnxk/roc_features.h | 6 ++++++ drivers/common/cnxk/roc_nix.h | 1 + drivers/common/cnxk/roc_nix_queue.c | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/drivers/common/cnxk/roc_features.h b/drivers/common/cnxk/roc_features.h index 815f800e7a..a461ca46c5 100644 --- a/drivers/common/cnxk/roc_features.h +++ b/drivers/common/cnxk/roc_features.h @@ -46,6 +46,12 @@ roc_feature_nix_has_reass(void) return roc_model_is_cn10ka(); } +static inline bool +roc_feature_nix_has_cqe_stash(void) +{ + return roc_model_is_cn10ka_b0(); +} + static inline bool roc_feature_nix_has_rxchan_multi_bpid(void) { diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h index bb55fbe971..5892de6b24 100644 --- a/drivers/common/cnxk/roc_nix.h +++ b/drivers/common/cnxk/roc_nix.h @@ -368,6 +368,7 @@ struct roc_nix_cq { /* Input parameters */ uint16_t qid; uint32_t nb_desc; + uint8_t stash_thresh; /* End of Input parameters */ uint16_t drop_thresh; struct roc_nix *roc_nix; diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c index 5e689d08be..f96d5c3a96 100644 --- a/drivers/common/cnxk/roc_nix_queue.c +++ b/drivers/common/cnxk/roc_nix_queue.c @@ -908,6 +908,13 @@ roc_nix_cq_init(struct roc_nix *roc_nix, struct roc_nix_cq *cq) } cq_ctx->bp = cq->drop_thresh; + if (roc_feature_nix_has_cqe_stash()) { + if (cq_ctx->caching) { + cq_ctx->stashing = 1; + cq_ctx->stash_thresh = cq->stash_thresh; + } + } + rc = mbox_process(mbox); mbox_put(mbox); if (rc) -- 2.25.1

