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

Dariusz Sosnowski dsosnowski at nvidia.com
Fri Nov 7 19:15:08 CET 2025


On Thu, Jun 26, 2025 at 11:16:42PM +0000, Yogev Chaimovich wrote:
> OK.
> I wished  there was a DPDK function to verify if transceiver is plugged in or not, without log errors. Such as rte_eth_dev_is_module_exist()
> So, 1'st I would have checked if it's plugged in. Then I would have used rte_eth_dev_get_module_info().

I think such an API is a good idea, but in mlx5 PMD case, this would possibly also require additional changes
on kernel driver side.

Alternatively, if ETHTOOL_GMODULEINFO returned EIO, then in this new ethdev API,
driver could return that transceiver does not exist and nothing would be logged.
But still, the same kind of uncertainty as I mentioned in the previous
mail would be reached - EIO does not necessarily mean that transceiver
is not plugged in.

Because of that uncertainty, I think it's invalid to reduce the log
level or introduce the special handling for EIO as proposed
in existing implementation of rte_eth_dev_get_module_info().

> 
> The workaround is setting the module's log level so the error won't be seen before calling rte_eth_dev_get_module_info(), and set it back to default afterwards.
> 
> Thanks,
> Yogev
> ________________________________
> From: Dariusz Sosnowski <dsosnowski at nvidia.com>
> Sent: Thursday, June 26, 2025 14:36
> To: Yogev Chaimovich <yogev at cgstowernetworks.com>
> Cc: Maayan Kashani <mkashani at nvidia.com>; Stephen Hemminger <stephen at networkplumber.org>; Slava Ovsiienko <viacheslavo at nvidia.com>; Bing Zhao <bingz at nvidia.com>; Ori Kam <orika at nvidia.com>; Suanming Mou <suanmingm at nvidia.com>; Matan Azrad <matan at nvidia.com>; dev at dpdk.org <dev at dpdk.org>
> Subject: Re: [PATCH] net/mlx5: fix transceiver warning when not exist
> 
> Hi Yogev,
> 
> On Mon, Jun 09, 2025 at 01:11:27PM +0000, Yogev Chaimovich wrote:
> > Hi,
> > Actually looks like we're going with another workaround, so I might not be needing my original patch.
> 
> Could you tell us what kind of workaround you applied?
> 
> Also, I'm not sure if this warning should be suppressed on EIO.
> mlx5 PMD relies on the kernel driver to get the module info,
> and from what I've seen for ETHTOOL_GMODULEINFO kernel can return EIO
> also for cases other than transceiver not existing
> (for example error on NIC register access).
> So mlx5 PMD cannot discern between "no transceiver" and
> "other I/O error".
> For this reason I would keep the log and keep it at warn level.
> 
> > Also, I do not understand how my patch (not printing a log) makes a test fail - I couldn't find that test in DPDK to verify. I'm not that familiar though..
> >
> > Yogev
> 
> *snip*
> 
> Best regards,
> Dariusz Sosnowski


More information about the dev mailing list