DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [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
Date: Thu, 03 Apr 2025 20:12:35 +0000	[thread overview]
Message-ID: <bug-1690-3@http.bugs.dpdk.org/> (raw)

[-- 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 --]

                 reply	other threads:[~2025-04-03 20:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-1690-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).