From: "Nikhil P. Rao" ionic_get_fecparam() fills fec->active_fec from config.fec_type, the mode the host requested, which on an autoneg link is whatever was last programmed while the link negotiates something else. Read it from status.fec_type, where firmware reports the operational mode. status.fec_type was carved out of the reserved area by commit c4e7a75a096c ("ionic: updates to ionic FW api description"), and firmware older than that leaves the byte reserved, where zero reads as IONIC_PORT_FEC_TYPE_NONE, so --show-fec reports FEC off on a link that may be running it. Poisoning the byte before PORT_INIT, the way the driver marks unwritten extra_stats counters with IONIC_STAT_INVALID, does not work here: firmware builds the whole port status block and writes it over the DMA region, so the marker is gone whether or not that firmware knows the field. Accept the wrong answer on firmware that old. Signed-off-by: Nikhil P. Rao Signed-off-by: Eric Joyner --- drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index bf7c70438a8c..2e067481bb15 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -442,8 +442,10 @@ static int ionic_get_fecparam(struct net_device *netdev, lif = netdev_priv(netdev); port_info = lif->ionic->idev.port_info; - fec->active_fec = ionic_fec_type_to_ethtool(port_info->config.fec_type); - fec->fec = ionic_fec_type_to_ethtool(port_info->config.fec_type); + fec->active_fec = + ionic_fec_type_to_ethtool(READ_ONCE(port_info->status.fec_type)); + fec->fec = + ionic_fec_type_to_ethtool(READ_ONCE(port_info->config.fec_type)); return 0; } -- 2.53.0