From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, andrew+netdev@lunn.ch,
netdev@vger.kernel.org, tomasz.lichwala@linux.intel.com,
ripatel@wii.dev, xiaolinkui@kylinos.cn, xiaolinkui@126.com,
runyu.xiao@seu.edu.cn, horms@kernel.org,
marcin.szycik@linux.intel.com, przemyslaw.kitszel@intel.com,
rafal.romanowski@intel.com
Subject: Re: [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs
Date: Tue, 24 Nov 2026 22:00:59 +0000 [thread overview]
Message-ID: <179555765941.3135.17127854838678149583@kernel.org> (raw)
In-Reply-To: <20261120220022.3133664-4-anthony.l.nguyen@intel.com>
Thank you for your contribution! Sashiko AI review found 7 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 5 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The new Hyper-V E610 path in ixgbevf_hv_check_mac_link_vf()
(drivers/net/ethernet/intel/ixgbevf/vf.c:998-1011) decodes the value…
- [Medium] The patch adds a `default:` case to
ixgbevf_hv_check_mac_link_vf() (vf.c:1008-1010).
- [Medium] The commit message only says VFLINKS "does not carry valid
link speed" on Hyper-V E610, which implies the VFLINKS link-up bit is…
- [Medium] ixgbevf_hv_read_links_e610() (vf.c:923-927) refuses to read
offset 0x209 unless CONFIG_PCI_MMCONFIG is set, and the commit…
- [Medium] ixgbevf_get_link_ksettings() (ethtool.c:91) treats a device as
a Hyper-V E610 VF based only on `adapter->pdev->subsystem_device ==…
- [Medium] The patch adds a second writer of adapter->link_speed and
adapter->link_up.
- [Low] The commit message says that, to avoid transactions on every
watchdog cycle, the driver reads the PCI config register on demand…
--
ixgbevf: fix link speed reporting for Hyper-V E610 VFs
This commit changes ixgbevf_hv_check_mac_link_vf() so that E610 VFs read
link status from emulated PCI config space at offset 0x209 instead of the
VFLINKS register. On Hyper-V E610 VFs, ixgbevf_get_link_ksettings() now
forces a fresh link check, and the config space read is gated on
CONFIG_PCI_MMCONFIG.
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
> index 537a60d5276f0..5d0fb4f4d9a33 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
> @@ -83,6 +83,18 @@ static int ixgbevf_get_link_ksettings(struct net_device *netdev,
> struct ethtool_link_ksettings *cmd)
> {
> struct ixgbevf_adapter *adapter = netdev_priv(netdev);
> + struct ixgbe_hw *hw = &adapter->hw;
> +
> + /* Hyper-V E610 VFs: read current link speed from PCI config space
> + * on every link speed query.
> + */
> + if (adapter->pdev->subsystem_device == IXGBE_SUBDEV_ID_E610_VF_HV) {
[Severity: Medium]
Should this check also match the device ID? Another option is
hw->mac.type == ixgbe_mac_e610_vf, which is the check vf.c uses.
At probe time the HV board is identified by the device ID and the
subsystem ID together, in ixgbevf_pci_tbl[]:
PCI_VDEVICE_SUB(INTEL, IXGBE_DEV_ID_E610_VF,
PCI_ANY_ID, IXGBE_SUBDEV_ID_E610_VF_HV),
.driver_data = board_e610_vf_hv,
Take a native 82599/X540/X550 VF whose subsystem ID is 0x00FF. This
block forces get_link_status = true and then runs
ixgbevf_check_mac_link_vf(). If no PF message is pending, mbx->ops.read()
fails there:
if (mbx->ops.read(hw, &in_msg, 1)) {
if (adapter->pf_features & IXGBEVF_PF_SUP_ESX_MBX)
mac->get_link_status = false;
goto out;
}
get_link_status then stays true and link_up comes back false. Could a
read-only ethtool or sysfs speed query drop the carrier until the PF
sends its next mailbox message?
No non-E610 board with subsystem ID 0x00FF exists in the tree today.
> + spin_lock_bh(&adapter->mbx_lock);
> + hw->mac.get_link_status = true;
> + hw->mac.ops.check_link(hw, &adapter->link_speed,
> + &adapter->link_up, false);
> + spin_unlock_bh(&adapter->mbx_lock);
[Severity: Medium]
Can this race with the watchdog writing adapter->link_speed and
adapter->link_up back?
ixgbevf_watchdog_update_link() copies both fields before it takes
mbx_lock and writes them back after it releases the lock:
u32 link_speed = adapter->link_speed;
bool link_up = adapter->link_up;
...
spin_lock_bh(&adapter->mbx_lock);
err = hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
spin_unlock_bh(&adapter->mbx_lock);
...
adapter->link_up = link_up;
adapter->link_speed = link_speed;
ixgbevf_watchdog_link_is_down() also writes adapter->link_speed = 0
without the lock.
One possible interleaving:
service task ethtool
link_speed = 10G (copy)
check_link(), get_link_status
is false, keeps 10G
check_link() reads 1G from 0x209
into adapter->link_speed,
get_link_status = false
adapter->link_speed = 10G
get_link_status is now false, so later watchdog cycles don't re-read the
register. The stale 10G stays until the next ethtool query.
In the same way, the watchdog could write back a stale link_up = true
after ethtool saw link down. ixgbevf_watchdog_subtask() would then keep
the carrier on for an extra cycle.
The fields are read again below, after spin_unlock_bh(), without the
lock. Could ethtool report link_up and link_speed from two different
updates?
> diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
> index f6df86d124b9e..a84b62641e9bc 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/vf.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
[ ... ]
> @@ -901,6 +904,40 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
[ ... ]
> +static s32 ixgbevf_hv_read_links_e610(struct ixgbe_hw *hw, u32 *links_reg)
> +{
> + struct ixgbevf_adapter *adapter = hw->back;
> + u8 data[IXGBE_HV_LINK_STATUS_SIZE];
> +
> + if (!IS_ENABLED(CONFIG_PCI_MMCONFIG)) {
> + dev_err_once(&adapter->pdev->dev,
> + "cannot read link status, PCI_MMCONFIG is required for Hyper-V\n");
> + return -EOPNOTSUPP;
> + }
[Severity: Medium]
Is CONFIG_PCI_MMCONFIG actually needed for this read? The commit message
says:
Guard the PCI config space read with IS_ENABLED(CONFIG_PCI_MMCONFIG),
since accessing offsets above 256 requires MMCONFIG support.
A Hyper-V VF sits on the pci-hyperv bus. Its config accessor,
_hv_pcifront_read_config(), serves the whole 4K config page through the
vPCI window or through hypercalls:
} else if (where + size <= CFG_PAGE_SIZE) {
spin_lock_irqsave(&hbus->config_lock, flags);
if (hbus->use_calls) {
...
PCI_MMCONFIG is x86-only and optional on X86_64. PCI_HYPERV also
supports ARM64.
On arm64 Hyper-V guests, and on x86_64 guests built with
PCI_MMCONFIG=n, this function always returns -EOPNOTSUPP. As a result,
ixgbevf_hv_check_mac_link_vf() reports *link_up = false on every
watchdog cycle.
Before this patch the link-up bit came from VFLINKS, so the carrier came
up in those configurations. Does this leave the VF link down permanently
there? netvsc only sends through the VF when netif_carrier_ok(vf_netdev)
is true, so TX through the VF would be lost.
The same guard already exists in ixgbevf_hv_reset_hw_vf(), so those
builds already lack the host-provided MAC address. Before this patch,
though, the link still came up.
[ ... ]
> @@ -926,8 +964,16 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
> if (!mac->get_link_status)
> goto out;
>
> - /* if link status is down no point in checking to see if pf is up */
> - links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
> + if (mac->type == ixgbe_mac_e610_vf) {
> + if (ixgbevf_hv_read_links_e610(hw, &links_reg)) {
> + *link_up = false;
> + *speed = IXGBE_LINK_SPEED_UNKNOWN;
> + return 0;
> + }
> + } else {
> + links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
> + }
> +
> if (!(links_reg & IXGBE_LINKS_UP))
> goto out;
[Severity: Medium]
The commit message says VFLINKS "does not carry valid link speed". That
suggests the VFLINKS link-up bit is still valid. Is it intended that
link-up detection for E610 also moves to offset 0x209, with no fallback
to VFLINKS?
Suppose a Hyper-V host doesn't provide link status at 0x209, for
example because reads there return 0. IXGBE_LINKS_UP is then never set,
get_link_status stays true, and the VF never gets carrier.
The patch has a Fixes: tag. Could it be backported to guests running on
hosts that don't provide this interface?
[Severity: Low]
The commit message says:
To avoid generating unnecessary VMBus transactions on every watchdog
cycle, read the PCI config register on demand when ethtool or sysfs
queries link speed, rather than polling it periodically.
Does this match the code? ixgbevf_watchdog_update_link() calls
check_link() on every service cycle. Whenever get_link_status is true,
this path does four pci_read_config_byte() calls per cycle. That covers
link down, after ixgbevf_up(), after the mailbox interrupt, after a
detected reset, and after a failed config read.
Only the steady link-up state avoids the periodic reads. Could the
commit message describe this more precisely?
[ ... ]
> @@ -956,6 +1005,9 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
> case IXGBE_LINKS_SPEED_100_82599:
> *speed = IXGBE_LINK_SPEED_100_FULL;
> break;
[Severity: High]
The commit message says offset 0x209 uses the VFLINKS register format.
If so, should this switch also check IXGBE_LINKS_SPEED_NON_STD for E610?
The PF driver decodes the same layout in ixgbe_check_mac_link_generic():
case IXGBE_LINKS_SPEED_10G_82599:
if ((hw->mac.type >= ixgbe_mac_X550) &&
(links_reg & IXGBE_LINKS_SPEED_NON_STD))
*speed = IXGBE_LINK_SPEED_2_5GB_FULL;
else
*speed = IXGBE_LINK_SPEED_10GB_FULL;
break;
...
case IXGBE_LINKS_SPEED_100_82599:
if ((hw->mac.type >= ixgbe_mac_X550 ||
hw->mac.type == ixgbe_mac_e610) &&
(links_reg & IXGBE_LINKS_SPEED_NON_STD))
*speed = IXGBE_LINK_SPEED_5GB_FULL;
else
*speed = IXGBE_LINK_SPEED_100_FULL;
break;
The ixgbevf defines.h has no NON_STD mask and no 2.5G or 5G link speed
constants. ixgbevf_get_link_ksettings() only maps 10G, 1G and 100M.
E610 supports 2.5G and 5G. Would a Hyper-V E610 VF linked at 2.5G show
10000 Mb/s, and one linked at 5G show 100 Mb/s?
That looks like the same "stale or incorrect link speed" the commit
message says this patch fixes.
> + default:
> + *speed = IXGBE_LINK_SPEED_UNKNOWN;
> + break;
> }
[Severity: Medium]
After this default case, the code below still sets
mac->get_link_status = false. The caller therefore sees link up with
*speed == IXGBE_LINK_SPEED_UNKNOWN.
ixgbevf_get_link_ksettings() has no case for that value:
if (adapter->link_up) {
__u32 speed = SPEED_10000;
switch (adapter->link_speed) {
...
Wouldn't ethtool and sysfs then report 10000 Mb/s full duplex?
ixgbevf_watchdog_link_is_up() prints "unknown speed" for the same value.
Speed bits 00 are the LINKS encoding for 10M on newer parts
(IXGBE_LINKS_SPEED_10_X550EM_A in the PF driver). E610 supports 10M, so
an E610 HV VF on a 10M link could hit this.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120220022.3133664-1-anthony.l.nguyen%40intel.com
next prev parent reply other threads:[~2026-11-24 22:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
2026-11-24 22:00 ` netdev-bot+sashiko
2026-11-20 22:00 ` [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry Tony Nguyen
2026-11-24 22:00 ` netdev-bot+sashiko
2026-11-20 22:00 ` [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs Tony Nguyen
2026-11-24 22:00 ` netdev-bot+sashiko [this message]
2026-11-20 22:00 ` [PATCH net 4/4] net: fm10k: shut down the service timer during removal Tony Nguyen
2026-11-24 22:01 ` netdev-bot+sashiko
2026-11-20 22:03 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) netdev-bot+sinfo
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=179555765941.3135.17127854838678149583@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=marcin.szycik@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rafal.romanowski@intel.com \
--cc=ripatel@wii.dev \
--cc=runyu.xiao@seu.edu.cn \
--cc=tomasz.lichwala@linux.intel.com \
--cc=xiaolinkui@126.com \
--cc=xiaolinkui@kylinos.cn \
/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