Skip to content

Commit f017156

Browse files
hyperenjukuba-moo
authored andcommitted
net: ena: return 0 in ena_get_rxfh_key_size() when RSS hash key is not configurable
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 6a4f7dc ("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: 6a4f7dc ("net: ena: rss: do not allocate key when not supported") Signed-off-by: Kohei Enju <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8425161 commit f017156

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/amazon/ena/ena_ethtool.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,10 @@ static u32 ena_get_rxfh_indir_size(struct net_device *netdev)
865865

866866
static u32 ena_get_rxfh_key_size(struct net_device *netdev)
867867
{
868-
return ENA_HASH_KEY_SIZE;
868+
struct ena_adapter *adapter = netdev_priv(netdev);
869+
struct ena_rss *rss = &adapter->ena_dev->rss;
870+
871+
return rss->hash_key ? ENA_HASH_KEY_SIZE : 0;
869872
}
870873

871874
static int ena_indirection_table_set(struct ena_adapter *adapter,

0 commit comments

Comments
 (0)