i40e: fix XPS mask when resetting
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Thu, 26 Feb 2015 16:13:22 +0000 (16:13 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 5 Mar 2015 12:57:33 +0000 (04:57 -0800)
During resets (possibly caused by a Tx hang) the driver would
accidentally clear the XPS mask for all queues back to 0.

This caused higher CPU utilization and had some other performance impacts
for transmit tests.

Change-ID: I95f112432c9e643a153eaa31cd28cdcbfdd01831
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 620dd237cce4ff6369a74c66b44799dfca0d538f..a287cc84597a60c052d60baaa6e1ed9c7f668495 100644 (file)
@@ -2399,20 +2399,20 @@ static void i40e_config_xps_tx_ring(struct i40e_ring *ring)
        struct i40e_vsi *vsi = ring->vsi;
        cpumask_var_t mask;
 
-       if (ring->q_vector && ring->netdev) {
-               /* Single TC mode enable XPS */
-               if (vsi->tc_config.numtc <= 1 &&
-                   !test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state)) {
+       if (!ring->q_vector || !ring->netdev)
+               return;
+
+       /* Single TC mode enable XPS */
+       if (vsi->tc_config.numtc <= 1) {
+               if (!test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state))
                        netif_set_xps_queue(ring->netdev,
                                            &ring->q_vector->affinity_mask,
                                            ring->queue_index);
-               } else if (alloc_cpumask_var(&mask, GFP_KERNEL)) {
-                       /* Disable XPS to allow selection based on TC */
-                       bitmap_zero(cpumask_bits(mask), nr_cpumask_bits);
-                       netif_set_xps_queue(ring->netdev, mask,
-                                           ring->queue_index);
-                       free_cpumask_var(mask);
-               }
+       } else if (alloc_cpumask_var(&mask, GFP_KERNEL)) {
+               /* Disable XPS to allow selection based on TC */
+               bitmap_zero(cpumask_bits(mask), nr_cpumask_bits);
+               netif_set_xps_queue(ring->netdev, mask, ring->queue_index);
+               free_cpumask_var(mask);
        }
 }