net/mlx5: fix transceiver warning when not exist

Message ID 20250506133107.4432-1-yogev@cgstowernetworks.com (mailing list archive)
State New
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix transceiver warning when not exist |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/aws-unit-testing success Unit Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/intel-Functional fail Functional issues

Commit Message

yogev May 6, 2025, 1:31 p.m. UTC
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@cgstowernetworks.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

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;