From: netdev-bot+sashiko@kernel.org
To: eric.joyner@amd.com
Cc: netdev@vger.kernel.org, brett.creeley@amd.com,
andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, vadim.fedorenko@linux.dev,
nikhil.rao@amd.com, edumazet@kernel.org
Subject: Re: [PATCH net-next v5 4/6] ionic: map the FEC type through a helper in ionic_get_fecparam()
Date: Mon, 23 Nov 2026 04:25:53 +0000 [thread overview]
Message-ID: <179540795350.3135.5068085678567262262@kernel.org> (raw)
In-Reply-To: <20261118-ionic-get-fec-stats-v5-4-c9c0ee63df4c@amd.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] This commit replaces the single `switch
(port_info->config.fec_type)` in ionic_get_fecparam()…
--
ionic: map the FEC type through a helper in ionic_get_fecparam()
This patch moves the mapping from config.fec_type to ethtool FEC values
out of ionic_get_fecparam() and into a new helper,
ionic_fec_type_to_ethtool(). The helper is then called once for
fec->active_fec and once for fec->fec. The commit message describes
this as "No functional change".
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index a192302c5e19b..c55148f3ae8fa 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
[ ... ]
> +static int ionic_get_fecparam(struct net_device *netdev,
> + struct ethtool_fecparam *fec)
> +{
> + struct ionic_port_info *port_info;
> + struct ionic_lif *lif;
> +
> + 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);
[Severity: Low]
Can these two loads of port_info->config.fec_type return different
values?
Before this patch the switch loaded the field once and set both fields
from that one value, so active_fec and fec always matched. Now there
are two separate plain loads.
port_info is DMA-coherent memory that the firmware writes. It is
allocated in ionic_port_init():
idev->port_info = dma_alloc_coherent(ionic->dev,
idev->port_info_sz,
&idev->port_info_pa,
GFP_KERNEL);
The store to fec->active_fec sits between the two loads, so the
compiler has to reload the field.
One concurrent writer is ionic_lif_handle_fw_up()->ionic_port_init().
That path sends the PORT_INIT dev command without RTNL, and the
firmware refreshes port_info while it runs. ionic_get_fecparam() also
does not check IONIC_LIF_F_FW_RESET.
If fec_type changes between the two reads, ethtool --show-fec could
report something like active_fec=RS with fec=OFF. The old code could
never produce that.
Would it make sense to read the field once into a local and pass that
to both calls? For example:
u8 fec_type = READ_ONCE(port_info->config.fec_type);
It also looks like the later patch in this series, "ionic: report the
operational FEC mode from ethtool --show-fec", still reads the field
twice in the non-autoneg case. When an_enable == 0,
ionic_active_fec_type() returns READ_ONCE(port_info->config.fec_type),
and fec->fec does a second READ_ONCE() of the same field. So the window
seems to remain at the end of the series.
>
> return 0;
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118-ionic-get-fec-stats-v5-0-c9c0ee63df4c%40amd.com
next prev parent reply other threads:[~2026-11-23 4:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 2:56 [PATCH net-next v5 0/6] ionic: FEC reporting fixes and .get_fec_stats handler Eric Joyner
2026-11-19 2:56 ` [PATCH net-next v5 1/6] ionic: write the extra_stats invalid markers one counter at a time Eric Joyner
2026-11-23 4:25 ` netdev-bot+sashiko
2026-11-19 2:56 ` [PATCH net-next v5 2/6] ionic: report FEC off as a supported link mode Eric Joyner
2026-11-19 2:56 ` [PATCH net-next v5 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec Eric Joyner
2026-11-19 2:56 ` [PATCH net-next v5 4/6] ionic: map the FEC type through a helper in ionic_get_fecparam() Eric Joyner
2026-11-23 4:25 ` netdev-bot+sashiko [this message]
2026-11-19 2:56 ` [PATCH net-next v5 5/6] ionic: report the operational FEC mode from ethtool --show-fec Eric Joyner
2026-11-23 4:25 ` netdev-bot+sashiko
2026-11-19 2:56 ` [PATCH net-next v5 6/6] ionic: Add .get_fec_stats ethtool handler Eric Joyner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179540795350.3135.5068085678567262262@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eric.joyner@amd.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikhil.rao@amd.com \
--cc=pabeni@redhat.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox