igb: remove unecessary q_vector declarations and remove itr_shift

This change removes the use of itr_shift since a mac type call can be
used just as easily to identify the only HW that needs to have the itr
shifted.

In addition it removes two unecessary declarations of a q_vector
pointer from the initialization path.

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>
This commit is contained in:
Alexander Duyck 2010-02-17 01:00:41 +00:00 committed by David S. Miller
parent 9874c41cd5
commit 26b39276ca
2 changed files with 13 additions and 13 deletions

View File

@ -176,7 +176,6 @@ struct igb_q_vector {
u16 itr_val; u16 itr_val;
u8 set_itr; u8 set_itr;
u8 itr_shift;
void __iomem *itr_register; void __iomem *itr_register;
char name[IFNAMSIZ + 9]; char name[IFNAMSIZ + 9];

View File

@ -504,6 +504,12 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
BUG(); BUG();
break; break;
} }
/* add q_vector eims value to global eims_enable_mask */
adapter->eims_enable_mask |= q_vector->eims_value;
/* configure q_vector to set itr on first interrupt */
q_vector->set_itr = 1;
} }
/** /**
@ -561,11 +567,8 @@ static void igb_configure_msix(struct igb_adapter *adapter)
adapter->eims_enable_mask |= adapter->eims_other; adapter->eims_enable_mask |= adapter->eims_other;
for (i = 0; i < adapter->num_q_vectors; i++) { for (i = 0; i < adapter->num_q_vectors; i++)
struct igb_q_vector *q_vector = adapter->q_vector[i]; igb_assign_vector(adapter->q_vector[i], vector++);
igb_assign_vector(q_vector, vector++);
adapter->eims_enable_mask |= q_vector->eims_value;
}
wrfl(); wrfl();
} }
@ -756,10 +759,8 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter)
if (!q_vector) if (!q_vector)
goto err_out; goto err_out;
q_vector->adapter = adapter; q_vector->adapter = adapter;
q_vector->itr_shift = (hw->mac.type == e1000_82575) ? 16 : 0;
q_vector->itr_register = hw->hw_addr + E1000_EITR(0); q_vector->itr_register = hw->hw_addr + E1000_EITR(0);
q_vector->itr_val = IGB_START_ITR; q_vector->itr_val = IGB_START_ITR;
q_vector->set_itr = 1;
netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64); netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64);
adapter->q_vector[v_idx] = q_vector; adapter->q_vector[v_idx] = q_vector;
} }
@ -4142,6 +4143,7 @@ static irqreturn_t igb_msix_other(int irq, void *data)
static void igb_write_itr(struct igb_q_vector *q_vector) static void igb_write_itr(struct igb_q_vector *q_vector)
{ {
struct igb_adapter *adapter = q_vector->adapter;
u32 itr_val = q_vector->itr_val & 0x7FFC; u32 itr_val = q_vector->itr_val & 0x7FFC;
if (!q_vector->set_itr) if (!q_vector->set_itr)
@ -4150,8 +4152,8 @@ static void igb_write_itr(struct igb_q_vector *q_vector)
if (!itr_val) if (!itr_val)
itr_val = 0x4; itr_val = 0x4;
if (q_vector->itr_shift) if (adapter->hw.mac.type == e1000_82575)
itr_val |= itr_val << q_vector->itr_shift; itr_val |= itr_val << 16;
else else
itr_val |= 0x8000000; itr_val |= 0x8000000;
@ -4228,9 +4230,8 @@ static void igb_setup_dca(struct igb_adapter *adapter)
wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2); wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
for (i = 0; i < adapter->num_q_vectors; i++) { for (i = 0; i < adapter->num_q_vectors; i++) {
struct igb_q_vector *q_vector = adapter->q_vector[i]; adapter->q_vector[i]->cpu = -1;
q_vector->cpu = -1; igb_update_dca(adapter->q_vector[i]);
igb_update_dca(q_vector);
} }
} }