net: ena: rss: fix failure to get indirection table
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / amazon / ena / ena_ethtool.c
index 521607b..dc63aa9 100644 (file)
@@ -661,7 +661,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;
 
@@ -695,8 +709,8 @@ static int ena_set_rxfh(struct net_device *netdev, const u32 *indir,
        if (indir) {
                for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) {
                        rc = ena_com_indirect_table_fill_entry(ena_dev,
-                                                              ENA_IO_RXQ_IDX(indir[i]),
-                                                              i);
+                                                              i,
+                                                              ENA_IO_RXQ_IDX(indir[i]));
                        if (unlikely(rc)) {
                                netif_err(adapter, drv, netdev,
                                          "Cannot fill indirect table (index is too large)\n");
@@ -817,6 +831,7 @@ static const struct ethtool_ops ena_ethtool_ops = {
        .get_channels           = ena_get_channels,
        .get_tunable            = ena_get_tunable,
        .set_tunable            = ena_set_tunable,
+       .get_ts_info            = ethtool_op_get_ts_info,
 };
 
 void ena_set_ethtool_ops(struct net_device *netdev)