From nobody Sat Oct 31 18:58:46 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 4jH6gp6L9Dz6x67L for ; Sat, 31 Oct 2026 18:58: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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jH6gp569Sz3J5p for ; Sat, 31 Oct 2026 18:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793473126; 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=qXJfs9GwFtlW9KpTWC7Tj6kt51r3PJWGo6X5t7iIFDA=; b=bFfvn/MmAuJ0lGT+6C6KHjPl0ck36kpIzLYydioUPTWbXaWfs3kt9pQrITdLmbGyttI9Ak 7KaxlB+V6c4dF24BVNGlpBEPJGcLQmh5vsZGqjGl6VWJqjWy0I57ofszKlJpe4IAJ4Q06y LPeNgneza3o8Ymd67AvZd1n9aq+r8i5TbCNpCKE3liDfwvnSb5TCDnJVIcxf7CnIBzCF1B DkeGO4/vN8q7Tx6A7uzeMNne6LTzCEEfB29twTsa1nAc/1z105RM96r6D/+CqspdeEP5NT oQ2R53lFW2IZuW74ThCn8NAbC4/3EE1TngAZGEzGlKP8yzaQhCdklgyM1HdqsQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793473126; b=E08fbnipbbx0HVLmkQoJhEg6n1EXe5CvtqMe4sy9dv5cudKeS1Fj8J7QEokafm9EqllQe7 WHXEX9yRYD/cco33Oy+655GKsbZ83lYsnFOAmt736sqDIdeT6r1JI+vG1BFT5lKzB7s5gK vCj4sboeqzHhHz+QIk4WcSdGBM0KXcYbfMIxEFDvu+Sw8L5j1w3wizt1AahrOVnMa7zO/P tbSY1Pdrbs2EBE9Cyuz3PbTmzPWLiFUHDd00eKKPbcuk+GnivR40yjFVVPxz3ufd2xR755 YjHB/vYj3uxBGgLTSECWBovlnaDft9jJeJ9pUEbCjKR8nF2WdWYHN+RMzeVCtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793473126; 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=qXJfs9GwFtlW9KpTWC7Tj6kt51r3PJWGo6X5t7iIFDA=; b=vD7uYmFASnueGcaLuWwn/I7hTHY9hASwDOr46czQor0dCiVwLroiQ9zLJif++HWtdOZTQO PAoQ8/2JoTntndaqkV6nW8eIsoEfQkio4Em88Av3jVeduzaiCn4nt2ID0/MdIKKEfQTHOR cpdUm9sxU1dIbN//mpPnS8u1maHb/54L8i8+ljmvBAVzlC2uizXwENzCwRW0dzVAW3U+6E aq6/j8nKq/+ZR6miJbCG57hq3srsA/El6vFoc4hMsBBJxFoNnOvY9bPemG5cUhUtTMzszS u5JD9HKNP1l7CAb/D8C5hWGWUfT+4L9SfEMG064BDoOVKqgpzEm/8klnRDb1oQ== 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 4jH6gp4TPszPCS for ; Sat, 31 Oct 2026 18:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24434 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 31 Oct 2026 18:58:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: cb7d37f1ac1d - stable/15 - ixl: Report SR-IOV VF status List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the 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: cb7d37f1ac1d39080d779db66af3cd1955798837 Auto-Submitted: auto-generated Date: Sat, 31 Oct 2026 18:58:46 +0000 Message-Id: <6ae63a66.24434.7e25d079@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=cb7d37f1ac1d39080d779db66af3cd1955798837 commit cb7d37f1ac1d39080d779db66af3cd1955798837 Author: Kevin Bowling AuthorDate: 2026-08-10 22:29:37 +0000 Commit: Kevin Bowling CommitDate: 2026-10-31 18:57:04 +0000 ixl: Report SR-IOV VF status Expose cached per-VF configuration through the iflib VF status method. Report mailbox initialization and the negotiated virtual-channel API, MAC address, access or trunk VLAN mode, queue resources, administrator policy, PF traffic permission, and fault containment. Expose per-VF malicious-driver isolation and cumulative transmit and receive event counts through a versioned driver.ixl extension. Track successful PCI IOV attachment separately from hardware capability. This lets a successfully attached but unconfigured PF return an empty snapshot without claiming support when PCI IOV registration was unavailable. The query uses driver-cached state and does not issue AdminQ requests or read device registers. On stable/15, place the attachment flag in existing padding and restore the VF handshake-status bit and its reset/resource-reply bookkeeping, which were omitted from earlier MFCs. Existing structure sizes and member offsets are unchanged. Sponsored by: BBOX.io (cherry picked from commit 477e31110ab84b941e95d95d62d8339e822719bc) --- share/man/man4/ixl.4 | 32 ++++++++++++++- sys/dev/ixl/if_ixl.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/ixl/ixl_pf.h | 2 + sys/dev/ixl/ixl_pf_iov.c | 8 +++- 4 files changed, 145 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index b1a4a21c4592..af8327704842 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd August 12, 2026 +.Dd September 6, 2026 .Dt IXL 4 .Os .Sh NAME @@ -293,6 +293,35 @@ minus one. An up to date list of parameters and their defaults can be found by using .Xr iovctl 8 with the -S option. +.Pp +For each configured VF, +.Xr ifconfig 8 +with the +.Fl v +option displays cached PF state, including the negotiated virtual-channel +API after the VF completes its resource handshake following the last reset. +The generic traffic and fault fields describe whether PF policy currently +permits the VF to issue data traffic; they do not describe link or queue +state. +.Pp +Structured status consumers also receive MDD diagnostics in the version 1 +.Cm driver.ixl +namespace of the +.Xr rtnetlink 4 +VF status response: +.Bl -tag -width "mdd-tx-events" +.It Cm version +Namespace version number, currently 1. +.It Cm mdd-blocked +Boolean indicating that malicious-driver detection has isolated the VF. +.It Cm mdd-tx-events +Cumulative number of transmit malicious-driver latches attributed to the VF. +.It Cm mdd-rx-events +Cumulative number of receive malicious-driver latches attributed to the VF. +.El +.Pp +The status query uses driver-cached state and does not issue AdminQ commands +or read device registers. .Sh SUPPORT For general information and support, go to the Intel support website at: @@ -307,6 +336,7 @@ email all the specific information related to the issue to .Xr iflib 4 , .Xr led 4 , .Xr netintro 4 , +.Xr rtnetlink 4 , .Xr vlan 4 , .Xr ifconfig 8 , .Xr iovctl 8 diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 8244f1cd2d05..4e2dc11b333b 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -34,6 +34,8 @@ #include "ixl.h" #include "ixl_pf.h" +#include + #ifdef IXL_IW #include "ixl_iw.h" #include "ixl_iw_int.h" @@ -55,6 +57,20 @@ __XSTRING(IXL_DRIVER_VERSION_MINOR) "." \ __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k" +/* Version 1 driver.ixl extension schema; documented in ixl(4). */ +#define IXL_VF_STATUS_NAMESPACE "driver.ixl" +#define IXL_VF_STATUS_VERSION 1 +#define IXL_VF_STATUS_MDD_BLOCKED "mdd-blocked" +#define IXL_VF_STATUS_MDD_TX_EVENTS "mdd-tx-events" +#define IXL_VF_STATUS_MDD_RX_EVENTS "mdd-rx-events" + +enum ixl_vf_status_field { + IXL_VF_STATUS_FIELD_MDD_BLOCKED, + IXL_VF_STATUS_FIELD_MDD_TX_EVENTS, + IXL_VF_STATUS_FIELD_MDD_RX_EVENTS, + IXL_VF_STATUS_NUM_FIELDS +}; + /********************************************************************* * PCI Device ID Table * @@ -123,6 +139,8 @@ static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); static bool ixl_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static void ixl_if_led_func(if_ctx_t ctx, int onoff); +static int ixl_if_vf_status(if_ctx_t ctx, + struct if_vf_status **statusp); #ifdef PCI_IOV static void ixl_if_vflr_handle(if_ctx_t ctx); #endif @@ -197,6 +215,7 @@ static device_method_t ixl_if_methods[] = { DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), DEVMETHOD(ifdi_needs_restart, ixl_if_needs_restart), DEVMETHOD(ifdi_led_func, ixl_if_led_func), + DEVMETHOD(ifdi_vf_status, ixl_if_vf_status), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixl_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit), @@ -2000,6 +2019,92 @@ ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) } } +static int +ixl_if_vf_status(if_ctx_t ctx, struct if_vf_status **statusp) +{ + struct ixl_pf *pf; + struct if_vf_extension *extension; + struct if_vf_info *info; + struct if_vf_status *status; + struct ixl_vf *vf; + + pf = iflib_get_softc(ctx); + if (!pf->iov_attached) + return (EOPNOTSUPP); + + status = if_vf_status_alloc(pf->num_vfs); + if (status == NULL) + return (ENOMEM); + for (int i = 0; i < pf->num_vfs; i++) { + vf = &pf->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->vf_flags & VF_FLAG_ENABLED) != 0; + info->initialized = (vf->vf_flags & VF_FLAG_INITIALIZED) != 0; + if (info->initialized) { + snprintf(info->api_version, sizeof(info->api_version), + "%u.%u", vf->version.major, vf->version.minor); + info->fields |= IFVF_F_API_VERSION; + } + 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; + info->vlan_count = vf->vsi.num_vlans; + info->vlan_limit = IXL_VF_MAX_VLAN_FILTERS; + info->fields |= IFVF_F_VLAN_LIMIT; + } else { + info->vlan_mode = IFVF_VLAN_ACCESS; + info->vlan = vf->default_vlan; + info->vlan_pcp = 0; + info->vlan_proto = ETHERTYPE_VLAN; + info->vlan_count = 1; + info->fields |= IFVF_F_VLAN | IFVF_F_VLAN_PCP | + IFVF_F_VLAN_PROTO; + } + info->tx_queue_count = vf->qtag.num_active; + info->rx_queue_count = vf->qtag.num_active; + info->allow_set_mac = + (vf->vf_flags & VF_FLAG_SET_MAC_CAP) != 0; + info->allow_set_vlan = + (vf->vf_flags & VF_FLAG_VLAN_CAP) != 0; + info->mac_anti_spoof = + (vf->vf_flags & VF_FLAG_MAC_ANTI_SPOOF) != 0; + info->allow_promisc = + (vf->vf_flags & VF_FLAG_PROMISC_CAP) != 0; + info->traffic_allowed = info->configured && !vf->mdd_blocked; + info->fault_blocked = vf->mdd_blocked; + + extension = if_vf_status_add_extension(info, + IXL_VF_STATUS_NAMESPACE, IXL_VF_STATUS_VERSION, + IXL_VF_STATUS_NUM_FIELDS); + if (extension == NULL) { + if_vf_status_free(status); + return (ENOMEM); + } + if_vf_extension_set_bool(extension, + IXL_VF_STATUS_FIELD_MDD_BLOCKED, + IXL_VF_STATUS_MDD_BLOCKED, vf->mdd_blocked); + if_vf_extension_set_number(extension, + IXL_VF_STATUS_FIELD_MDD_TX_EVENTS, + IXL_VF_STATUS_MDD_TX_EVENTS, vf->mdd_tx_events); + if_vf_extension_set_number(extension, + IXL_VF_STATUS_FIELD_MDD_RX_EVENTS, + IXL_VF_STATUS_MDD_RX_EVENTS, vf->mdd_rx_events); + } + *statusp = status; + return (0); +} + /* * Sanity check and save off tunable values. */ diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 0b93ea51ff4a..81a2fc015068 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -45,6 +45,7 @@ #define VF_FLAG_VLAN_CAP 0x04 #define VF_FLAG_PROMISC_CAP 0x08 #define VF_FLAG_MAC_ANTI_SPOOF 0x10 +#define VF_FLAG_INITIALIZED 0x20 #define IXL_VF_MAX_MAC_FILTERS 18 #define IXL_VF_MAX_VLAN_FILTERS 16 @@ -188,6 +189,7 @@ struct ixl_pf { struct ixl_vf *vfs; int num_vfs; uint16_t veb_seid; + bool iov_attached; int vc_debug_lvl; sbintime_t link_poll_start; diff --git a/sys/dev/ixl/ixl_pf_iov.c b/sys/dev/ixl/ixl_pf_iov.c index bdc02f1f11ce..bc47051a7d9e 100644 --- a/sys/dev/ixl/ixl_pf_iov.c +++ b/sys/dev/ixl/ixl_pf_iov.c @@ -123,8 +123,10 @@ ixl_initialize_sriov(struct ixl_pf *pf) device_printf(dev, "Failed to initialize SR-IOV (error=%d)\n", iov_error); - } else + } else { + pf->iov_attached = true; device_printf(dev, "SR-IOV ready\n"); + } pf->vc_debug_lvl = 1; } @@ -447,6 +449,7 @@ ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf) int i, error; hw = &pf->hw; + vf->vf_flags &= ~VF_FLAG_INITIALIZED; for (i = 0; i < IXL_VF_RESET_TIMEOUT; i++) { DELAY(10); @@ -627,6 +630,7 @@ ixl_vf_get_resources_msg(struct ixl_pf *pf, struct ixl_vf *vf, void *msg, ixl_send_vf_msg(pf, vf, VIRTCHNL_OP_GET_VF_RESOURCES, I40E_SUCCESS, &reply, sizeof(reply)); + vf->vf_flags |= VF_FLAG_INITIALIZED; } static int @@ -2085,6 +2089,7 @@ ixl_hold_vfs_in_reset(struct ixl_pf *pf) vf = &pf->vfs[i]; if (!(vf->vf_flags & VF_FLAG_ENABLED)) continue; + vf->vf_flags &= ~VF_FLAG_INITIALIZED; vfrtrig = rd32(hw, I40E_VPGEN_VFRTRIG(vf->vf_num)); vfrtrig |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_num), vfrtrig); @@ -2191,6 +2196,7 @@ ixl_rebuild_vfs_after_reset(struct ixl_pf *pf) vf = &pf->vfs[i]; if (!(vf->vf_flags & VF_FLAG_ENABLED)) continue; + vf->vf_flags &= ~VF_FLAG_INITIALIZED; vf->vsi.seid = 0; vf->vsi.vsi_num = 0;