From nobody Thu Oct 29 06:09:32 2026 X-Original-To: dev-commits-src-branches@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 4jFYj85lNCz6xrhK for ; Thu, 29 Oct 2026 06:09:32 +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 4jFYj84NP6z54ZX for ; Thu, 29 Oct 2026 06:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793254172; 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=dus3i7r8ZXbLsZfWubBBXWeY/peEUYI6dW5dThsX3jg=; b=ap/DhwVDHWxp+d3XJ6GSkHkdTNXKPIvw/MtUNoZOHxdoopHM5cfTAFc8caWvXkw5lpQ5YS Fg8zj6WJxo5ahaDG/44uRuuR655wJ2ZWhyR4zp1GEd6UdAhsxUWgPX1F4Jmo0csQ0S5iKU fM/edFWdLpF3JZZSpnMgCI5viLVsKmepbxVZoTOjO7RoEWFGLQ3DlTU1wCP1yZcW6VXTK3 5ySRduCkIDyGqjD3aowx9d8MGcPU14yQ4xdr2Anvpla0H/fBBJQ3Z+Cg4/5tP+yHV1mhZB hd3WNVOlCYBQBc7nzsh9oj1n36eAa+8mgLGWo6hLFeBgmESKUBTGA3qK9mc0mw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793254172; b=ddRsUDN9ANVnkjx2la5KUjecmF7r9adypCjPU163iGkGhrgwDMNi99hGI54fny0eBDUlis qIrLevYv1TQa7tFy4mgfd2B56EWsK7L4ao+1nwrCYFd73SDo8Ts9bm3g87lZ+U0h/BcoTa ZwOGjdljP6VXendaoOXimhU/ewMpEXOUxhzGUb3Zbb4w+h1BcBok0gXzGyEAn1lnDAYrWj 6+dvKofEv41QqUwn9kWrtaO4raVHIOtJ0iGrsH621kXQfURAlscM6Jtan0mBRzryKkot7J VcOtxfBjLK1P+UotS/ibLKdPwr4gEmvyXrwazllEv11j206hOEnT1Fxa1YY7IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793254172; 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=dus3i7r8ZXbLsZfWubBBXWeY/peEUYI6dW5dThsX3jg=; b=h+mM2yvByMNWj8jhhUP3Bm/I2w4qhZlKyArXeTUAH7wP8gxcM2dlIVIHjFIwe7NCHxbS3x I1BzdoWyDrxTBXMn+QUnD6zjOcZy0TczBBADGUzu8KD/rw0hIktSqWopnCeRgzMDPD9Cqk UnNafzMxxA6CWBw8jKH8fJt3efglZ3jNPm9t9rxvBkQxS+zq3aa9HteJrye3oQCxNutQYV +OSxgS8RtCjybyGELd/PIA5VjI2TcGLvjrLtcf3j1JBkyU4YWJnhuHY7CD67yQiL1Alh4R WWF1Ii/HqfAaPow8ozlMeiCJynHJIDYBNjoGVp1lUU2ZNOKzaGmwYzTQU3qdHw== 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 4jFYj842YfzR8L for ; Thu, 29 Oct 2026 06:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b381 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:09:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8178fa76e947 - stable/15 - ice: Use sleepable locks in shared code List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD 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: 8178fa76e9478be1af59dabcfd694b815f595127 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:09:32 +0000 Message-Id: <6ae2e31c.3b381.4f6fd89a@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=8178fa76e9478be1af59dabcfd694b815f595127 commit 8178fa76e9478be1af59dabcfd694b815f595127 Author: Kevin Bowling AuthorDate: 2026-09-03 11:31:42 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 06:09:22 +0000 ice: Use sleepable locks in shared code The Intel shared code can wait for firmware resources while holding its OS abstraction locks. FreeBSD mapped these locks to mutexes, which cannot be held across a voluntary sleep. Concurrent PF rebuilds therefore trigger WITNESS when RSS profile updates contend for the firmware change lock. Map the shared-code lock abstraction to exclusive sx locks. This also covers tunnel and flow-profile operations which can reach the same firmware wait while serialized. Validated with WITNESS on a dual port Intel E835. Sixteen CORE resets rebuilt both PFs without lock warnings, reset failures, or watchdogs. Ten interface down/up cycles and twenty promiscuous-filter cycles also completed cleanly. Reviewed by: erj Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59339 (cherry picked from commit b272b2a94d983900c94168c5f41256869b0371b1) --- sys/dev/ice/ice_osdep.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sys/dev/ice/ice_osdep.h b/sys/dev/ice/ice_osdep.h index ea355ddb31f4..a428defb14bd 100644 --- a/sys/dev/ice/ice_osdep.h +++ b/sys/dev/ice/ice_osdep.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -408,7 +409,7 @@ void ice_free_dma_mem(struct ice_hw __unused *hw, struct ice_dma_mem *mem); * Contains a simple lock implementation used to lock various resources. */ struct ice_lock { - struct mtx mutex; + struct sx sx; char name[ICE_STR_BUF_LEN]; }; @@ -418,8 +419,9 @@ extern u16 ice_lock_count; * ice_init_lock - Initialize a lock for use * @lock: the lock memory to initialize * - * OS compatibility layer to provide a simple locking mechanism. We use - * a mutex for this purpose. + * OS compatibility layer to provide a simple locking mechanism. Shared-code + * operations can wait for firmware while holding these locks, so use a + * sleepable exclusive lock. */ static inline void ice_init_lock(struct ice_lock *lock) @@ -431,45 +433,45 @@ ice_init_lock(struct ice_lock *lock) */ memset(lock->name, 0, sizeof(lock->name)); snprintf(lock->name, ICE_STR_BUF_LEN, "ice_lock_%u", ice_lock_count++); - mtx_init(&lock->mutex, lock->name, NULL, MTX_DEF); + sx_init(&lock->sx, lock->name); } /** * ice_acquire_lock - Acquire the lock * @lock: the lock to acquire * - * Acquires the mutex specified by the lock pointer. + * Acquires the exclusive lock specified by the lock pointer. */ static inline void ice_acquire_lock(struct ice_lock *lock) { - mtx_lock(&lock->mutex); + sx_xlock(&lock->sx); } /** * ice_release_lock - Release the lock * @lock: the lock to release * - * Releases the mutex specified by the lock pointer. + * Releases the exclusive lock specified by the lock pointer. */ static inline void ice_release_lock(struct ice_lock *lock) { - mtx_unlock(&lock->mutex); + sx_xunlock(&lock->sx); } /** * ice_destroy_lock - Destroy the lock to de-allocate it * @lock: the lock to destroy * - * Destroys a previously initialized lock. We only do this if the mutex was + * Destroys a previously initialized lock. We only do this if the lock was * previously initialized. */ static inline void ice_destroy_lock(struct ice_lock *lock) { - if (mtx_initialized(&lock->mutex)) - mtx_destroy(&lock->mutex); + if (lock_initialized(&lock->sx.lock_object)) + sx_destroy(&lock->sx); memset(lock->name, 0, sizeof(lock->name)); }