[PATCH] net/mlx5: fix transceiver warning when not exist

yogev yogev at cgstowernetworks.com
Tue May 6 15:31:07 CEST 2025


In case no transceiver exist when trying to get the transceiver's info
There should not be an error message from the library.
The caller may print an appropriate error message using the relevant rte_errno if required.

Bugzilla ID: 1690

Signed-off-by: yogev <yogev at cgstowernetworks.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index e192f698d8..ba5fd2d253 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -1253,8 +1253,10 @@ mlx5_get_module_info(struct rte_eth_dev *dev,
 	}
 	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
 	if (ret) {
-		DRV_LOG(WARNING, "port %u ioctl(SIOCETHTOOL) failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+		if (rte_errno != EIO) {
+			DRV_LOG(WARNING, "port %u ioctl(SIOCETHTOOL) failed: %s",
+				dev->data->port_id, strerror(rte_errno));
+		}
 		return ret;
 	}
 	modinfo->type = info.type;
-- 
2.34.1



More information about the dev mailing list