netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "netlink error: Invalid argument" with ethtool-5.13+ on recent kernels due to "ethtool: Add netlink handler for getmodule (-m)" - 25b64c66f58d3df0ad7272dda91c3ab06fe7a303, also no SFP-DOM support via netlink?
@ 2024-05-21  6:26 Krzysztof Olędzki
  2024-05-21  6:55 ` Michal Kubecek
  0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Olędzki @ 2024-05-21  6:26 UTC (permalink / raw)
  To: Michal Kubecek, Vladyslav Tarasiuk, Moshe Shemesh; +Cc: netdev@vger.kernel.org

Hi,

After upgrading from 5.4-stable to 6.6-stable I noticed that modern ethtool -m stopped working with ports where I have QSFP modules installed in my CX3 / CX3-Pro cards.

Git bisect identified the following patch as being responsible for the issue:
https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=25b64c66f58d3df0ad7272dda91c3ab06fe7a303

Without the patch, I get the following output:
# ./ethtool --debug 3 -m eth3
        Identifier                                : 0x0d (QSFP+)
        Extended identifier                       : 0x00
        Extended identifier description           : 1.5W max. Power consumption
        Extended identifier description           : No CDR in TX, No CDR in RX
        Extended identifier description           : High Power Class (> 3.5 W) not enabled
        Connector                                 : 0x0c (MPO Parallel Optic)
        Transceiver codes                         : 0x00 0x00 0x30 0x00 0x00 0x00 0x00 0x00
        Transceiver type                          : SAS 6.0G
        Transceiver type                          : SAS 3.0G
        Encoding                                  : 0x01 (8B/10B)
        BR, Nominal                               : 0Mbps
        Rate identifier                           : 0x00
        Length (SMF,km)                           : 0km
        Length (OM3 50um)                         : 0m
        Length (OM2 50um)                         : 0m
        Length (OM1 62.5um)                       : 0m
        Length (Copper or Active cable)           : 0m
        Transmitter technology                    : 0x00 (850 nm VCSEL)
        Laser wavelength                          : 850.000nm
        Laser wavelength tolerance                : 10.000nm
        Vendor name                               : AVAGO
        Vendor OUI                                : 00:17:6a
        Vendor PN                                 : <REDACTED>
        Vendor rev                                : A0
        Vendor SN                                 : <REDACTED>
        Date code                                 : <REDACTED>
        Revision Compliance                       : Revision not specified
        Module temperature                        : 40.07 degrees C / 104.13 degrees F
        Module voltage                            : 3.2914 V
        Alarm/warning flags implemented           : No
        Laser tx bias current (Channel 1)         : 6.556 mA
        Laser tx bias current (Channel 2)         : 0.000 mA
        Laser tx bias current (Channel 3)         : 0.000 mA
        Laser tx bias current (Channel 4)         : 0.000 mA
        Transmit avg optical power (Channel 1)    : 0.8101 mW / -0.91 dBm
        Transmit avg optical power (Channel 2)    : 0.0000 mW / -inf dBm
        Transmit avg optical power (Channel 3)    : 0.0000 mW / -inf dBm
        Transmit avg optical power (Channel 4)    : 0.0000 mW / -inf dBm
        Rcvr signal avg optical power(Channel 1)  : 0.5716 mW / -2.43 dBm
        Rcvr signal avg optical power(Channel 2)  : 0.0000 mW / -inf dBm
        Rcvr signal avg optical power(Channel 3)  : 0.0000 mW / -inf dBm
        Rcvr signal avg optical power(Channel 4)  : 0.0000 mW / -inf dBm

With the patch (included in ethtool-5.13):
# ./ethtool --debug 3 -m eth3
sending genetlink packet (32 bytes):
    msg length 32 genl-ctrl
received genetlink packet (956 bytes):
    msg length 956 genl-ctrl
received genetlink packet (36 bytes):
    msg length 36 error errno=0
sending genetlink packet (76 bytes):
    msg length 76 ethool ETHTOOL_MSG_MODULE_EEPROM_GET
received genetlink packet (176 bytes):
    msg length 176 ethool ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY
received genetlink packet (36 bytes):
    msg length 36 error errno=0
sending genetlink packet (76 bytes):
    msg length 76 ethool ETHTOOL_MSG_MODULE_EEPROM_GET
received genetlink packet (176 bytes):
    msg length 176 ethool ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY
received genetlink packet (36 bytes):
    msg length 36 error errno=0
sending genetlink packet (76 bytes):
    msg length 76 ethool ETHTOOL_MSG_MODULE_EEPROM_GET
received genetlink packet (96 bytes):
    msg length 96 error errno=-22
netlink error: Invalid argument

I suspect this works on the older kernels because of the lack of netlink support (which got introduced somewhere between 5.4 and 6.6), so ethtool automatically fallbacks to the ioctl interface:

sending genetlink packet (32 bytes):
    msg length 32 genl-ctrl
received genetlink packet (52 bytes):
    msg length 52 error errno=-2
(...)

Also note that non-DOM SFP does work:
# ./ethtool --debug 3 -m eth2
sending genetlink packet (32 bytes):
    msg length 32 genl-ctrl
received genetlink packet (956 bytes):
    msg length 956 genl-ctrl
received genetlink packet (36 bytes):
    msg length 36 error errno=0
sending genetlink packet (76 bytes):
    msg length 76 ethool ETHTOOL_MSG_MODULE_EEPROM_GET
received genetlink packet (176 bytes):
    msg length 176 ethool ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY
received genetlink packet (36 bytes):
    msg length 36 error errno=0
sending genetlink packet (76 bytes):
    msg length 76 ethool ETHTOOL_MSG_MODULE_EEPROM_GET
received genetlink packet (176 bytes):
    msg length 176 ethool ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY
received genetlink packet (36 bytes):
    msg length 36 error errno=0
        Identifier                                : 0x03 (SFP)
        Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
        (...)

Still need to check if SFP w/DOM works, but it seems we are missing reporting "Optical diagnostics support" as sff8472_show_all() is only called only for the non-netlink interface?

Compiling ethtool with --disable-netlink also fixes both the problems, but obviously this is just a workaround.

Thanks,
 Krzysztof Olędzki

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-07-31  8:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21  6:26 "netlink error: Invalid argument" with ethtool-5.13+ on recent kernels due to "ethtool: Add netlink handler for getmodule (-m)" - 25b64c66f58d3df0ad7272dda91c3ab06fe7a303, also no SFP-DOM support via netlink? Krzysztof Olędzki
2024-05-21  6:55 ` Michal Kubecek
2024-05-21  7:02   ` Krzysztof Olędzki
2024-05-21  7:16     ` Krzysztof Olędzki
2024-05-21  7:34     ` Michal Kubecek
2024-05-21  7:38       ` Krzysztof Olędzki
2024-05-21 20:21         ` Andrew Lunn
2024-05-22  4:54           ` Krzysztof Olędzki
2024-05-22  8:40             ` Ido Schimmel
2024-05-22 12:44               ` Andrew Lunn
2024-05-23  5:29                 ` Krzysztof Olędzki
2024-05-23 10:37                   ` Michal Kubecek
2024-05-23 10:48                   ` Ido Schimmel
2024-05-23 15:35                   ` Andrew Lunn
2024-07-08  3:41                     ` [PATCH] net/mlx4: Add support for EEPROM high pages query for QSFP/QSFP+/QSFP28 Krzysztof Olędzki
2024-07-08 16:28                       ` Ido Schimmel
2024-07-09 11:17                       ` Dan Merillat
2024-07-08  3:41                     ` [PATCH] qsfp: Better handling of Page 03h netlink read failure Krzysztof Olędzki
2024-07-08 16:12                       ` Ido Schimmel
2024-07-31  0:55                         ` Krzysztof Olędzki
2024-07-31  8:48                           ` Ido Schimmel

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).