diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2010-02-16 20:00:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:21:31 -0500 |
commit | 26b39276ca5ff4dbf3c07704e34fd820fd97decf (patch) | |
tree | 5233028d2dda0553d9d83310b02b001a35aac098 /drivers/net/igb | |
parent | 9874c41cd5e70bfc97bcd52a8b6c98c2a6ba7299 (diff) |
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>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/igb.h | 1 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 25 |
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 83ea11701f45..0efd28515e6e 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h | |||
@@ -176,7 +176,6 @@ struct igb_q_vector { | |||
176 | 176 | ||
177 | u16 itr_val; | 177 | u16 itr_val; |
178 | u8 set_itr; | 178 | u8 set_itr; |
179 | u8 itr_shift; | ||
180 | void __iomem *itr_register; | 179 | void __iomem *itr_register; |
181 | 180 | ||
182 | char name[IFNAMSIZ + 9]; | 181 | char name[IFNAMSIZ + 9]; |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 4fe7b0ba6310..677b5f5ab49c 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -504,6 +504,12 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector) | |||
504 | BUG(); | 504 | BUG(); |
505 | break; | 505 | break; |
506 | } | 506 | } |
507 | |||
508 | /* add q_vector eims value to global eims_enable_mask */ | ||
509 | adapter->eims_enable_mask |= q_vector->eims_value; | ||
510 | |||
511 | /* configure q_vector to set itr on first interrupt */ | ||
512 | q_vector->set_itr = 1; | ||
507 | } | 513 | } |
508 | 514 | ||
509 | /** | 515 | /** |
@@ -561,11 +567,8 @@ static void igb_configure_msix(struct igb_adapter *adapter) | |||
561 | 567 | ||
562 | adapter->eims_enable_mask |= adapter->eims_other; | 568 | adapter->eims_enable_mask |= adapter->eims_other; |
563 | 569 | ||
564 | for (i = 0; i < adapter->num_q_vectors; i++) { | 570 | for (i = 0; i < adapter->num_q_vectors; i++) |
565 | struct igb_q_vector *q_vector = adapter->q_vector[i]; | 571 | igb_assign_vector(adapter->q_vector[i], vector++); |
566 | igb_assign_vector(q_vector, vector++); | ||
567 | adapter->eims_enable_mask |= q_vector->eims_value; | ||
568 | } | ||
569 | 572 | ||
570 | wrfl(); | 573 | wrfl(); |
571 | } | 574 | } |
@@ -756,10 +759,8 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter) | |||
756 | if (!q_vector) | 759 | if (!q_vector) |
757 | goto err_out; | 760 | goto err_out; |
758 | q_vector->adapter = adapter; | 761 | q_vector->adapter = adapter; |
759 | q_vector->itr_shift = (hw->mac.type == e1000_82575) ? 16 : 0; | ||
760 | q_vector->itr_register = hw->hw_addr + E1000_EITR(0); | 762 | q_vector->itr_register = hw->hw_addr + E1000_EITR(0); |
761 | q_vector->itr_val = IGB_START_ITR; | 763 | q_vector->itr_val = IGB_START_ITR; |
762 | q_vector->set_itr = 1; | ||
763 | netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64); | 764 | netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64); |
764 | adapter->q_vector[v_idx] = q_vector; | 765 | adapter->q_vector[v_idx] = q_vector; |
765 | } | 766 | } |
@@ -4142,6 +4143,7 @@ static irqreturn_t igb_msix_other(int irq, void *data) | |||
4142 | 4143 | ||
4143 | static void igb_write_itr(struct igb_q_vector *q_vector) | 4144 | static void igb_write_itr(struct igb_q_vector *q_vector) |
4144 | { | 4145 | { |
4146 | struct igb_adapter *adapter = q_vector->adapter; | ||
4145 | u32 itr_val = q_vector->itr_val & 0x7FFC; | 4147 | u32 itr_val = q_vector->itr_val & 0x7FFC; |
4146 | 4148 | ||
4147 | if (!q_vector->set_itr) | 4149 | if (!q_vector->set_itr) |
@@ -4150,8 +4152,8 @@ static void igb_write_itr(struct igb_q_vector *q_vector) | |||
4150 | if (!itr_val) | 4152 | if (!itr_val) |
4151 | itr_val = 0x4; | 4153 | itr_val = 0x4; |
4152 | 4154 | ||
4153 | if (q_vector->itr_shift) | 4155 | if (adapter->hw.mac.type == e1000_82575) |
4154 | itr_val |= itr_val << q_vector->itr_shift; | 4156 | itr_val |= itr_val << 16; |
4155 | else | 4157 | else |
4156 | itr_val |= 0x8000000; | 4158 | itr_val |= 0x8000000; |
4157 | 4159 | ||
@@ -4228,9 +4230,8 @@ static void igb_setup_dca(struct igb_adapter *adapter) | |||
4228 | wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2); | 4230 | wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2); |
4229 | 4231 | ||
4230 | for (i = 0; i < adapter->num_q_vectors; i++) { | 4232 | for (i = 0; i < adapter->num_q_vectors; i++) { |
4231 | struct igb_q_vector *q_vector = adapter->q_vector[i]; | 4233 | adapter->q_vector[i]->cpu = -1; |
4232 | q_vector->cpu = -1; | 4234 | igb_update_dca(adapter->q_vector[i]); |
4233 | igb_update_dca(q_vector); | ||
4234 | } | 4235 | } |
4235 | } | 4236 | } |
4236 | 4237 | ||