aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 19:49:40 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 06:25:50 -0400
commitee1b9f06dca9c406b159904e9b13ea2dfa5ed037 (patch)
tree6f7999311ba66b2d1abea54479309826dda3fc36 /drivers/net/igb
parent439705e1d7281cc8a4631a2dc390df7ad868bad8 (diff)
igb: change queue ordering for 82576 based adapters
This patch changes the queue ordering for 82576 adapters so that if VFs are enabled the queues will first be allocated out of the PF pool. Any remaining queues will be allocated out of other VMDq pools. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb_main.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index e67ff0ea2a56..52c43021c13d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -285,7 +285,7 @@ module_exit(igb_exit_module);
285 **/ 285 **/
286static void igb_cache_ring_register(struct igb_adapter *adapter) 286static void igb_cache_ring_register(struct igb_adapter *adapter)
287{ 287{
288 int i; 288 int i = 0, j = 0;
289 u32 rbase_offset = adapter->vfs_allocated_count; 289 u32 rbase_offset = adapter->vfs_allocated_count;
290 290
291 switch (adapter->hw.mac.type) { 291 switch (adapter->hw.mac.type) {
@@ -295,19 +295,20 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
295 * In order to avoid collision we start at the first free queue 295 * In order to avoid collision we start at the first free queue
296 * and continue consuming queues in the same sequence 296 * and continue consuming queues in the same sequence
297 */ 297 */
298 for (i = 0; i < adapter->num_rx_queues; i++) 298 if (adapter->vfs_allocated_count) {
299 adapter->rx_ring[i].reg_idx = rbase_offset + 299 for (; i < adapter->num_rx_queues; i++)
300 Q_IDX_82576(i); 300 adapter->rx_ring[i].reg_idx = rbase_offset +
301 for (i = 0; i < adapter->num_tx_queues; i++) 301 Q_IDX_82576(i);
302 adapter->tx_ring[i].reg_idx = rbase_offset + 302 for (; j < adapter->num_tx_queues; j++)
303 Q_IDX_82576(i); 303 adapter->tx_ring[j].reg_idx = rbase_offset +
304 break; 304 Q_IDX_82576(j);
305 }
305 case e1000_82575: 306 case e1000_82575:
306 default: 307 default:
307 for (i = 0; i < adapter->num_rx_queues; i++) 308 for (; i < adapter->num_rx_queues; i++)
308 adapter->rx_ring[i].reg_idx = i; 309 adapter->rx_ring[i].reg_idx = rbase_offset + i;
309 for (i = 0; i < adapter->num_tx_queues; i++) 310 for (; j < adapter->num_tx_queues; j++)
310 adapter->tx_ring[i].reg_idx = i; 311 adapter->tx_ring[j].reg_idx = rbase_offset + j;
311 break; 312 break;
312 } 313 }
313} 314}