From nobody Sat Aug 8 16:06:57 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 4hHQrR3MCQz6nsgM for ; Sat, 08 Aug 2026 16:07:03 +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 4hHQrR1VtKz3rqG for ; Sat, 08 Aug 2026 16:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786205223; 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=qzkEVOtVDJ1NquQtJZMlKq2hpe3REs4h1N2GH+XVuao=; b=ADSc4lDcuwfANpElJy7WQtzmk4381/EYe03iJAt8FT1Pv/Z9ayG61Bo9YK1sKlUhSxBND6 xLO8HqyyDpoppO208yoBsqvrvcnji8H2K2D8l/OBRa3yT+QTspId2fe2LOVKrkvp1rYluO RJcIgm/iZ9eV+wpPsyepmym2HVAE6/vKIioFOBxX+ltnhPC82Q6YVznSvNMSRajnykVTN8 /ptHaOvGyFQ96tel/ownWROR2n4ow6LpHje8ZsJgIMm6ln/XkyhFi8ro08r6WB1+uGdyg7 Gt4xQoTusZ+ClAwWuUfeiZ47S9Z2ryWGdK8IyG2DnxJpdTcZq0/+60sMKEgPaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786205223; a=rsa-sha256; cv=none; b=vaC4388q0S3mzsMb3AtOZJWboa1dBu74fCGJ0AluYHGOVhPcRzrd5w07PXAEzg5LtCgPBw U9RQ7eg3M0ErUxTH4+dNdcXiNkp3+NPmV/Hx+FxZ72eYncYq+qjOPQZAf5NdUWyXrWSchO a2/WW3/3e5HhHvLP23umpLDGLRyRIxkuChH1wXnYcKHkeNCzJBD2esqBGLBjt/iE/uH9rS kVivLDYONHLwkwyVRCbY4bTy07lSZXACCWWlN0CG8fYTCFuW7R8ItIfIouITYnAjhHY57G w3ZAEbjwcbFjAICOhfhaq4xq6aIguihHyTAOJ+sjMwJ4BgmV+dSYrVfEnfGTfA== 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=1786205223; 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=qzkEVOtVDJ1NquQtJZMlKq2hpe3REs4h1N2GH+XVuao=; b=Ho6VXyovX1NuHjn/FuGTGX0EPBX4yfb9CMDJVlet6Gt5dWqjuSRHhx1yFugxUCAbDoqzLg Ps89kIWHXRJpLsCkkSk4qrqxtyynK//6vZ+agTxb8PFEnxUkGlXL2j8WpDlr9hbq7f4BW8 dTaIkkGXOTRj1HKh8DgN+pxR7fiMlNLFnagsAiZ0QHOx7jbBY1u4m2+7BATNTgXMzdUpD0 xhgxVtTmTLUE3HmbMjOK3zY8LR/i6/dJ2zdom5H3SswhghhpUY5enMad9ZUYOMJoJpfnDL KGHo5ztcdI9EVQoXrvKmQQ1+xbjCrh2GUQ89rGeuEuRpgY/jmV/ZHRrsO/v27Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHQrQ66J6zkLt for ; Sat, 08 Aug 2026 16:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32aa4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 16:06:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 98fad621ed69 - main - ixv: Negotiate VF queue-set limits 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: 98fad621ed697586782e488afdc05252c060fec3 Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 16:06:57 +0000 Message-Id: <6a775421.32aa4.7be759d1@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=98fad621ed697586782e488afdc05252c060fec3 commit 98fad621ed697586782e488afdc05252c060fec3 Author: Kevin Bowling AuthorDate: 2026-08-08 10:44:36 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 16:06:37 +0000 ixv: Negotiate VF queue-set limits ixv uses one queue set on 82599 and X540 VFs and assumes two on X550-family VFs. The PF reports the queues assigned to each VF with GET_QUEUES after mailbox API 1.1 negotiation. Query the PF during attach. Bound symmetric iflib queue sets by the PF grant and available MSI-X data vectors. Retain one queue set per data vector: ixgbe VFs expose at most three vectors and one is reserved for the mailbox. The hardware permits each pool to use a subset of its RSS queues, so a two-queue ceiling is valid when the PF assigns four. This enables the second data vector on 82599 and X540 while avoiding an assumed second queue when an X550-family VF is granted only one. Keep the existing family limits if the mailbox is unavailable or the PF uses an older API. MFC after: 2 weeks --- sys/dev/ixgbe/if_ixv.c | 70 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index f9e58ecf5877..e8c3606721e2 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -104,6 +104,7 @@ static void ixv_if_init(if_ctx_t); static void ixv_if_local_timer(if_ctx_t, uint16_t); static void ixv_if_stop(if_ctx_t); static int ixv_negotiate_api(struct ixgbe_softc *); +static int ixv_queue_limit(struct ixgbe_softc *, bool); static void ixv_initialize_transmit_units(if_ctx_t); static void ixv_initialize_receive_units(if_ctx_t); @@ -481,15 +482,8 @@ ixv_if_attach_pre(if_ctx_t ctx) /* Most of the iflib initialization... */ iflib_set_mac(ctx, hw->mac.addr); - switch (sc->hw.mac.type) { - case ixgbe_mac_X550_vf: - case ixgbe_mac_X550EM_x_vf: - case ixgbe_mac_X550EM_a_vf: - scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 2; - break; - default: - scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 1; - } + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = + ixv_queue_limit(sc, mailbox_ready); scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] * sizeof(union ixgbe_adv_tx_desc) + sizeof(u32), DBA_ALIGN); @@ -875,6 +869,64 @@ ixv_negotiate_api(struct ixgbe_softc *sc) return (EINVAL); } /* ixv_negotiate_api */ +/************************************************************************ + * ixv_queue_limit + * + * Discover the number of symmetric RSS queue sets available to iflib. + ************************************************************************/ +static int +ixv_queue_limit(struct ixgbe_softc *sc, bool mailbox_ready) +{ + struct ixgbe_hw *hw; + unsigned int default_tc, num_tcs; + int admin_vectors, limit, msix_vectors; + + hw = &sc->hw; + /* Preserve the current family limit as the mailbox fallback. */ + switch (hw->mac.type) { + case ixgbe_mac_82599_vf: + case ixgbe_mac_X540_vf: + limit = 1; + break; + case ixgbe_mac_X550_vf: + case ixgbe_mac_X550EM_x_vf: + case ixgbe_mac_X550EM_a_vf: + limit = 2; + break; + default: + return (1); + } + + /* Replace the fallback with the queue grant reported by the PF. */ + if (mailbox_ready) { + switch (hw->api_version) { + case ixgbe_mbox_api_11: + case ixgbe_mbox_api_12: + case ixgbe_mbox_api_13: + num_tcs = default_tc = 0; + if (ixgbevf_get_queues(hw, &num_tcs, &default_tc) == 0) { + limit = imin(hw->mac.max_tx_queues, + hw->mac.max_rx_queues); + limit = imin(limit, 2); + } + break; + default: + break; + } + } + + /* + * iflib assigns one data vector to each queue set. A VF has at most + * three MSI-X vectors; reserve one of them for the mailbox interrupt. + */ + admin_vectors = iflib_get_sctx(sc->ctx)->isc_admin_intrcnt; + msix_vectors = pci_msix_count(sc->dev); + if (msix_vectors <= admin_vectors) + return (1); + + return (imax(1, imin(limit, msix_vectors - admin_vectors))); +} /* ixv_queue_limit */ + static int ixv_update_xcast_mode(struct ixgbe_softc *sc, int flags) {