On 01/12/2026 06:48, Eric Joyner wrote:
> From: "Nikhil P. Rao" <nikh…@amd.com> > > ionic_get_fecparam() fills fec->fec with the constant > ETHTOOL_FEC_OFF | ETHTOOL_FEC_RS | ETHTOOL_FEC_BASER. The uAPI defines > fec as the configured FEC modes, so a port configured for RS reports > all three: > > Supported/Configured FEC encodings: Off RS BaseR > > where it should report RS alone. Take fec->fec from config.fec_type. > Supported modes belong in ETHTOOL_GLINKSETTINGS, which > ionic_get_link_ksettings() already fills. > > With autoneg enabled, the FEC mode is selected by the link and > ionic_set_fecparam() refuses changes, so report ETHTOOL_FEC_AUTO there. > > fec->active_fec still reads config.fec_type; reporting the operational > mode is a separate change. > > Fixes: e95f922f4c2f ("ionic: implement ethtool set-fec") > Signed-off-by: Nikhil P. Rao <nikh…@amd.com> > Signed-off-by: Eric Joyner <eric…@amd.com> > Signed-off-by: Brett Creeley <bret…@amd.com> > --- > drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c > index af16b0081e8c..0627e4e171a8 100644 > --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c > +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c > @@ -432,16 +432,20 @@ static int ionic_get_fecparam(struct net_device *netdev, > switch (lif->ionic->idev.port_info->config.fec_type) { > case IONIC_PORT_FEC_TYPE_NONE: > fec->active_fec = ETHTOOL_FEC_OFF; > + fec->fec = ETHTOOL_FEC_OFF; > break; > case IONIC_PORT_FEC_TYPE_RS: > fec->active_fec = ETHTOOL_FEC_RS; > + fec->fec = ETHTOOL_FEC_RS; > break; > case IONIC_PORT_FEC_TYPE_FC: > fec->active_fec = ETHTOOL_FEC_BASER; > + fec->fec = ETHTOOL_FEC_BASER; > break; > } > - fec->fec = ETHTOOL_FEC_OFF | ETHTOOL_FEC_RS | ETHTOOL_FEC_BASER; > + if (lif->ionic->idev.port_info->config.an_enable) > + fec->fec = ETHTOOL_FEC_AUTO; > return 0; > } >
Reviewed-by: Vadim Fedorenko <vadi…@linux.dev>