]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE
authorArthur Kiyanovski <akiyano@amazon.com>
Tue, 11 Feb 2020 15:17:49 +0000 (15:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Feb 2020 01:08:31 +0000 (17:08 -0800)
As the name suggests ETH_RSS_HASH_NO_CHANGE is received upon changing
the key or indirection table using ethtool while keeping the same hash
function.

Also add a function for retrieving the current hash function from
the ena-com layer.

Fixes: e59074db59c6 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: Saeed Bshara <saeedb@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_com.c
drivers/net/ethernet/amazon/ena/ena_com.h
drivers/net/ethernet/amazon/ena/ena_ethtool.c

index 74743fd8a1e0a208568f53986924709e2d4b8f06..0f93d1092435d6a3111a08d6e4d7991d68a4f408 100644 (file)
@@ -1041,6 +1041,11 @@ static int ena_com_get_feature(struct ena_com_dev *ena_dev,
                                      feature_ver);
 }
 
+int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev)
+{
+       return ena_dev->rss.hash_func;
+}
+
 static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev)
 {
        struct ena_admin_feature_rss_flow_hash_control *hash_key =
index 9b5bd28ed0ac67a629f5fa1b06fa16b957af724f..469f298199a7b9a7c67ed4934ad6a503c40a1803 100644 (file)
@@ -656,6 +656,14 @@ int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 log_size);
  */
 void ena_com_rss_destroy(struct ena_com_dev *ena_dev);
 
+/* ena_com_get_current_hash_function - Get RSS hash function
+ * @ena_dev: ENA communication layer struct
+ *
+ * Return the current hash function.
+ * @return: 0 or one of the ena_admin_hash_functions values.
+ */
+int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev);
+
 /* ena_com_fill_hash_function - Fill RSS hash function
  * @ena_dev: ENA communication layer struct
  * @func: The hash function (Toeplitz or crc)
index 9a7a6ef39f9a2a4cd5d47c0be8fe4480003ec7d1..452b0e770370baa2f0d890acc1a05a9f218d9bf1 100644 (file)
@@ -736,6 +736,9 @@ static int ena_set_rxfh(struct net_device *netdev, const u32 *indir,
        }
 
        switch (hfunc) {
+       case ETH_RSS_HASH_NO_CHANGE:
+               func = ena_com_get_current_hash_function(ena_dev);
+               break;
        case ETH_RSS_HASH_TOP:
                func = ENA_ADMIN_TOEPLITZ;
                break;