|
@@ -1435,41 +1435,22 @@ restart_watchdog:
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * next_queue - increment to next available tx queue
|
|
|
- * @adapter: board private structure
|
|
|
- * @j: queue counter
|
|
|
- *
|
|
|
- * Helper function for RSS programming to increment through available
|
|
|
- * queus. Returns the next queue value.
|
|
|
- **/
|
|
|
-static int next_queue(struct i40evf_adapter *adapter, int j)
|
|
|
-{
|
|
|
- j += 1;
|
|
|
-
|
|
|
- return j >= adapter->num_active_queues ? 0 : j;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * i40evf_configure_rss - Prepare for RSS if used
|
|
|
+ * i40evf_configure_rss - Prepare for RSS
|
|
|
* @adapter: board private structure
|
|
|
**/
|
|
|
static void i40evf_configure_rss(struct i40evf_adapter *adapter)
|
|
|
{
|
|
|
u32 rss_key[I40E_VFQF_HKEY_MAX_INDEX + 1];
|
|
|
struct i40e_hw *hw = &adapter->hw;
|
|
|
+ u32 cqueue = 0;
|
|
|
u32 lut = 0;
|
|
|
int i, j;
|
|
|
u64 hena;
|
|
|
|
|
|
- /* No RSS for single queue. */
|
|
|
- if (adapter->num_active_queues == 1) {
|
|
|
- wr32(hw, I40E_VFQF_HENA(0), 0);
|
|
|
- wr32(hw, I40E_VFQF_HENA(1), 0);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
/* Hash type is configured by the PF - we just supply the key */
|
|
|
netdev_rss_key_fill(rss_key, sizeof(rss_key));
|
|
|
+
|
|
|
+ /* Fill out hash function seed */
|
|
|
for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
|
|
|
wr32(hw, I40E_VFQF_HKEY(i), rss_key[i]);
|
|
|
|
|
@@ -1479,16 +1460,14 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
|
|
|
wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
|
|
|
|
|
|
/* Populate the LUT with max no. of queues in round robin fashion */
|
|
|
- j = adapter->num_active_queues;
|
|
|
for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
|
|
|
- j = next_queue(adapter, j);
|
|
|
- lut = j;
|
|
|
- j = next_queue(adapter, j);
|
|
|
- lut |= j << 8;
|
|
|
- j = next_queue(adapter, j);
|
|
|
- lut |= j << 16;
|
|
|
- j = next_queue(adapter, j);
|
|
|
- lut |= j << 24;
|
|
|
+ lut = 0;
|
|
|
+ for (j = 0; j < 4; j++) {
|
|
|
+ if (cqueue == adapter->vsi_res->num_queue_pairs)
|
|
|
+ cqueue = 0;
|
|
|
+ lut |= ((cqueue) << (8 * j));
|
|
|
+ cqueue++;
|
|
|
+ }
|
|
|
wr32(hw, I40E_VFQF_HLUT(i), lut);
|
|
|
}
|
|
|
i40e_flush(hw);
|