From nobody Sun Sep 06 14:01:02 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 4hdBgg03Fzz6r8tt for ; Sun, 06 Sep 2026 14:01: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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hdBgf6FBLz3vsF for ; Sun, 06 Sep 2026 14:01:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788703262; 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=+HGxxy+/TIVMLUbKMAQpFFXJSFU6iOQamfzPoQnVB2c=; b=n2cj1/9S+rLF2RmY128D+h9X4NdGHGEXu/m+ZsNh9aKc2gjj3Nx0Fnl2dg3u+sqLtD37KW t7zgzN5v2x2t4SaGKWbwjoDp5C1B1ZErkirpk/+f0gqBvd4JYh65qZVjlt61H3knqxJyF+ tvevAnYr0wTt0cNzrK5LUR2EfnvmOsmj2UFO23tAQhNEAiqYO888Rxbbpui1ERAO3Ho5gF HjajbZAO4o66rcSHi4IQixPDqxYJZRh0bn7L7nWjToyMbWq1HULfbDgsvFAFMq8aXyzGQd pTqmRlmQSlTfTXgtQZXR8VuGYew7N6B7nNfYc4Ia8BkzGWSxd7nc+0VPjilihA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788703262; a=rsa-sha256; cv=none; b=Lq1atctdKJY1tVr8cLLhIXKXEVonxTRxG7HdGD2Muw2OndNwnDyeQMI2l0zAzjtPkWEMi8 qnHeQXsky/khuK0nr/bau//lPBfocU8e9ofOf9KGWuBKyB9OrATJUv2nOgeVUixJfyIPTd rKHJ40VpG3XqRL9OEexTpONQa+nqDA35gCDWW1tEVl5mZonLNMTUzpibqEg/GGIOKAbU8M iKqdijAQlEURXn+VC+Tn3GjFKEPiUesaGA7PKRRE8z0y6S4KO7iLPqpYPGrNXN1QEWQ2kw 3s6Yksr0W6SSC7xI6bHTOXeUNAX5tYBFYn/qVCUPSSuYjCND6EofWcUI+hm/Jg== 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=1788703262; 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=+HGxxy+/TIVMLUbKMAQpFFXJSFU6iOQamfzPoQnVB2c=; b=Bqqap/oSSnRwGeNIIiT4HJSVUgEj1yzNIqDTk+a1nfV8QLci4JL1eLAqYNZo2PvWvwf2dt cjraugf44X1PPIqMCVX/tdm4EZBrx0N3zL/GDqPdAmO4PlDNIVXZ/M49yjCbGOKgZtnr+I vaYKlgLhFikhhXEDPvNfN7GuvRYsNYVtTvMgm3CwJUriVl+e4iCljUcnfMKMh0OuixVOZn U0SyJCV91WNe/DjprfPjnLsFQz0cNOa9U2hqJanAMwAWeRA/EBTBe4tuw38tVYN1VgNA4n rZoJy4IGwwIn0LEg+27FN25AS2UdEbWq/0oyclDav7EeuQN6e7DP/f9A6Qbu8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hdBgf5H8BzZZV for ; Sun, 06 Sep 2026 14:01:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38059 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 06 Sep 2026 14:01:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 8d14fc8ba7f5 - main - igb: Report SR-IOV VF status 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: 8d14fc8ba7f55c873e866f392c17113d514acce9 Auto-Submitted: auto-generated Date: Sun, 06 Sep 2026 14:01:02 +0000 Message-Id: <6a9d721e.38059.109a0905@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=8d14fc8ba7f55c873e866f392c17113d514acce9 commit 8d14fc8ba7f55c873e866f392c17113d514acce9 Author: Kevin Bowling AuthorDate: 2026-08-10 22:29:37 +0000 Commit: Kevin Bowling CommitDate: 2026-09-06 14:00:17 +0000 igb: Report SR-IOV VF status Expose cached per-VF configuration through the iflib VF status method. Report mailbox handshake state, MAC address, access or trunk VLAN mode, hardware transmit and receive queue counts, administrator policy, and fault-containment state. The query does not issue mailbox requests or read hardware registers. Sponsored by: BBOX.io --- sys/dev/e1000/if_em.c | 1 + sys/dev/e1000/if_igb_iov.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/if_igb_iov.h | 2 ++ 3 files changed, 70 insertions(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 97040cc49d94..5587920a47b5 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -708,6 +708,7 @@ static device_method_t igb_if_methods[] = { DEVMETHOD(ifdi_iov_init, igb_if_iov_init), DEVMETHOD(ifdi_iov_uninit, igb_if_iov_uninit), DEVMETHOD(ifdi_iov_vf_add, igb_if_iov_vf_add), + DEVMETHOD(ifdi_vf_status, igb_if_vf_status), #endif DEVMETHOD_END }; diff --git a/sys/dev/e1000/if_igb_iov.c b/sys/dev/e1000/if_igb_iov.c index f75ba66d8987..48edf18f02b4 100644 --- a/sys/dev/e1000/if_igb_iov.c +++ b/sys/dev/e1000/if_igb_iov.c @@ -14,6 +14,8 @@ #include #include +#include + #define IGB_IOV_RAH_POOLSEL_SHIFT 18 #define IGB_IOV_RAH_POOLSEL_MASK (0xffU << IGB_IOV_RAH_POOLSEL_SHIFT) #define IGB_IOV_MAX_MAC_FILTERS 3 @@ -1993,6 +1995,71 @@ igb_iov_validate(struct e1000_softc *sc, u16 num_vfs) return (0); } +int +igb_if_vf_status(if_ctx_t ctx, struct if_vf_status **statusp) +{ + struct e1000_softc *sc; + struct igb_vf *vf; + struct if_vf_info *info; + struct if_vf_status *status; + u_int num_queues; + int i; + + sc = iflib_get_softc(ctx); + if (!sc->iov_mbx_retry_initialized) + return (EOPNOTSUPP); + num_queues = sc->hw.mac.type == e1000_82576 ? + IGB_82576_VF_QUEUES : IGB_I350_VF_QUEUES; + status = if_vf_status_alloc(sc->num_vfs); + if (status == NULL) + return (ENOMEM); + for (i = 0; i < sc->num_vfs; i++) { + vf = &sc->vfs[i]; + info = &status->vfs[i]; + info->fields = IFVF_F_CONFIGURED | IFVF_F_INITIALIZED | + IFVF_F_VLAN_MODE | IFVF_F_VLAN_COUNT | + IFVF_F_NUM_TX_QUEUES | IFVF_F_NUM_RX_QUEUES | + IFVF_F_ALLOW_SET_MAC | + IFVF_F_ALLOW_SET_VLAN | IFVF_F_MAC_ANTI_SPOOF | + IFVF_F_ALLOW_PROMISC | IFVF_F_TRAFFIC_ALLOWED | + IFVF_F_FAULT_BLOCKED; + info->index = i; + info->configured = (vf->flags & IGB_VF_ACTIVE) != 0; + info->initialized = sc->iov_hw_active && + (vf->flags & IGB_VF_CTS) != 0; + if (!ETHER_IS_ZERO(vf->mac)) { + memcpy(info->mac, vf->mac, sizeof(info->mac)); + info->fields |= IFVF_F_MAC; + } + if (vf->default_vlan == 0) + info->vlan_mode = IFVF_VLAN_TRUNK; + else { + info->vlan_mode = IFVF_VLAN_ACCESS; + info->vlan = vf->default_vlan; + info->vlan_pcp = 0; + info->vlan_proto = ETHERTYPE_VLAN; + info->fields |= IFVF_F_VLAN | IFVF_F_VLAN_PCP | + IFVF_F_VLAN_PROTO; + } + info->vlan_count = vf->vlan_count; + info->tx_queue_count = num_queues; + info->rx_queue_count = num_queues; + info->allow_set_mac = (vf->flags & IGB_VF_CAP_MAC) != 0; + /* Access VFs cannot manage VLAN membership through the mailbox. */ + info->allow_set_vlan = vf->default_vlan == 0; + info->mac_anti_spoof = + (vf->flags & IGB_VF_MAC_ANTI_SPOOF) != 0; + info->allow_promisc = + (vf->flags & IGB_VF_ALLOW_PROMISC) != 0; + info->fault_blocked = + (vf->flags & IGB_VF_MDD_BLOCKED) != 0; + info->traffic_allowed = info->configured && + !info->fault_blocked; + } + *statusp = status; + return (0); +} + int igb_if_iov_init(if_ctx_t ctx, u16 num_vfs, const nvlist_t *config) { diff --git a/sys/dev/e1000/if_igb_iov.h b/sys/dev/e1000/if_igb_iov.h index 8bd576d47649..fd8053d9417f 100644 --- a/sys/dev/e1000/if_igb_iov.h +++ b/sys/dev/e1000/if_igb_iov.h @@ -24,6 +24,8 @@ int igb_iov_validate(struct e1000_softc *, u16); int igb_if_iov_init(if_ctx_t, u16, const nvlist_t *); void igb_if_iov_uninit(if_ctx_t); int igb_if_iov_vf_add(if_ctx_t, u16, const nvlist_t *); +struct if_vf_status; +int igb_if_vf_status(if_ctx_t, struct if_vf_status **); void igb_iov_initialize(struct e1000_softc *); void igb_iov_handle_mbx(struct e1000_softc *); void igb_iov_handle_mdd(struct e1000_softc *);