[v1,03/43] net/dpaa2: add proper MTU debugging print

Message ID 20240913055959.3246917-4-vanshika.shukla@nxp.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series DPAA2 specific patches |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

vanshika.shukla@nxp.com Sept. 13, 2024, 5:59 a.m. UTC
From: Apeksha Gupta <apeksha.gupta@nxp.com>

This patch add proper debug info for check information of
max-pkt-len and configured params.

also store MTU

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 596f1b4f61..efba9ef286 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -579,9 +579,11 @@  dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
 			DPAA2_PMD_ERR("Unable to set mtu. check config");
 			return ret;
 		}
-		DPAA2_PMD_INFO("MTU configured for the device: %d",
+		DPAA2_PMD_DEBUG("MTU configured for the device: %d",
 				dev->data->mtu);
 	} else {
+		DPAA2_PMD_ERR("Configured mtu %d and calculated max-pkt-len is %d which should be <= %d",
+			eth_conf->rxmode.mtu, max_rx_pktlen, DPAA2_MAX_RX_PKT_LEN);
 		return -1;
 	}
 
@@ -1534,6 +1536,7 @@  dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		DPAA2_PMD_ERR("Setting the max frame length failed");
 		return -1;
 	}
+	dev->data->mtu = mtu;
 	DPAA2_PMD_INFO("MTU configured for the device: %d", mtu);
 	return 0;
 }
@@ -2836,6 +2839,7 @@  dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 		DPAA2_PMD_ERR("Unable to set mtu. check config");
 		goto init_err;
 	}
+	eth_dev->data->mtu = RTE_ETHER_MTU;
 
 	/*TODO To enable soft parser support DPAA2 driver needs to integrate
 	 * with external entity to receive byte code for software sequence