From nobody Tue Sep 15 06:10:40 2026 X-Original-To: dev-commits-src-all@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 4hkWpt0mnXz6sfG8 for ; Tue, 15 Sep 2026 06:10:46 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hkWpt0Jbrz4D7r for ; Tue, 15 Sep 2026 06:10:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789452646; 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=fIdGfCmImXexqQsfsUW/l2AzbINAmBMG9EGJ3LVukMM=; b=ML3UDHrkODCUZs7RHo2/n/tRULZoVj0916sypDtpy8Qmsg/SwMgnGpemJTBd2ZMfhQZzIs +3QMzIfqMp8utjWV4tXGAU8mtGtospp2JIJHlWYRP9860lTTxbSvEMjD21BvhB3tY3eJmY HugA0xd4Qn4V3wavEuhJDUbYYzUKB+ZCqilEoJfE0P7grhl2LJBMNQqxORCYV9p0ls2KXt ZFDHtFuIRJCu74SffkgIpm++aMFEG6JyFSYVcUPNB3yv2tbpekhF9xQC2YKs2qpH7hS8ST WTSTrRkxHzt3lxsjoVfhWlEIxu6XrFVDxpe6XBrZKNABJ6XE32rWaCfNkYP0jQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789452646; b=CE1MXJjNP5xI8ROSDJAGpGFBl/NUSr8IW5zu+2T6UXz6ICPI3kjrG+J0hpj8uQlDcPqUcg d+CSnAjQsvvD0NxfMwXl98kKrshVY1kg/gHUwXaPi5pjJ56iRWV9wjdT0pRmuwVprmiQmd JBV6kcIuX61tSrJtWCYLmJm1Gz6ULVLm4xzaiFyQCvbjmiecZzaA1uyWL5x1nkAqwp0PAJ Y7p5P5EInhvt8yWvJkWD/gSitQfiF5m6utWoB1m56Yqr5bGjF/w6R9ac/A5wnlVKYmzp5g PdF5x2fPKNpcPhrIynAzYSCs4BpTRUDnA0FLkEoL8nR8VE1t30dBYy4ZZ7N+IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789452646; 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=fIdGfCmImXexqQsfsUW/l2AzbINAmBMG9EGJ3LVukMM=; b=YjCIOKW4cscpoYbqR47iWzmNw+RyijIRzATT/FK6VjnrvagBl8AMmDggGX/A0J9UKMwxXb ZXC+0vH1xVs+9V4+qZMzAmDgw8DgV7M0ohPv0gMbRg06yssJ1iOKz2xaUy4OO9k6RJsJIZ LwdOHRYwWxfW9mcjUO2o7lmrJSgAq7LKC4tN6hkU/h4Zu7ZTV6pNNEa62VT0Ar16l1hG12 VxpsbAbxHsvRUHhV5IqxS+nXk8uAlizUHgfhyPy6Spmv8GRv/UFFICPyefMHHMjcPpdM+p 3QfsZ8cv79pSZFCb0Nv9XOj5zMeLzXCo8mZ+Gluj7JsI/7syGKadNi1XCCztCg== 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 4hkWps6WH7zp4r for ; Tue, 15 Sep 2026 06:10:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20625 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 15 Sep 2026 06:10:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a54f83544eea - main - ixv: Use host granted RSS queues on Hyper-V List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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/main X-Git-Reftype: branch X-Git-Commit: a54f83544eea2a9804ac7940d35b26ffcb34dfb3 Auto-Submitted: auto-generated Date: Tue, 15 Sep 2026 06:10:40 +0000 Message-Id: <6aa8e160.20625.7fad33ad@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a54f83544eea2a9804ac7940d35b26ffcb34dfb3 commit a54f83544eea2a9804ac7940d35b26ffcb34dfb3 Author: Kevin Bowling AuthorDate: 2026-09-15 05:57:18 +0000 Commit: Kevin Bowling CommitDate: 2026-09-15 06:09:57 +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. MFC after: 2 weeks Sponsored by: BBOX.io --- 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 c3d56e2ae913..62e92be75197 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_ */