From nobody Thu Oct 29 05:06:38 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jFXJZ59xsz6xmtN for ; Thu, 29 Oct 2026 05:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFXJZ2zlYz4hw3 for ; Thu, 29 Oct 2026 05:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793250398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L3BuKUHlgFlRrIlAJHt2GXDbtJFEQe84aWkKA9AGOpA=; b=wXNinra7p7cLm8DoIfKmHntc5J0OP2LgPgCS3twK3gY+//fEXf5U4jeiX7XnrIiT+J4za6 dkElqp0KwFNcqPVhYrcO4tY2eRGzMWIcOYaMVjhgvm+440Z8UCjqN277oVUENNnjjaGjIm VaAkT9nsUQMn4xWwxwq9HhE9kvCoSldUeOxaP8j8ukECKGNlIxuoKLyzVdGf0ILFfmw3D7 V6u062Q4/Mn7N/2tPukA2t4KGug8YU7k+7wFaiyaFWcPi3FchZYGZDbDUu23NfUkBdkYtB jsIBsPvD5I3YXf/h5wEqpnvlr3kL2hO+dBocwbAO4Zp7mwnT05HvmOfblj/Hnw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793250398; b=bBNDzEE5Xc/6UkOVHcBSFkPUnV9/0+t6vvHHq0/w/HbTqCDXf35QpmLo1RQyB56e3mE56z XF9S2K8L5k+5w/l0aLcLlw8YvSXx+3WEGpP5Six0v+SJaByjp9d03zFKlAfV8rLOW7BhxB WU0hoF0lMLAEdIXZrt2fkQV7ExYY+dCi4g1Cclnj9RfHwh5tRyfg/cqlh+TKkGY9fNuaCE kwSQxPAq9ma9eahkogFAB7OZnBD4x1SWppqADAHUu/VWPM0jSVw9h5AVQ9DaVDnimCA/sQ k35fJTa2SVs3ey00kJ6U4vtkIc9SL9xJfAPT7RzUqlVsD0zVjrhCnEPpYFopmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793250398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L3BuKUHlgFlRrIlAJHt2GXDbtJFEQe84aWkKA9AGOpA=; b=g0msGW2hFMyGP4WIiwd6pdUnvAwNW7HU9MMeTaTplEva9QV1GdVhs6cQfu+2/8R2qZMNbf 8a6W0h4nAzGbjpv2fXmOavrs6Df1rFKdt4QGE4skPHgVbPT/wVvOKRYmXi4EpEYNIa0z8o nkjHuFScXBemcuYGo2s2pZUhv+v5btoYF5caV+90Q3qJkxL87iDsngk3Ck9GiYlgQICURF Ry9JTTPM1FsKp3HKaxrhJHov0kPVHzJFR+TxnxU/2pGDtVxqUNXKKb4E2YPMuTEi8qxGJ5 OrzFXXFuz+8p+a7OICqbzWneiwKOPAqQ9SaXOWNXDRwAnQjFTyEHhNQaEnkUyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFXJZ2bkCzPCL for ; Thu, 29 Oct 2026 05:06:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33a04 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 05:06:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: cc0a1727539a - stable/15 - ixv: Use host granted RSS queues on Hyper-V List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cc0a1727539a9000a5223ba81dac3872cba592bc Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 05:06:38 +0000 Message-Id: <6ae2d45e.33a04.640b2afc@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=cc0a1727539a9000a5223ba81dac3872cba592bc commit cc0a1727539a9000a5223ba81dac3872cba592bc Author: Kevin Bowling AuthorDate: 2026-09-15 05:57:18 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 05:06:28 +0000 ixv: Use host granted RSS queues on Hyper-V Discover the Hyper-V queue grant through PCI configuration space for X550, X552, X553, and E610 VFs. The X550 family exposes a byte at 0x207; 0x208 is a separate DCB flag. E610 exposes a little-endian queue count word at those offsets. Accept grants of one, two, or four and use at most two symmetric queue sets, subject to the existing MSI-X resource limit. Keep one queue for invalid grants and for 82599/X540 Hyper-V VFs. The family gates and queue limits are snooped from Windows Intel VF bus traffic. Update the shared code queue max so stop disables every usable queue. Also program the receive length limit on every usable RX queue instead of only queue zero and retain the 82599 exception for that register field. Sponsored by: BBOX.io (cherry picked from commit a54f83544eea2a9804ac7940d35b26ffcb34dfb3) --- share/man/man4/ixv.4 | 15 ++++++++++++- sys/dev/ixgbe/if_ixv.c | 2 +- sys/dev/ixgbe/ixgbe_hv_vf.c | 54 ++++++++++++++++++++++++++++++++++++++++----- sys/dev/ixgbe/ixgbe_hv_vf.h | 1 + 4 files changed, 64 insertions(+), 8 deletions(-) diff --git a/share/man/man4/ixv.4 b/share/man/man4/ixv.4 index f49d3eb88aeb..55c64f501ca1 100644 --- a/share/man/man4/ixv.4 +++ b/share/man/man4/ixv.4 @@ -73,7 +73,20 @@ rejected by physical-function policy. .Pp On Hyper-V, the host provides reset and assigned-address information through PCI configuration space instead of the Intel PF/VF mailbox. -The driver uses one queue pair in this environment. +The driver uses up to two queue pairs on X550, X552, X553, and E610 +when the host advertises multiple queues through PCI configuration space +and sufficient MSI-X vectors are available. +Otherwise, it uses one queue pair. +To request two queue pairs, run the following from an elevated PowerShell +prompt on the Hyper-V host, substituting the VM and network adapter names: +.Bd -literal -offset indent +Set-VMNetworkAdapter -VMName "vm-name" -Name "adapter-name" ` + -IovQueuePairsRequested 2 +.Ed +.Pp +Changing this setting can detach and reattach the VF, so configure it before +starting the guest when possible. +.Pp MAC address, VLAN, multicast filter, and receive mode policies remain under host control. On E610, when the host does not support the PCI link-status query, diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index ceae144034b7..166a480dd560 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1112,7 +1112,7 @@ ixv_queue_limit(struct ixgbe_softc *sc, bool mailbox_ready) hw = &sc->hw; if (ixv_is_hyperv(hw)) { - limit = 1; + limit = ixgbevf_hv_get_queues(hw); } else { /* Preserve the current family limit as the mailbox fallback. */ switch (hw->mac.type) { diff --git a/sys/dev/ixgbe/ixgbe_hv_vf.c b/sys/dev/ixgbe/ixgbe_hv_vf.c index b65a2438adee..384db6a7e1c8 100644 --- a/sys/dev/ixgbe/ixgbe_hv_vf.c +++ b/sys/dev/ixgbe/ixgbe_hv_vf.c @@ -9,10 +9,50 @@ /* Reading these PCI configuration bytes resets a VF on Hyper-V. */ #define IXGBE_HV_RESET_OFFSET 0x201 +/* Hyper-V emulates the VF queue limit in PCI configuration space. */ +#define IXGBE_HV_QUEUE_COUNT_OFFSET 0x207 + /* E610 exposes VFLINKS in four emulated PCI configuration bytes. */ #define IXGBE_HV_LINK_STATUS_OFFSET 0x209 #define IXGBE_HV_LINK_STATUS_SIZE 4 +/** + * ixgbevf_hv_get_queues - Discover supported Hyper-V RSS queues at attach + * @hw: pointer to hardware structure + */ +u32 +ixgbevf_hv_get_queues(struct ixgbe_hw *hw) +{ + u32 grant, queues = 1; + + switch (hw->mac.type) { + case ixgbe_mac_X550_vf: + case ixgbe_mac_X550EM_x_vf: + case ixgbe_mac_X550EM_a_vf: + /* 0x208 is a separate DCB flag on these PFs, not count bits. */ + grant = IXGBE_READ_PCIE_BYTE(hw, IXGBE_HV_QUEUE_COUNT_OFFSET); + break; + case ixgbe_mac_E610_vf: + /* E610 reports the assigned count as a little-endian word. */ + grant = IXGBE_READ_PCIE_BYTE(hw, IXGBE_HV_QUEUE_COUNT_OFFSET); + grant |= (u32)IXGBE_READ_PCIE_BYTE(hw, + IXGBE_HV_QUEUE_COUNT_OFFSET + 1) << NBBY; + break; + default: + /* Older PFs do not provide VF-owned RSS on Hyper-V. */ + grant = 1; + break; + } + /* Valid limits are 1, 2 and 4; use at most two symmetric RSS queues. */ + if (grant == 2 || grant == 4) + queues = 2; + + /* Shared stop must disable every queue that iflib can initialize. */ + hw->mac.max_tx_queues = queues; + hw->mac.max_rx_queues = queues; + return (queues); +} + /** * ixgbevf_hv_update_mc_addr_list_vf - Hyper-V variant - just a stub. * @hw: unused @@ -234,17 +274,19 @@ ixgbevf_hv_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state) static s32 ixgbevf_hv_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size) { - u32 reg; + u32 i, reg; /* RLPML is not implemented by the 82599 VF. */ if (hw->mac.type == ixgbe_mac_82599_vf) return (IXGBE_SUCCESS); - reg = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(0)); - reg &= ~IXGBE_RXDCTL_RLPMLMASK; - reg |= ((max_size + 4) & IXGBE_RXDCTL_RLPMLMASK) | - IXGBE_RXDCTL_RLPML_EN; - IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(0), reg); + for (i = 0; i < hw->mac.max_rx_queues; i++) { + reg = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); + reg &= ~IXGBE_RXDCTL_RLPMLMASK; + reg |= ((max_size + 4) & IXGBE_RXDCTL_RLPMLMASK) | + IXGBE_RXDCTL_RLPML_EN; + IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), reg); + } return (IXGBE_SUCCESS); } diff --git a/sys/dev/ixgbe/ixgbe_hv_vf.h b/sys/dev/ixgbe/ixgbe_hv_vf.h index dd2e1eee4e9c..0d5ef863c657 100644 --- a/sys/dev/ixgbe/ixgbe_hv_vf.h +++ b/sys/dev/ixgbe/ixgbe_hv_vf.h @@ -8,5 +8,6 @@ #include "ixgbe_type.h" s32 ixgbevf_hv_init_ops_vf(struct ixgbe_hw *hw); +u32 ixgbevf_hv_get_queues(struct ixgbe_hw *hw); #endif /* _IXGBE_HV_VF_H_ */