* [DPDK/ethdev Bug 1690] Calling rte_eth_dev_get_module_info() and rte_eth_dev_get_module_eeprom() for MLX ConnectX-6 spawn errors when transceiver not inserted
@ 2025-04-03 20:12 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2025-04-03 20:12 UTC (permalink / raw)
  To: dev
[-- Attachment #1: Type: text/plain, Size: 2440 bytes --]
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: dev@dpdk.org
          Reporter: yogev@cgstowernetworks.com
  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.
-- 
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #2: Type: text/html, Size: 4427 bytes --]
^ permalink raw reply	[flat|nested] only message in thread
only message in thread, other threads:[~2025-04-03 20:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-03 20:12 [DPDK/ethdev Bug 1690] Calling rte_eth_dev_get_module_info() and rte_eth_dev_get_module_eeprom() for MLX ConnectX-6 spawn errors when transceiver not inserted bugzilla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).