summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/amazon
diff options
context:
space:
mode:
authorSameeh Jubran <sameehj@amazon.com>2020-02-11 18:17:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-11 20:02:45 +0300
commit092a63301b92e0452433df1f6d6e314d6944cf1f (patch)
tree96ca58fea88b3edb17cfd8e8ac4948a71a7554c6 /drivers/net/ethernet/amazon
parent304b62b5f4c816b67080c1e21ce3a2f56952a3cb (diff)
downloadlinux-092a63301b92e0452433df1f6d6e314d6944cf1f.tar.xz
net: ena: rss: fix failure to get indirection table
[ Upstream commit 0c8923c0a64fb5d14bebb9a9065d2dc25ac5e600 ] On old hardware, getting / setting the hash function is not supported while gettting / setting the indirection table is. This commit enables us to still show the indirection table on older hardwares by setting the hash function and key to NULL. Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Sameeh Jubran <sameehj@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/amazon')
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_ethtool.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
index c58ad6190951..7ca7bade1c09 100644
--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c
+++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
@@ -660,7 +660,21 @@ static int ena_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
if (rc)
return rc;
+ /* We call this function in order to check if the device
+ * supports getting/setting the hash function.
+ */
rc = ena_com_get_hash_function(adapter->ena_dev, &ena_func, key);
+
+ if (rc) {
+ if (rc == -EOPNOTSUPP) {
+ key = NULL;
+ hfunc = NULL;
+ rc = 0;
+ }
+
+ return rc;
+ }
+
if (rc)
return rc;