From nobody Mon Nov 02 18:42:24 2026 X-Original-To: dev-commits-src-main@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 4jJLD06PCFz6yBsk for ; Mon, 02 Nov 2026 18:42:24 +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 4jJLD05Ycpz4MNp for ; Mon, 02 Nov 2026 18:42:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793644944; 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=6mJr3ADTB41a8wNP6TrPD0Zu71T9Ctk9G3Qj+m6lZcQ=; b=yrrenL2HaMucssDsNU5fsFwDLLY9h5SwZEN8A0qWZw6NM5Ec4SPuce0d9XHMHv8UQougLU rCi9C3IniV9V/qjgTFJVhaKlNUfYo7jAb0xIES4UsjgVOfOvfd4ea7WzMgwR4pLT78j/iV eeIGdreVwmmw6OrBTkzEKUYiF13LVxFOi2ZGj9C5ETeQFarkU7O/GIn6nJWcT+Cleqnzc4 zGrOGzDpJMQ8jB4RGeXQVowfTvFBBCLRPqvMQWl7/QrqVThj9FFjSy4vJgdEshua+sE1aj VfDgqrwJEamnCyhXuFH9dNV5t4hW0xLley3PvbJms6zQG7+L7R+66Ug2q2CI0Q== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793644944; b=sj2HkBIfgztgkVrkRzU3NVFLvrqNDvRnlgTFkN7/aq1ACNaJ+5HWisSV8AP79d5n4/9oIc HpiCGWoRLXqijQ6Z4asrwsqk9RQG1M/or3uB9jsvBmGEhuKwxWT9Ua4jX74HLOJGS35D+H B2RwI05b/3Zet+LjrfO2j7nnsnUiPancxj7qHn2m1QaueDIk/VGHlvoaptcuplI5z6xPoA uxYMu5hpmEyllEkz6urDCOR1t3rZ69SBPz5oRPSxn5BOYTkcOLCtO4kRj7jhcwXxaXdyFf WWADQjRioZgqkPRlxE/EjYoh+flNXwPymqI4bS5hyx/w0UZQS7i1HZuDOJ3mug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793644944; 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=6mJr3ADTB41a8wNP6TrPD0Zu71T9Ctk9G3Qj+m6lZcQ=; b=W6UE4eXivsiLC8Co4O8a1va8K6j8b5RShrS5s/osxgb/NyVrC7ilVaPLqp2CaMUP4scgPU kyTrfrYWP6p9kiuFo0DCD0xL7yfbCKHwd1ki1a1K1vVE6p6mpqctrkBnaK/41cH6LyN2dv j3a46oJp5wXg4HhSRtTj8i7QC4g/ZitPo5D5qa3ACt946rnPE6cU8tbIxslP9rQj1bXWsp qH3pS0NQmcIHVEvXXnp0oFWAapsot14OJ0vZZHYRIEJgkqY/eDNfk26/5Sadvf2MIEfP3i 83JiWtHDAvp9cBPjTTLWzfzYSpEhjUsDXVeIuORv+sXS+OoN3G741HwoHzYXgQ== 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 4jJLD05Cy3zxgT for ; Mon, 02 Nov 2026 18:42:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30593 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 02 Nov 2026 18:42:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Arthur Kiyanovski From: Arthur Kiyanovski Subject: git: eb65bcbf6cb5 - main - ena: Fix RSS sysctl panic when the RSS table is destroyed List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch 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/main X-Git-Reftype: branch X-Git-Commit: eb65bcbf6cb5b8ace59504ea721ff1802e912296 Auto-Submitted: auto-generated Date: Mon, 02 Nov 2026 18:42:24 +0000 Message-Id: <6ae8d990.30593.602f0bbe@gitrepo.freebsd.org> The branch main has been updated by akiyano: URL: https://cgit.FreeBSD.org/src/commit/?id=eb65bcbf6cb5b8ace59504ea721ff1802e912296 commit eb65bcbf6cb5b8ace59504ea721ff1802e912296 Author: Arthur Kiyanovski AuthorDate: 2026-10-30 01:38:44 +0000 Commit: Arthur Kiyanovski CommitDate: 2026-11-02 18:31:51 +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 --- 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 74594fdb1496..2d43456f3e74 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); }