[9/9] event/cnxk: disable drop re on vector enable for cn10k a0

Message ID 20211102155421.486-9-ndabilpuram@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [1/9] common/cnxk: add code to write CPT CTX through microcode op |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues

Commit Message

Nithin Dabilpuram Nov. 2, 2021, 3:54 p.m. UTC
  Disable drop_re i.e dropping packets with receive errors on
vector enable for few cn10k revisions due to HW errata.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/event/cnxk/cnxk_eventdev_adptr.c |  8 ++++++++
 drivers/net/cnxk/cn10k_ethdev.c          | 11 ++++++++---
 drivers/net/cnxk/cnxk_ethdev.h           |  1 +
 3 files changed, 17 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c
index b9a5df0..fdcd68c 100644
--- a/drivers/event/cnxk/cnxk_eventdev_adptr.c
+++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c
@@ -242,6 +242,10 @@  cnxk_sso_rx_adapter_queue_add(
 				queue_conf->vector_sz,
 				queue_conf->vector_timeout_ns,
 				queue_conf->vector_mp);
+
+			if (cnxk_eth_dev->vec_drop_re_dis)
+				rc |= roc_nix_rx_drop_re_set(&cnxk_eth_dev->nix,
+							     false);
 		}
 		rox_nix_fc_npa_bp_cfg(&cnxk_eth_dev->nix,
 				      rxq_sp->qconf.mp->pool_id, true,
@@ -290,6 +294,10 @@  cnxk_sso_rx_adapter_queue_del(const struct rte_eventdev *event_dev,
 				      rxq_sp->qconf.mp->pool_id, false,
 				      dev->force_ena_bp);
 		cnxk_eth_dev->nb_rxq_sso--;
+
+		/* Enable drop_re if it was disabled earlier */
+		if (cnxk_eth_dev->vec_drop_re_dis && !cnxk_eth_dev->nb_rxq_sso)
+			rc |= roc_nix_rx_drop_re_set(&cnxk_eth_dev->nix, true);
 	}
 
 	if (rc < 0)
diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
index 5d9536c..8378cbf 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -553,10 +553,15 @@  cn10k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 
 	dev = cnxk_eth_pmd_priv(eth_dev);
 
-	/* DROP_RE is not supported with inline IPSec for CN10K A0 */
-	if (roc_model_is_cn10ka_a0() || roc_model_is_cnf10ka_a0() ||
-	    roc_model_is_cnf10kb_a0())
+	/* 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()) {
 		dev->ipsecd_drop_re_dis = 1;
+		dev->vec_drop_re_dis = 1;
+	}
 
 	/* Register up msg callbacks for PTP information */
 	roc_nix_ptp_info_cb_register(&dev->nix, cn10k_nix_ptp_info_update_cb);
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index 93879c8..7cbd9f1 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -342,6 +342,7 @@  struct cnxk_eth_dev {
 		struct {
 			uint64_t cq_min_4k : 1;
 			uint64_t ipsecd_drop_re_dis : 1;
+			uint64_t vec_drop_re_dis : 1;
 		};
 		uint64_t hwcap;
 	};