These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / ethernet / intel / ixgbevf / ethtool.c
index b2f5b16..d3e5f5b 100644 (file)
@@ -813,22 +813,15 @@ static u32 ixgbevf_get_rxfh_indir_size(struct net_device *netdev)
 {
        struct ixgbevf_adapter *adapter = netdev_priv(netdev);
 
-       /* We support this operation only for 82599 and x540 at the moment */
-       if (adapter->hw.mac.type < ixgbe_mac_X550_vf)
-               return IXGBEVF_82599_RETA_SIZE;
+       if (adapter->hw.mac.type >= ixgbe_mac_X550_vf)
+               return IXGBEVF_X550_VFRETA_SIZE;
 
-       return 0;
+       return IXGBEVF_82599_RETA_SIZE;
 }
 
 static u32 ixgbevf_get_rxfh_key_size(struct net_device *netdev)
 {
-       struct ixgbevf_adapter *adapter = netdev_priv(netdev);
-
-       /* We support this operation only for 82599 and x540 at the moment */
-       if (adapter->hw.mac.type < ixgbe_mac_X550_vf)
-               return IXGBEVF_RSS_HASH_KEY_SIZE;
-
-       return 0;
+       return IXGBEVF_RSS_HASH_KEY_SIZE;
 }
 
 static int ixgbevf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
@@ -840,21 +833,33 @@ static int ixgbevf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
        if (hfunc)
                *hfunc = ETH_RSS_HASH_TOP;
 
-       /* If neither indirection table nor hash key was requested - just
-        * return a success avoiding taking any locks.
-        */
-       if (!indir && !key)
-               return 0;
+       if (adapter->hw.mac.type >= ixgbe_mac_X550_vf) {
+               if (key)
+                       memcpy(key, adapter->rss_key, sizeof(adapter->rss_key));
 
-       spin_lock_bh(&adapter->mbx_lock);
-       if (indir)
-               err = ixgbevf_get_reta_locked(&adapter->hw, indir,
-                                             adapter->num_rx_queues);
+               if (indir) {
+                       int i;
 
-       if (!err && key)
-               err = ixgbevf_get_rss_key_locked(&adapter->hw, key);
+                       for (i = 0; i < IXGBEVF_X550_VFRETA_SIZE; i++)
+                               indir[i] = adapter->rss_indir_tbl[i];
+               }
+       } else {
+               /* If neither indirection table nor hash key was requested
+                *  - just return a success avoiding taking any locks.
+                */
+               if (!indir && !key)
+                       return 0;
 
-       spin_unlock_bh(&adapter->mbx_lock);
+               spin_lock_bh(&adapter->mbx_lock);
+               if (indir)
+                       err = ixgbevf_get_reta_locked(&adapter->hw, indir,
+                                                     adapter->num_rx_queues);
+
+               if (!err && key)
+                       err = ixgbevf_get_rss_key_locked(&adapter->hw, key);
+
+               spin_unlock_bh(&adapter->mbx_lock);
+       }
 
        return err;
 }