OSDN Git Service

i40evf: fix ring to vector mapping
authorAlan Brady <alan.brady@intel.com>
Fri, 14 Jul 2017 13:27:07 +0000 (09:27 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 29 Sep 2017 19:51:01 +0000 (12:51 -0700)
commitc97fc9b6a798f4253c176231ba0aceda6b59b058
treee7153be8bbe9123f9f310257a69f3cddfaa786cd
parentb980c0634fe56928a45cc3c0f688d96e36705403
i40evf: fix ring to vector mapping

The current implementation for mapping queues to vectors is broken
because it attempts to map each Tx and Rx ring to its own vector,
however we use combined queues so we should actually be mapping the
Tx/Rx rings together on one vector.

Also in the current implementation, in the case where we have more
queues than vectors, we attempt to group the queues together into
'chunks' and map each 'chunk' of queues to a vector.  Chunking them
together would be more ideal if, and only if, we only had RSS because of
the way the hashing algorithm works but in the case of a future patch
that enables VF ADq, round robin assignment is better and still works
with RSS.

This patch resolves both those issues and simplifies the code needed to
accomplish this.  Instead of treating the case where we have more queues
than vectors as special, if we notice our vector index is greater than
vectors, reset the vector index to zero and continue mapping.  This
should ensure that in both cases, whether we have enough vectors for
each queue or not, the queues get appropriately mapped.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c