]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: ethtool: fix the display error of `ethtool -m DEVNAME`
authorYu Xiao <yu.xiao@corigine.com>
Tue, 2 Aug 2022 09:33:55 +0000 (10:33 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Aug 2022 02:20:54 +0000 (19:20 -0700)
commit04bc9617883cba9a79ddbdb8e07afa6773e451c3
treef9a8782e6578ebf286fe258739ffd7d4d7a5783c
parent9c06e0bd91d7e90e289cb33bd573abefa96187b3
nfp: ethtool: fix the display error of `ethtool -m DEVNAME`

The port flag isn't set to `NFP_PORT_CHANGED` when using
`ethtool -m DEVNAME` before, so the port state (e.g. interface)
cannot be updated. Therefore, it caused that `ethtool -m DEVNAME`
sometimes cannot read the correct information.

E.g. `ethtool -m DEVNAME` cannot work when load driver before plug
in optical module, as the port interface is still NONE without port
update.

Now update the port state before sending info to NIC to ensure that
port interface is correct (latest state).

Fixes: dceea26a70df ("nfp: implement ethtool get module EEPROM")
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Yu Xiao <yu.xiao@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20220802093355.69065-1-simon.horman@corigine.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c