From nobody Fri Sep 18 00:28:04 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 4hmD4545yjz6sKNw for ; Fri, 18 Sep 2026 00:28:05 +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 4hmD451hGbz4lBG for ; Fri, 18 Sep 2026 00:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789691285; 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=Bhiucm3i3QQlbXJb9+SgRjnsbchGFwNrC4tDmp8fFdw=; b=LhejFObZ6BTwCxIJQkLwu6JYNwyGjdXFOuRepKLVUbSXRRnqnoyK5tT/DM1PZut1/0217l H9CTFQrXoHfZdhwiqd/HL5YpQGtq4P3XIOCJjCg4s3YS+43U9fxzi5zRApXTAPY0GT3I/h /GDcBMkWXd6bwdOVrqpFIVGJwM5khSst3pVMaNzx0Td9sweSzYVnFWYRgsq9/PKuBspxGp yPRuS4tMkrTWSg7149C8MEYa/YI6OvaVPyeN7GnFSQCqb6mWEmZ86Y2NJ4MWbGRYYc9s+l d2xVcOaTYpw/UUnqSSoCUXkla0lHH49a+Sp6uPZgWWMpy1aetyaMiF364HYpOg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789691285; b=bjoHbrvQGQrc33+RxUsTwsVju42O3z5u573arx13Uz4dtZ5Yn9J1MpjGyWD8sAeQK3469l SJ+EiJ3IlSzJ3hytFNWeGcUEsEWHEAN4GLrGH8QCTGRz6L3fIM9jkEg9t8CqSbw94iBXxL KJEYHeQz7EXSPVs3wz3mWZhIomL2jHRjNNXIBBpmOf7G4lvpH7SwJ6TDWDTN0Mqr/JdAAg lBPyArKwLVpnYUNkRqXFpk5HbpXZ8Cnlj7kVU+JMt/AB2iFPiqaiCRZWhlqLElUN2AcNkz aquAViyS9zcrnaRBjwwdanG4PAtmcI1r15zy40Pm8ygWCQ+jtcnNe9/WI6D57g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789691285; 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=Bhiucm3i3QQlbXJb9+SgRjnsbchGFwNrC4tDmp8fFdw=; b=gcz2CC3BBhoYal1DVDwZYcXXLofGD4yqdcq9aUyvPJVJe7ML2x6TniIqr188xeJXGhy4q4 XHthwhyQKw7U8XdTbs7APIyILwXgU1yfczMQ8JmI9q6qKlivspLv6WwfWFzPJFYCxB5TBi YDaB1/57dUIDlF8qp+5ypXmW8RaYAvMFY7pXoqza4w71XfvWCg5DXoPv89GG4ZWWNlfhmA z7IDB57Awlyr55CEW419wbGznsbSDyC/y+VzXft97L25JeeP8w7zwCChr2YUOrSsMbakTf MvanZ1/Hh+Ocm1pOuh9SYyyDQ3Dir6tSpIdGmi+srysoFwjPc+rKx0AhtItIfw== 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 4hmD4501svzwKC for ; Fri, 18 Sep 2026 00:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 317f0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 18 Sep 2026 00:28:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 31fb4efd211c - main - ice: Add VF reset and policy failure injection 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: 31fb4efd211cbb2ea79463c6e8522bb362e29129 Auto-Submitted: auto-generated Date: Fri, 18 Sep 2026 00:28:04 +0000 Message-Id: <6aac8594.317f0.71b5e2fd@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=31fb4efd211cbb2ea79463c6e8522bb362e29129 commit 31fb4efd211cbb2ea79463c6e8522bb362e29129 Author: Kevin Bowling AuthorDate: 2026-08-19 03:41:02 +0000 Commit: Kevin Bowling CommitDate: 2026-09-18 00:27:40 +0000 ice: Add VF reset and policy failure injection Extend the optional ICE failure-injection facility with points for the MAC anti-spoof firmware update and each mandatory VF reset stage. The reset points report a failed Tx drain command, VFR timeout, receive queue disable, or final PCIe transaction drain after the corresponding hardware operation. This permits fail-closed state and recovery tests without deliberately leaving live DMA during teardown. The points remain absent unless the kernel is built with options DRIVER_FAILPOINTS and retain the existing PF and VF selectors. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59025 --- sys/dev/ice/ice_iov.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index ae56395aa776..68cfae7197db 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -265,6 +265,9 @@ ice_iov_configure_mac_anti_spoof(struct ice_softc *sc, struct ice_vf *vf) struct ice_vsi *vsi = vf->vsi; struct ice_hw *hw = &sc->hw; bool enable; +#ifdef DRIVER_FAILPOINTS + int error; +#endif int status; enable = (atomic_load_acq_32(&vf->vf_flags) & @@ -277,6 +280,8 @@ ice_iov_configure_mac_anti_spoof(struct ice_softc *sc, struct ice_vf *vf) else ctx.info.sec_flags &= ~ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF; + ICE_IOV_FAIL_POINT(sc, vf->vf_num, mac_anti_spoof_update, error, + fail); status = ice_update_vsi(hw, vsi->idx, &ctx, NULL); if (status != 0) { device_printf(sc->dev, @@ -289,6 +294,11 @@ ice_iov_configure_mac_anti_spoof(struct ice_softc *sc, struct ice_vf *vf) vsi->info.sec_flags = ctx.info.sec_flags; return (0); + +#ifdef DRIVER_FAILPOINTS +fail: + return (error); +#endif } /** @@ -864,6 +874,11 @@ ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf, bool trigger_reset, /* This zero-queue command is required to complete every VF reset. */ status = ice_dis_vsi_txq(hw->port_info, vf->vsi->idx, 0, 0, NULL, NULL, NULL, ICE_VF_RESET, vf->vf_num, NULL); + ICE_FAIL_POINT_CODE_COND(sc, _debug_fail_point_ice_iov, + vf_reset_tx_disable, ice_iov_fail_vf_matches(vf->vf_num), + FAIL_POINT_NONSLEEPABLE, { + status = ICE_ERR_AQ_ERROR; + }); if (status) { device_printf(sc->dev, "%s: Failed to disable LAN Tx queues: err %s aq_err %s\n", @@ -884,6 +899,11 @@ ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf, bool trigger_reset, DELAY(ICE_VPGEN_VFRSTAT_WAIT_DELAY_US); } + ICE_FAIL_POINT_CODE_COND(sc, _debug_fail_point_ice_iov, + vf_reset_vfr_timeout, ice_iov_fail_vf_matches(vf->vf_num), + FAIL_POINT_NONSLEEPABLE, { + reset_done = false; + }); if (!reset_done) { device_printf(sc->dev, "VF-%d Reset is stuck\n", vf->vf_num); @@ -899,6 +919,12 @@ ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf, bool trigger_reset, /* Hardware resets Tx queues; the PF must disable every Rx. */ for (bit = 0; bit < vf->vsi->num_rx_queues; bit++) { status = ice_control_rx_queue(vf->vsi, bit, false); + ICE_FAIL_POINT_CODE_COND(sc, + _debug_fail_point_ice_iov, vf_reset_rx_disable, + ice_iov_fail_vf_matches(vf->vf_num), + FAIL_POINT_NONSLEEPABLE, { + status = EIO; + }); if (status != 0) { device_printf(sc->dev, "Unable to disable VF-%d Rx queue %d: %s\n", @@ -918,6 +944,11 @@ ice_reset_vf(struct ice_softc *sc, struct ice_vf *vf, bool trigger_reset, break; DELAY(ICE_PCI_CIAD_WAIT_DELAY_US); } + ICE_FAIL_POINT_CODE_COND(sc, _debug_fail_point_ice_iov, + vf_reset_pcie_pending, ice_iov_fail_vf_matches(vf->vf_num), + FAIL_POINT_NONSLEEPABLE, { + i = ICE_PCI_CIAD_WAIT_COUNT; + }); if (i == ICE_PCI_CIAD_WAIT_COUNT) { device_printf(sc->dev, "VF-%d PCI transactions remain after reset\n", vf->vf_num);