Is there a way to show what SFP adapters are installed without pulling them from the card?

I currently have ConnectX-2 cards installed on my servers with SFP adapters installed. I would like to query the SFPs and find out what they are without pulling them from the machines.

The servers are running Ubuntu and ethtool does not report any information about the SFPs. Is there a tool or command that I can use to obtain this information?

Hello,

There isn’t a tool for that as far as I know if the NIC runs on ethernet. if it is running on IB you can use the latest ibdiagnet tool that comes from ibutils2 and use the flag --get_cable_info

at one time, you could use mst for this
start mst

grant@sanity01:~[20211123-8:05][#22]$ sudo mst start
Starting MST (Mellanox Software Tools) driver set
Loading MST PCI module - Success
Loading MST PCI configuration module - Success
Create devices
Unloading MST PCI module (unused) - Success
grant@sanity01:~[20211123-8:06][#23]$ sudo mlxconfig -d /dev/mst/
mt4115_pciconf0%   mt4115_pciconf0.1% 
grant@sanity01:~[20211123-8:06][#23]$

then

grant@sanity01:~[20211123-8:06][#24]$ mlxlink -d /dev/mst/
mt4115_pciconf0%   mt4115_pciconf0.1% 
grant@sanity01:~[20211123-8:10][#25]$ sudo mlxlink -d /dev/mst/mt4115_pciconf0

Operational Info
----------------
State                           : Active
Physical state                  : LinkUp
Speed                           : 40GbE
Width                           : 4x
FEC                             : No FEC
Loopback Mode                   : No Loopback
Auto Negotiation                : ON

Supported Info
--------------
Enabled Link Speed              : 0xfaf1f0d3 (100G,50G,40G,25G,10G,1G)
Supported Cable Speed           : 0xfaf1f0d3 (100G,50G,40G,25G,10G,1G)

Troubleshooting Info
--------------------
Status Opcode                   : 0
Group Opcode                    : N/A
Recommendation                  : No issue was observed.

grant@sanity01:~[20211123-8:10][#26]$ sudo mst cable add
-I- Added 2 cable devices ..
grant@sanity01:~[20211123-8:12][#27]$ sudo mst status
MST modules:
------------
    MST PCI module is not loaded
    MST PCI configuration module loaded

MST devices:
------------
/dev/mst/mt4115_pciconf0         - PCI configuration cycles access.
                                   domain:bus:dev.fn=0000:18:00.0 addr.reg=88 data.reg=92
                                   Chip revision is: 00

Cables:
-------------------
mt4115_pciconf0.1_cable_1
mt4115_pciconf0_cable_0
grant@sanity01:~[20211123-8:13][#28]$ sudo mlxcables -d mt4115_pciconf0_cable_0 -q
Querying Cables ....

Cable #1:
---------
Cable name    : mt4115_pciconf0_cable_0
>> No FW data to show
-------- Cable EEPROM --------
Identifier    : QSFP+ (0dh)
Technology    : Copper cable, near and far end limiting active equalizers (c0h)
Compliance    : 40G Active Cable (XLPPI), Unspecified
Attenuation   : 2.5GHz:   0dB
                5.0GHz:   0dB
                7.0GHz:   0dB
                12.9GHz:  0dB
                25.78GHz: 0dB
OUI           : 0x00051e
Vendor        : BROCADE         
Serial number : S1903006974-1   
Part number   : QSFP-AO10       
Revision      : A 
Temperature   : 50 C
Length        : 10 m

grant@sanity01:~[20211123-8:14][#29]$

However this appears to hav e been deprecated in the mlx5_core driver kit.
I cannot figure out how to see my QSFPs manufacturer/model or examine optical quality with the current toolset.