Skip to contentSkip to conversation

net/ixgbe: fix EEPROM read failure on copper media

PATCH In review Mingjin Ye 2 participants 3 messages Jul 1 Network drivers

lore
Share & tools
lore

Mingjin Ye

author
#0 lore raw

PATCH 1/1 net/ixgbe: fix EEPROM read failure on copper media

The ixgbe_get_module_info() and ixgbe_get_module_eeprom() functions attempt to read SFF EEPROM data for all port types. However, copper media ports do not have SFF EEPROMs, causing invalid I2C operations and generating error logs.

This patch adds a media type check at the beginning of both functions. If the media type is ixgbe_media_type_copper, return -ENOTSUP to safely skip the EEPROM read.

Fixes b74d0cd43e37 ("net/ixgbe: add module EEPROM callbacks for ixgbe")
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/ixgbe/ixgbe_ethdev.c +12 -0
index f9de95e4fc..44c29f0642 100644
@@ -7424,6 +7424,12 @@ ixgbe_get_module_info(struct rte_eth_dev *dev,
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return -E_RTE_SECONDARY;
 
+	if (hw->phy.media_type == ixgbe_media_type_copper) {
+		PMD_DRV_LOG(DEBUG, "Port %u is Base-T (copper), no SFF module info.",
+				dev->data->port_id);
+		return -ENOTSUP;
+	}
+
 	/* Check whether we support SFF-8472 or not */
 	status = hw->phy.ops.read_i2c_eeprom(hw,
 					     IXGBE_SFF_SFF_8472_COMP,
@@ -7477,6 +7483,12 @@ ixgbe_get_module_eeprom(struct rte_eth_dev *dev,
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return -E_RTE_SECONDARY;
 
+	if (hw->phy.media_type == ixgbe_media_type_copper) {
+		PMD_DRV_LOG(DEBUG, "Port %u is Base-T (copper), cannot read module EEPROM.",
+				dev->data->port_id);
+		return -ENOTSUP;
+	}
+
 	for (i = info->offset; i < info->offset + info->length; i++) {
 		if (i < RTE_ETH_MODULE_SFF_8079_LEN)
 			status = hw->phy.ops.read_i2c_eeprom(hw, i, &databyte);
Signature · 1 line
2.47.1
Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines · Mingjin Ye

The ixgbe_get_module_info() and ixgbe_get_module_eeprom() functions attempt to read SFF EEPROM data for all port types. However, copper media ports do not have SFF EEPROMs, causing invalid I2C operations and generating error logs.

This patch adds a media type check at the beginning of both functions. If the media type is ixgbe_media_type_copper, return -ENOTSUP to safely skip the EEPROM read.

Fixes b74d0cd43e37 ("net/ixgbe: add module EEPROM callbacks for ixgbe")
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/ixgbe/ixgbe_ethdev.c +6 -0
index f9de95e4fc..44c29f0642 100644
@@ -7424,6 +7424,12 @@ ixgbe_get_module_info(struct rte_eth_dev *dev,
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return -E_RTE_SECONDARY;
 
+	if (hw->phy.media_type == ixgbe_media_type_copper) {
+		PMD_DRV_LOG(DEBUG, "Port %u is Base-T (copper), no SFF module info.",
+				dev->data->port_id);
+		return -ENOTSUP;
+	}
+
 	/* Check whether we support SFF-8472 or not */
 	status = hw->phy.ops.read_i2c_eeprom(hw,
 					     IXGBE_SFF_SFF_8472_COMP,

drivers/net/intel/ixgbe/ixgbe_ethdev.c ixgbe_get_module_eeprom(struct rte_eth_dev *dev, · line 7491

Quoted 9 lines
drivers/net/intel/ixgbe/ixgbe_ethdev.c +6 -0
@@ -7477,6 +7483,12 @@ ixgbe_get_module_eeprom(struct rte_eth_dev *dev,
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return -E_RTE_SECONDARY;
 
+	if (hw->phy.media_type == ixgbe_media_type_copper) {
+		PMD_DRV_LOG(DEBUG, "Port %u is Base-T (copper), cannot read module EEPROM.",
+				dev->data->port_id);
+		return -ENOTSUP;
+	}
+

Looks reasonable.

#2 lore raw
Quoted 13 lines · Bruce Richardson
Quoted 12 lines · Mingjin Ye

The ixgbe_get_module_info() and ixgbe_get_module_eeprom() functions attempt to read SFF EEPROM data for all port types. However, copper media ports do not have SFF EEPROMs, causing invalid I2C operations and generating error logs.

This patch adds a media type check at the beginning of both functions. If the media type is ixgbe_media_type_copper, return -ENOTSUP to safely skip the EEPROM read.

Fixes b74d0cd43e37 ("net/ixgbe: add module EEPROM callbacks for ixgbe")
Quoted 7 lines
Quoted 5 lines
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch applied to dpdk-next-net-intel.
Thanks,
/Bruce