From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 158B237E31E; Wed, 21 Jan 2026 18:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769020080; cv=none; b=SjFxfF+5Bym1i1PSGP6+EMGGnCVncQTtQA2uNcOe6XX6+bqiSw0xjcou2ELLGMDkfvvQTdhDwCVILjAkcOCEilxQiDW0Lleeg31MFFkj87a8mwbjTsRthTJRu6D1RnJYfN3eojrtqjqkv392wLOmtdPdMKCJNofpmb8utKmN2Eg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769020080; c=relaxed/simple; bh=KeTYk3xEg+FL4z9mNvZTe5M6hbHPu2zyi5Bgo5FMy+o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U7L58kUrwF+Cacs1MaDt1zRb2j1gkdDUuinaLcDHXAbM0WGYGhhq91eHuFPZQGdPz2jzSHQLs9wxrHp+tqx2SlU8xO7zKhCUgYnPsXnSLuqVlem/DTAAp7p1ZxPgLzaFnRebg12HqAUYL9XQd7W0AqYOfxyWN7gaDcorqq83yjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1ub2OrDr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1ub2OrDr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46108C4CEF1; Wed, 21 Jan 2026 18:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769020079; bh=KeTYk3xEg+FL4z9mNvZTe5M6hbHPu2zyi5Bgo5FMy+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1ub2OrDrQRXNQSEmQlQ5SrbnSOX2KJypGLy/whTcKWeYSUjcKk4uZZgJKCICTFEdV M3Hr/PiJ6mGY0feZx0AeqKnUMWMYLc4lJWxvUvdwVsSHh1JH/VCRej5JdrF8fEj+o6 SWyhZogGeuuNky+4J86OAxVdIGJLPH2KiAVPl/Zo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nimrod Oren , Gal Pressman , Willem de Bruijn , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 053/198] selftests: drv-net: fix RPS mask handling for high CPU numbers Date: Wed, 21 Jan 2026 19:14:41 +0100 Message-ID: <20260121181420.462963296@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260121181418.537774329@linuxfoundation.org> References: <20260121181418.537774329@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gal Pressman [ Upstream commit cf055f8c000445aa688c53a706ef4f580818eedb ] The RPS bitmask bounds check uses ~(RPS_MAX_CPUS - 1) which equals ~15 = 0xfff0, only allowing CPUs 0-3. Change the mask to ~((1UL << RPS_MAX_CPUS) - 1) = ~0xffff to allow CPUs 0-15. Fixes: 5ebfb4cc3048 ("selftests/net: toeplitz test") Reviewed-by: Nimrod Oren Signed-off-by: Gal Pressman Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20260112173715.384843-3-gal@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- tools/testing/selftests/net/toeplitz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/toeplitz.c b/tools/testing/selftests/net/toeplitz.c index 9ba03164d73a6..5099157f01b9a 100644 --- a/tools/testing/selftests/net/toeplitz.c +++ b/tools/testing/selftests/net/toeplitz.c @@ -473,8 +473,8 @@ static void parse_rps_bitmap(const char *arg) bitmap = strtoul(arg, NULL, 0); - if (bitmap & ~(RPS_MAX_CPUS - 1)) - error(1, 0, "rps bitmap 0x%lx out of bounds 0..%lu", + if (bitmap & ~((1UL << RPS_MAX_CPUS) - 1)) + error(1, 0, "rps bitmap 0x%lx out of bounds, max cpu %lu", bitmap, RPS_MAX_CPUS - 1); for (i = 0; i < RPS_MAX_CPUS; i++) -- 2.51.0