From nobody Thu Jul 30 00:42:55 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 4h9VmH5LqVz6n9JM for ; Thu, 30 Jul 2026 00:42:55 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h9VmH4Z5Vz3wbt for ; Thu, 30 Jul 2026 00:42:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785372175; 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=vCgxlus+VATMgZdR7Ku2GC4osVf84j4CdKtbAd16gpE=; b=AGzWVwkRBXE7swM06X/Rowt50bzf6S7bpFBbA2PDFplokHJzWt6KQ+/0dZomh1vskOMJFA UB6PKllB5xi6CmrCPR9sfO7y90peszGRhRS9bLEKQg4JzFW4cZ5dxvtPU/+WFqGbckQBAT Pz7P+gTCQjHIRIAIjSiFxXZZXHMbDtQ3E54J4fQu5qq0KhhW43OwYzVcQWADtulNhgHY8j RmTmqTU2CD7KOYd/fE+iCMrB+g50XGLBNJG/+jZy5xDlBEL7zwn5QU22TfBmm37U43ybIl BMQsZK8r3ggbU3EWKQzTd68sgzdFE8Ld47z4BBslu0dOJa6Ooouftg4aZmKwzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785372175; a=rsa-sha256; cv=none; b=V3tqUwPf8NHxl/MG9ZdnyRWCrqkZpLbSoaPk6sFwjDJqlIpVv7zyxyPM9o08cs0gjdDTEr BNoTKfkSxPEjjhcUxcDxxr4+B7TqbEFUNfn874Lg7A9C2WxKxFLbevK59zw2pFh5txsgiZ +0DZgAbmoEF76GHlr4o/61FBw+V07Z6whPV08u+Zd4ClQdi4mEvSE8kZrpXgNJzjeHmKzb DxgzvhdXnp5aog9irQA6/auBUkJlrsHdYLpdsfRlxnqSxQejdI5K/J7fJBh0u76GHjuPkd QwGJGSAy3h0kQ5w65bgzNCZj9sQicR9YHGUsArnx5/QIoifm0cjLDDJ1B+xpBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785372175; 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=vCgxlus+VATMgZdR7Ku2GC4osVf84j4CdKtbAd16gpE=; b=THceLZ8gtXWcCRfWZbEE6wogXjBV7ApU8XnLQ94iZxpNZ7mWU6bnpJTJ8KjRg5Ia4aBG7f /VNHUSgMcPK007O2X5i55vSfzX0iyTZV+sQtAD536jpOMxjaUgVxpAIS/DNiIq4aUW0pzh /GnPh0kLk8Hei7pUb18I/kaFYc/WwmuO+ttvKco9l03uOYHew5RwUTsDPCw7CfSJokaZbf 4tdGmFW4iWoqbQXGpS6xwrGTKVz0Ai6AWSVVyjmQk3jickRbvdUTCeKi7excAMSr2F9Ax3 cgOhEHYBSr5aBm/Kb1vdv7UljB5HvE89jAhyYUuMeKNi0p2Hw7OAtBBMS62w3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9VmH3Vqdzqtt for ; Thu, 30 Jul 2026 00:42:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3eb70 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Jul 2026 00:42:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e795a31cb4d6 - main - pci_iov: Permit non-ARI VFs on a secondary bus 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: e795a31cb4d66368bdbe5ac7f61c0899d3ed39f8 Auto-Submitted: auto-generated Date: Thu, 30 Jul 2026 00:42:55 +0000 Message-Id: <6a6a9e0f.3eb70.7707f60a@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e795a31cb4d66368bdbe5ac7f61c0899d3ed39f8 commit e795a31cb4d66368bdbe5ac7f61c0899d3ed39f8 Author: Kevin Bowling AuthorDate: 2026-07-28 23:29:35 +0000 Commit: Kevin Bowling CommitDate: 2026-07-30 00:40:05 +0000 pci_iov: Permit non-ARI VFs on a secondary bus A non-zero VF device number does not always require ARI. The Intel 82576 and I350 [1] explicitly support a non-ARI layout that places VFs on the next bus. Check every requested VF RID and reject a non-zero device only when it is on the PF bus. This retains the ARI guard for invalid same-bus layouts while permitting the documented second-bus layout. [1] Intel I350 Datasheet, sections 7.8.2.6.1.2, 9.6.4.6 Sponsored by: BBOX.io --- sys/dev/pci/pci_iov.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 0e6104fe37f2..932d83536b7f 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -759,9 +759,24 @@ pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg) } } - if (!ari_enabled && PCI_RID2SLOT(last_rid) != 0) { - error = ENOSPC; - goto out; + if (!ari_enabled) { + uint16_t vf_rid; + + /* + * Without ARI, VFs on the PF's bus must use device 0. + * VFs on another bus use the conventional device/function + * encoding and may have a non-zero device number. For + * example, Intel 82576 and I350 VFs start at device 16 on + * the next bus when ARI is unavailable. + */ + vf_rid = first_rid; + for (i = 0; i < num_vfs; i++, vf_rid += rid_stride) { + if (PCI_RID2BUS(vf_rid) == pci_get_bus(dev) && + PCI_RID2SLOT(vf_rid) != 0) { + error = ENOSPC; + goto out; + } + } } iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2);