DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] common/cnxk: add ROC errata list
@ 2022-03-30  8:43 Rahul Bhansali
  2022-03-30  8:43 ` [PATCH 2/2] net/cnxk: use ROC errata API Rahul Bhansali
  0 siblings, 1 reply; 3+ messages in thread
From: Rahul Bhansali @ 2022-03-30  8:43 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, Rahul Bhansali

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 <rbhansali@marvell.com>
---
 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.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] net/cnxk: use ROC errata API
  2022-03-30  8:43 [PATCH 1/2] common/cnxk: add ROC errata list Rahul Bhansali
@ 2022-03-30  8:43 ` Rahul Bhansali
  2022-05-02 18:33   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Rahul Bhansali @ 2022-03-30  8:43 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, Rahul Bhansali

Used errata APIs roc_errata_nix_has_no_drop_re() and
roc_errata_nix_has_cq_min_size_4k() instead of direct
ROC model check.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn10k_ethdev.c | 4 +---
 drivers/net/cnxk/cn9k_ethdev.c  | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
index 15dbea2180..6f37bf5a4b 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -778,9 +778,7 @@ cn10k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 	/* DROP_RE is not supported with inline IPSec for CN10K A0 and
 	 * when vector mode is enabled.
 	 */
-	if ((roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() ||
-	     roc_model_is_cnf10kb_a0()) &&
-	    !roc_env_is_asim()) {
+	if (roc_errata_nix_has_no_drop_re() && !roc_env_is_asim()) {
 		dev->ipsecd_drop_re_dis = 1;
 		dev->vec_drop_re_dis = 1;
 	}
diff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c
index eda33dc8c5..be1276180c 100644
--- a/drivers/net/cnxk/cn9k_ethdev.c
+++ b/drivers/net/cnxk/cn9k_ethdev.c
@@ -737,7 +737,7 @@ cn9k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 	roc_nix_ptp_info_cb_register(&dev->nix, cn9k_nix_ptp_info_update_cb);
 
 	/* Update HW erratas */
-	if (roc_model_is_cn96_a0() || roc_model_is_cn95_a0())
+	if (roc_errata_nix_has_cq_min_size_4k())
 		dev->cq_min_4k = 1;
 	return 0;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] net/cnxk: use ROC errata API
  2022-03-30  8:43 ` [PATCH 2/2] net/cnxk: use ROC errata API Rahul Bhansali
@ 2022-05-02 18:33   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2022-05-02 18:33 UTC (permalink / raw)
  To: Rahul Bhansali, Ferruh Yigit, Andrew Rybchenko
  Cc: dpdk-dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Jerin Jacob

On Wed, Mar 30, 2022 at 2:14 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> Used errata APIs roc_errata_nix_has_no_drop_re() and
> roc_errata_nix_has_cq_min_size_4k() instead of direct
> ROC model check.
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>


Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series applied to dpdk-next-net-mrvl/for-next-net. Thanks
> ---
>  drivers/net/cnxk/cn10k_ethdev.c | 4 +---
>  drivers/net/cnxk/cn9k_ethdev.c  | 2 +-
>  2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
> index 15dbea2180..6f37bf5a4b 100644
> --- a/drivers/net/cnxk/cn10k_ethdev.c
> +++ b/drivers/net/cnxk/cn10k_ethdev.c
> @@ -778,9 +778,7 @@ cn10k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
>         /* DROP_RE is not supported with inline IPSec for CN10K A0 and
>          * when vector mode is enabled.
>          */
> -       if ((roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() ||
> -            roc_model_is_cnf10kb_a0()) &&
> -           !roc_env_is_asim()) {
> +       if (roc_errata_nix_has_no_drop_re() && !roc_env_is_asim()) {
>                 dev->ipsecd_drop_re_dis = 1;
>                 dev->vec_drop_re_dis = 1;
>         }
> diff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c
> index eda33dc8c5..be1276180c 100644
> --- a/drivers/net/cnxk/cn9k_ethdev.c
> +++ b/drivers/net/cnxk/cn9k_ethdev.c
> @@ -737,7 +737,7 @@ cn9k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
>         roc_nix_ptp_info_cb_register(&dev->nix, cn9k_nix_ptp_info_update_cb);
>
>         /* Update HW erratas */
> -       if (roc_model_is_cn96_a0() || roc_model_is_cn95_a0())
> +       if (roc_errata_nix_has_cq_min_size_4k())
>                 dev->cq_min_4k = 1;
>         return 0;
>  }
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-02 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30  8:43 [PATCH 1/2] common/cnxk: add ROC errata list Rahul Bhansali
2022-03-30  8:43 ` [PATCH 2/2] net/cnxk: use ROC errata API Rahul Bhansali
2022-05-02 18:33   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).