[01/13] common/cnxk: set MTU size on SDP based on SoC type

Message ID 20221011120135.45846-1-ndabilpuram@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers
Series [01/13] common/cnxk: set MTU size on SDP based on SoC type |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Nithin Dabilpuram Oct. 11, 2022, 12:01 p.m. UTC
  From: Sathesh Edara <sedara@marvell.com>

Set maximum frame size on SDP NIX side to 16KB for T93 A0-B0,
F95N A0 and F95O A0 SOC type. Rest of the SoCs SDP NIX to 64KB.

Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
 drivers/common/cnxk/hw/nix.h     |  1 +
 drivers/common/cnxk/roc_errata.h |  8 ++++++++
 drivers/common/cnxk/roc_model.h  | 12 ++++++++++++
 drivers/common/cnxk/roc_nix.c    |  5 ++++-
 4 files changed, 25 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h
index a5352644ca..425c335bf3 100644
--- a/drivers/common/cnxk/hw/nix.h
+++ b/drivers/common/cnxk/hw/nix.h
@@ -2118,6 +2118,7 @@  struct nix_lso_format {
 #define NIX_CN9K_MAX_HW_FRS 9212UL
 #define NIX_LBK_MAX_HW_FRS  65535UL
 #define NIX_SDP_MAX_HW_FRS  65535UL
+#define NIX_SDP_16K_HW_FRS  16380UL
 #define NIX_RPM_MAX_HW_FRS  16380UL
 #define NIX_MIN_HW_FRS	    60UL
 
diff --git a/drivers/common/cnxk/roc_errata.h b/drivers/common/cnxk/roc_errata.h
index d3b32f1786..a39796e894 100644
--- a/drivers/common/cnxk/roc_errata.h
+++ b/drivers/common/cnxk/roc_errata.h
@@ -90,4 +90,12 @@  roc_errata_nix_no_meta_aura(void)
 	return roc_model_is_cn10ka_a0();
 }
 
+/* Errata IPBUNIXTX-35039 */
+static inline bool
+roc_errata_nix_sdp_send_has_mtu_size_16k(void)
+{
+	return (roc_model_is_cnf95xxn_a0() || roc_model_is_cnf95xxo_a0() ||
+		roc_model_is_cn96_a0() || roc_model_is_cn96_b0());
+}
+
 #endif /* _ROC_ERRATA_H_ */
diff --git a/drivers/common/cnxk/roc_model.h b/drivers/common/cnxk/roc_model.h
index 57a8af06fc..1985dd771d 100644
--- a/drivers/common/cnxk/roc_model.h
+++ b/drivers/common/cnxk/roc_model.h
@@ -140,6 +140,12 @@  roc_model_is_cn96_ax(void)
 	return (roc_model->flag & ROC_MODEL_CN96xx_Ax);
 }
 
+static inline uint64_t
+roc_model_is_cn96_b0(void)
+{
+	return (roc_model->flag & ROC_MODEL_CN96xx_B0);
+}
+
 static inline uint64_t
 roc_model_is_cn96_cx(void)
 {
@@ -170,6 +176,12 @@  roc_model_is_cnf95xxn_b0(void)
 	return roc_model->flag & ROC_MODEL_CNF95xxN_B0;
 }
 
+static inline uint64_t
+roc_model_is_cnf95xxo_a0(void)
+{
+	return roc_model->flag & ROC_MODEL_CNF95xxO_A0;
+}
+
 static inline uint16_t
 roc_model_is_cn95xxn_a0(void)
 {
diff --git a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c
index 4bb306b60e..8fd8ec8461 100644
--- a/drivers/common/cnxk/roc_nix.c
+++ b/drivers/common/cnxk/roc_nix.c
@@ -127,8 +127,11 @@  roc_nix_max_pkt_len(struct roc_nix *roc_nix)
 {
 	struct nix *nix = roc_nix_to_nix_priv(roc_nix);
 
-	if (roc_nix_is_sdp(roc_nix))
+	if (roc_nix_is_sdp(roc_nix)) {
+		if (roc_errata_nix_sdp_send_has_mtu_size_16k())
+			return NIX_SDP_16K_HW_FRS;
 		return NIX_SDP_MAX_HW_FRS;
+	}
 
 	if (roc_model_is_cn9k())
 		return NIX_CN9K_MAX_HW_FRS;