Calling rte_eth_dev_get_module_info() and rte_eth_dev_get_module_eeprom() for MLX ConnectX-6 spawn errors when transceiver not inserted
https://bugs.dpdk.org/show_bug.cgi?id=1690
Bug ID: 1690
Summary: Calling rte_eth_dev_get_module_info() and
rte_eth_dev_get_module_eeprom() for MLX ConnectX-6 spawn errors when transceiver not inserted
Product: DPDK
Version: unspecified
Hardware: All
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: ethdev
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
For Mellanox 'MT2892 Family [ConnectX-6 Dx] 101d'
Calling the dpdk-testpmd's "show port 0 module_eeprom" results in an error when a transceiver isn't inserted.
The error is spawned from the mlx source:drivers/net/mlx5/linux/mlx5_ethdev_os.c
In two places:
```
int mlx5_get_module_info(...)
{
...
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
DRV_LOG(DEBUG, "port %u ioctl(SIOCETHTOOL) failed: %s",
dev->data->port_id, strerror(rte_errno));
return ret;
}
...
}
```And
```
int mlx5_get_module_eeprom(...)
{
...
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret)
DRV_LOG(WARNING, "port %u ioctl(SIOCETHTOOL) failed: %s",
dev->data->port_id, strerror(rte_errno));
...
}
```dpdk-testpmd shows:
``` testpmd> show port 0 module_eeprom mlx5_net: port 0 ioctl(SIOCETHTOOL) failed: Input/output error // <------------ this error. device is removed ```
When trying to use these functions in my own application, as dpdk-testpmd does:rte_eth_dev_get_module_info() and rte_eth_dev_get_module_eeprom() this error log gets printed as well.
An expected result would be to check out the return value and print these errors if required by the caller.
For my scenario, I would like a silence fail in case there's no transceiver.
I've tried to overcome this by asking first if a device "exists" using rte_eth_dev_is_removed() and rte_eth_dev_is_valid_port() but they don't reflect the transceiver state.
A possible solution would be to print these errors in DEBUG
Please advice,
Thanks.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.