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 1D818330B1C; Fri, 17 Oct 2025 15:49:52 +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=1760716193; cv=none; b=JeCIUck8T8s9DWafgPHpes0KraBxvyNnLU+Yy5hLKN/hVIAaJvkL0AfJCpGFrMaT6WMdM5+9zIop2T92m2FYOCDW6b04UK6WE5mhng5OtWrGjJaLbPGOVtT4LwMCnW7NtMBbJievAAB6tduKcTUMne1Wc9WXGrjPiqh7o5+AEGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760716193; c=relaxed/simple; bh=/9s5EaUMqK423bQYyGF7sGju150odqfztklB26XxKP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kimwCs2k7uROF85xstxFu/r8jhqW0keKNm5IcVLcIPUTK3IHLNq9ej6GrnsO9hKEP/pMu2xCdSPBcTv7N9tRGtndvrcZ8nwWYODYitwtxfpWVWf1ixgnc6+k7Wq7Hx/3RqD9BZQDS6tV3haEh9foRFa/Bh8giCHWR93ehqCP5Cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DMOO6lNw; 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="DMOO6lNw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4614EC4CEE7; Fri, 17 Oct 2025 15:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760716192; bh=/9s5EaUMqK423bQYyGF7sGju150odqfztklB26XxKP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DMOO6lNwdufLNKw4fmev9PsjSefH6h+LtEFucUwyg5f8rO30Qfr1eYXjSBqNzRLcK ud4wak/l2wZ5nzcGESD/gXwHfEphk4GGYuRPZR+R1fD3zLhaB3CgNTKEYjdl4mb4dA EWfLcvVZtFaus6CXR+bpf8rLnYtMiqyicG8RosbM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kohei Enju , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 104/276] net: ena: return 0 in ena_get_rxfh_key_size() when RSS hash key is not configurable Date: Fri, 17 Oct 2025 16:53:17 +0200 Message-ID: <20251017145146.279802096@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017145142.382145055@linuxfoundation.org> References: <20251017145142.382145055@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kohei Enju [ Upstream commit f017156aea60db8720e47591ed1e041993381ad2 ] In EC2 instances where the RSS hash key is not configurable, ethtool shows bogus RSS hash key since ena_get_rxfh_key_size() unconditionally returns ENA_HASH_KEY_SIZE. Commit 6a4f7dc82d1e ("net: ena: rss: do not allocate key when not supported") added proper handling for devices that don't support RSS hash key configuration, but ena_get_rxfh_key_size() has been unchanged. When the RSS hash key is not configurable, return 0 instead of ENA_HASH_KEY_SIZE to clarify getting the value is not supported. Tested on m5 instance families. Without patch: # ethtool -x ens5 | grep -A 1 "RSS hash key" RSS hash key: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 With patch: # ethtool -x ens5 | grep -A 1 "RSS hash key" RSS hash key: Operation not supported Fixes: 6a4f7dc82d1e ("net: ena: rss: do not allocate key when not supported") Signed-off-by: Kohei Enju Link: https://patch.msgid.link/20250929050247.51680-1-enjuk@amazon.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c index 413082f10dc1c..31f05356a7c06 100644 --- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c +++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c @@ -688,7 +688,10 @@ static u32 ena_get_rxfh_indir_size(struct net_device *netdev) static u32 ena_get_rxfh_key_size(struct net_device *netdev) { - return ENA_HASH_KEY_SIZE; + struct ena_adapter *adapter = netdev_priv(netdev); + struct ena_rss *rss = &adapter->ena_dev->rss; + + return rss->hash_key ? ENA_HASH_KEY_SIZE : 0; } static int ena_indirection_table_set(struct ena_adapter *adapter, -- 2.51.0