From nobody Wed Nov 04 21:15:24 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 4jKdWd1QhYz703dF for ; Wed, 04 Nov 2026 21:15:25 +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 4jKdWc6nXsz4SPh for ; Wed, 04 Nov 2026 21:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793826925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pJgtcShW9ZmX/IHMJtaVOyOjMaC55uFMpiutSmDgXmY=; b=scSQ99n/Zaf5L82vGpW1Jylj/fR9Sb2n98og5WzaNcwr4B1Q2v1Fr/CEj/hfisSUkNbsGd asXuGe3qzlI1dFrem6wsFn+PeIiddetsrSgKNdZWH5gmkbdqgKW2JTGyeylbXKeiwCkWpi i60zaFtyuBWh1yufohOSSAFYEW1AKDkg9f3vARWsqp/rcVr4GbdFHdAwI94G+ncXx/0/qC pte4EDRLjiiVRk8EJt6e5T/Vc6+bb4kyRtWhoR04yvdyUwdZTth34boJgQ+fMw1p+mAA1L S2VfsgUKnCY1O9NRe2RHR02Z2lzRyxgSQjl/E2bhZ9mH5SW6OMO43iGMKne5TA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793826924; b=TSO5fhnXeKMAOoXiQuJaw4CIR72M4UKpNcMUqfBhKVlzpdHgiUIHbhIX/SDuncGXlrYjnq VLFyMFVloQO5XzNZ99DeIUMjLRBSRlCGPqKn/307XkH3a6w/IiEt4c2JpXXMaX+tlgrclw CmJTLlLIvo3Qgr8E7MP7Kd+9iASG4YLVitRz6iDiSgCUcsNKBIWPXNkDSmitYVt43Tl3W1 ut+A9DdVGWEr0rdg9nUHTvTiWhj7h/8Gf8MxTN6w/flI4TP4CmBbsGKCqCZdunbntRKqj5 ygNKCXUR9jnZS0CR0SqDd2KGXsM92S49jGMXByLB9HfmF8XpYJCErIrWm+tB3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793826924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pJgtcShW9ZmX/IHMJtaVOyOjMaC55uFMpiutSmDgXmY=; b=ghsWQ0A2HS5zBLoB02u8my7CL7+EiYpQWfuVuqiHLGOVAnkuRzYLuGluylZ7gvCG57Augr ukX5l23oePJbOS3hfH7RDlk+tl28CWf/pPDdI2iIFXjZV7ruR2pItq+1dt9BHzomOUrQYE QQl8Ir05d3C1bHhLKdmDu5/Zd9GHMGWR8jdAVWoAFgDnHwMS60C9nOtP7SCgtwVFqTrjUx flJYTPM73IVUNz5Cet9z2WRxRGaAtdPT+xwctIU+LgCvKWhTMLECnJGqjKaApEzplxtQKX tF/hzSuvrL1mPB/bNBhhWhzmErZeaHkyiyxb578htmLnhjRq+5egpLw5ygZ7/g== 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 4jKdWc5pdFzKDS for ; Wed, 04 Nov 2026 21:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20781 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 04 Nov 2026 21:15:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Arthur Kiyanovski From: Arthur Kiyanovski Subject: git: 85616af94e20 - stable/15 - ena: Fix RSS sysctl panic when the RSS table is destroyed 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: akiyano X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 85616af94e20b02398246de23cd7243583940943 Auto-Submitted: auto-generated Date: Wed, 04 Nov 2026 21:15:24 +0000 Message-Id: <6aeba06c.20781.58a7f2a7@gitrepo.freebsd.org> The branch stable/15 has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=85616af94e20b02398246de23cd7243583940943 commit 85616af94e20b02398246de23cd7243583940943 Author: Arthur Kiyanovski AuthorDate: 2026-10-30 01:38:44 +0000 Commit: Arthur Kiyanovski CommitDate: 2026-11-04 20:52:58 +0000 ena: Fix RSS sysctl panic when the RSS table is destroyed ena_set_io_queue_count() destroys the ena-com RSS state but left ENA_FLAG_RSS_ACTIVE set. The RSS sysctl handlers gate on that flag, so they ran against state that was gone. This causes 2 types of issues: 1. Kernel panic when reading dev.ena.0.rss.key or writing to dev.ena.0.rss.indir_table 2. Returning a stale cached RSS table when reading dev.ena.0.rss.indir_table, or a bogus 1 when reading dev.ena.0.rss.indir_table_size ena_set_io_queue_count() is called in 2 cases: 1. The io_queues_nb sysctl. 2. Device restore when the device comes back with fewer MSI-X vectors than before. Clear ENA_FLAG_RSS_ACTIVE when the RSS table is destroyed. The handlers then fail with ENOTSUP until the next ena_up() rebuilds RSS. This both fixes the panics, and stops returning cached and bogus values. Note: A plain ifconfig down does not destroy the table, so the sysctls keep working across a down/up cycle. Reviewed by: cperciva Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment") Fixes: 2d4d2ed3fef6 ("ena: Reinit RSS table on device restore when queue count shrinks") MFC after: 3 days Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D61057 (cherry picked from commit eb65bcbf6cb5b8ace59504ea721ff1802e912296) --- sys/dev/ena/ena.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 767cccd3918f..04f9193f1bce 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -1302,6 +1302,7 @@ static void ena_set_io_queue_count(struct ena_adapter *adapter, uint32_t num) { adapter->num_io_queues = num; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_RSS_ACTIVE, adapter); /* Force indirection table to be reinitialized */ ena_com_rss_destroy(adapter->ena_dev); }