i40e: Fix dangling ring pointers upon driver removal
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Tue, 3 Jun 2014 23:50:14 +0000 (23:50 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 20 Jun 2014 03:22:03 +0000 (20:22 -0700)
When we resize the number of queues, the driver needs to disassociate any
qvectors that are no longer in use from the original rings, this way we
do not try to access the rings through these qvectors at the time of freeing
the qvectors.

Change-ID: Ie4eb9fc749f8e12348517fe1560f599c58f4a2a4
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 95c331abee438338244a6345322c2608e226ec4a..7d2aeeb6318fee83e065a8183e29f1a98e40713e 100644 (file)
@@ -3151,8 +3151,12 @@ static void i40e_vsi_map_rings_to_vectors(struct i40e_vsi *vsi)
 
        /* If we don't have enough vectors for a 1-to-1 mapping, we'll have to
         * group them so there are multiple queues per vector.
+        * It is also important to go through all the vectors available to be
+        * sure that if we don't use all the vectors, that the remaining vectors
+        * are cleared. This is especially important when decreasing the
+        * number of queues in use.
         */
-       for (; v_start < q_vectors && qp_remaining; v_start++) {
+       for (; v_start < q_vectors; v_start++) {
                struct i40e_q_vector *q_vector = vsi->q_vectors[v_start];
 
                num_ringpairs = DIV_ROUND_UP(qp_remaining, q_vectors - v_start);