From 1f997c06c3a2d8831754d6445c5d28b0efb8f97d Mon Sep 17 00:00:00 2001 From: Rahul Bhansali Date: Wed, 30 Mar 2022 14:13:55 +0530 Subject: [PATCH] common/cnxk: add ROC errata list Created roc_errata.h to list the errata handled in userspace drivers. Added no_drop_re, cq_min_size_4k, no_fc_stype_ststp, no_drop_aging, no_vwqe_flush_op etc erratas. Signed-off-by: Rahul Bhansali Acked-by: Jerin Jacob --- drivers/common/cnxk/roc_api.h | 3 + drivers/common/cnxk/roc_errata.h | 80 +++++++++++++++++++++++++++ drivers/common/cnxk/roc_nix_inl_dev.c | 3 +- drivers/common/cnxk/roc_nix_queue.c | 4 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- 5 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 drivers/common/cnxk/roc_errata.h diff --git a/drivers/common/cnxk/roc_api.h b/drivers/common/cnxk/roc_api.h index de7452bf55..072f16d77d 100644 --- a/drivers/common/cnxk/roc_api.h +++ b/drivers/common/cnxk/roc_api.h @@ -47,6 +47,9 @@ /* Model */ #include "roc_model.h" +/* HW Errata */ +#include "roc_errata.h" + /* Mbox */ #include "roc_mbox.h" diff --git a/drivers/common/cnxk/roc_errata.h b/drivers/common/cnxk/roc_errata.h new file mode 100644 index 0000000000..31162d5232 --- /dev/null +++ b/drivers/common/cnxk/roc_errata.h @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2022 Marvell. + */ +#ifndef _ROC_ERRATA_H_ +#define _ROC_ERRATA_H_ + +/* Errata IPBUNIXRX-40129 */ +static inline bool +roc_errata_nix_has_no_drop_re(void) +{ + return (roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() || + roc_model_is_cnf10kb_a0()); +} + +/* Errata NIX-34873 */ +static inline bool +roc_errata_nix_has_cq_min_size_4k(void) +{ + return (roc_model_is_cn96_a0() || roc_model_is_cn95_a0()); +} + +/* Errata IPBUNPA-37480 */ +static inline bool +roc_errata_npa_has_no_fc_stype_ststp(void) +{ + return roc_model_is_cn10ka_a0() ? true : false; +} + +/* Errata IPBUNIXTX-39337 */ +static inline bool +roc_errata_nix_has_no_drop_aging(void) +{ + return (roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() || + roc_model_is_cnf10kb_a0()); +} + +/* Errata IPBUNIXRX-40130 */ +static inline bool +roc_errata_nix_has_no_vwqe_flush_op(void) +{ + return (roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() || + roc_model_is_cnf10kb_a0()); +} + +/* Errata IPBURVUM-38481 */ +static inline bool +roc_errata_ruvm_has_no_interrupt_with_msixen(void) +{ + return true; +} + +/* Errata IPBUNIXTX-39300 */ +static inline bool +roc_errata_nix_has_assign_incorrect_qintidx(void) +{ + return true; +} + +/* Errata IPBUCPT-38551 */ +static inline bool +roc_errata_cpt_has_use_incorrect_ldwb(void) +{ + return true; +} + +/* Errata IPBUNIXTX-39322 */ +static inline bool +roc_errata_nix_has_overwrite_incorrect_sq_intr(void) +{ + return true; +} + +/* Errata IPBUNIXTX-39248 */ +static inline bool +roc_errata_nix_has_perf_issue_on_stats_update(void) +{ + return true; +} + +#endif /* _ROC_ERRATA_H_ */ diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c index 5a032aab52..51f1f6807b 100644 --- a/drivers/common/cnxk/roc_nix_inl_dev.c +++ b/drivers/common/cnxk/roc_nix_inl_dev.c @@ -358,8 +358,7 @@ nix_inl_nix_setup(struct nix_inl_dev *inl_dev) req->rx_cfg = NIX_INL_LF_RX_CFG; req->flags = NIX_LF_RSS_TAG_LSB_AS_ADDER; - if (roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() || - roc_model_is_cnf10kb_a0()) + if (roc_errata_nix_has_no_drop_re()) req->rx_cfg &= ~ROC_NIX_LF_RX_CFG_DROP_RE; rc = mbox_process_msg(mbox, (void *)&rsp); diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c index 7d271854f4..07dab4b74f 100644 --- a/drivers/common/cnxk/roc_nix_queue.c +++ b/drivers/common/cnxk/roc_nix_queue.c @@ -527,7 +527,7 @@ roc_nix_cq_init(struct roc_nix *roc_nix, struct roc_nix_cq *cq) /* Map CQ0 [RQ0] to CINT0 and so on till max 64 irqs */ cq_ctx->cint_idx = cq->qid; - if (roc_model_is_cn96_a0() || roc_model_is_cn95_a0()) { + if (roc_errata_nix_has_cq_min_size_4k()) { const float rx_cq_skid = NIX_CQ_FULL_ERRATA_SKID; uint16_t min_rx_drop; @@ -658,7 +658,7 @@ sqb_pool_populate(struct roc_nix *roc_nix, struct roc_nix_sq *sq) memset(&aura, 0, sizeof(aura)); aura.fc_ena = 1; - if (roc_model_is_cn9k() || roc_model_is_cn10ka_a0()) + if (roc_model_is_cn9k() || roc_errata_npa_has_no_fc_stype_ststp()) aura.fc_stype = 0x0; /* STF */ else aura.fc_stype = 0x3; /* STSTP */ diff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c index 1d9a02bc06..5884ce5114 100644 --- a/drivers/common/cnxk/roc_nix_tm_ops.c +++ b/drivers/common/cnxk/roc_nix_tm_ops.c @@ -38,7 +38,7 @@ roc_nix_tm_sq_aura_fc(struct roc_nix_sq *sq, bool enable) req->aura.fc_ena = enable; req->aura_mask.fc_ena = 1; - if (roc_model_is_cn9k() || roc_model_is_cn10ka_a0()) { + if (roc_model_is_cn9k() || roc_errata_npa_has_no_fc_stype_ststp()) { req->aura.fc_stype = 0x0; /* STF */ req->aura_mask.fc_stype = 0x0; /* STF */ } else { -- 2.20.1