netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, gospo@redhat.com,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next-2.6 PATCH 01/18] igb: remove unecessary q_vector declarations and remove itr_shift
Date: Wed, 17 Feb 2010 03:00:41 -0800	[thread overview]
Message-ID: <20100217105953.17723.36633.stgit@localhost.localdomain> (raw)

From: Alexander Duyck <alexander.h.duyck@intel.com>

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 declrations 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>
---

 drivers/net/igb/igb.h      |    1 -
 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 83ea117..0efd285 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -176,7 +176,6 @@ struct igb_q_vector {
 
 	u16 itr_val;
 	u8 set_itr;
-	u8 itr_shift;
 	void __iomem *itr_register;
 
 	char name[IFNAMSIZ + 9];
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 4fe7b0b..677b5f5 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)
 		BUG();
 		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;
 
-	for (i = 0; i < adapter->num_q_vectors; i++) {
-		struct igb_q_vector *q_vector = adapter->q_vector[i];
-		igb_assign_vector(q_vector, vector++);
-		adapter->eims_enable_mask |= q_vector->eims_value;
-	}
+	for (i = 0; i < adapter->num_q_vectors; i++)
+		igb_assign_vector(adapter->q_vector[i], vector++);
 
 	wrfl();
 }
@@ -756,10 +759,8 @@ static int igb_alloc_q_vectors(struct igb_adapter *adapter)
 		if (!q_vector)
 			goto err_out;
 		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_val = IGB_START_ITR;
-		q_vector->set_itr = 1;
 		netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll, 64);
 		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)
 {
+	struct igb_adapter *adapter = q_vector->adapter;
 	u32 itr_val = q_vector->itr_val & 0x7FFC;
 
 	if (!q_vector->set_itr)
@@ -4150,8 +4152,8 @@ static void igb_write_itr(struct igb_q_vector *q_vector)
 	if (!itr_val)
 		itr_val = 0x4;
 
-	if (q_vector->itr_shift)
-		itr_val |= itr_val << q_vector->itr_shift;
+	if (adapter->hw.mac.type == e1000_82575)
+		itr_val |= itr_val << 16;
 	else
 		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);
 
 	for (i = 0; i < adapter->num_q_vectors; i++) {
-		struct igb_q_vector *q_vector = adapter->q_vector[i];
-		q_vector->cpu = -1;
-		igb_update_dca(q_vector);
+		adapter->q_vector[i]->cpu = -1;
+		igb_update_dca(adapter->q_vector[i]);
 	}
 }
 


             reply	other threads:[~2010-02-17 11:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 11:00 Jeff Kirsher [this message]
2010-02-17 11:01 ` [net-next-2.6 PATCH 02/18] igb: add support for wake-on-link Jeff Kirsher
2010-02-17 11:01 ` [net-next-2.6 PATCH 03/18] igb: Report link status in ethtool when interface is down Jeff Kirsher
2010-02-17 11:01 ` [net-next-2.6 PATCH 04/18] igb: ignore EEPROM APME check when shutting down serdes link Jeff Kirsher
2010-02-17 11:01 ` [net-next-2.6 PATCH 05/18] igb: Power down link when interface is down Jeff Kirsher
2010-02-17 11:02 ` [net-next-2.6 PATCH 06/18] igb: call pci_save_state after pci_restore_state Jeff Kirsher
2010-02-17 11:02 ` [net-next-2.6 PATCH 07/18] igb: Allocate rings seperately instead of as a block Jeff Kirsher
2010-02-17 11:02 ` [net-next-2.6 PATCH 08/18] igb: remove adaptive IFS from driver Jeff Kirsher
2010-02-17 11:03 ` [net-next-2.6 PATCH 09/18] igb: cap interrupts at 20K per queue when in itr mode 3 Jeff Kirsher
2010-02-17 11:03 ` [net-next-2.6 PATCH 10/18] igb: only support SRRCTL_DROP_EN when using multiple queues Jeff Kirsher
2010-02-17 11:03 ` [net-next-2.6 PATCH 11/18] igb: only read phy specific stats if in internal phy mode Jeff Kirsher
2010-02-17 11:04 ` [net-next-2.6 PATCH 12/18] igb: inline igb_maybe_stop_tx Jeff Kirsher
2010-02-17 11:04 ` [net-next-2.6 PATCH 13/18] igb: move gso_segs into buffer_info structure Jeff Kirsher
2010-02-17 11:04 ` [net-next-2.6 PATCH 14/18] igb: minor type cleanups Jeff Kirsher
2010-02-17 11:05 ` [net-next-2.6 PATCH 15/18] igb: remove unused vmolr value Jeff Kirsher
2010-02-17 11:05 ` [net-next-2.6 PATCH 16/18] igb: use igb_free_q_vectors to cleanup failure in igb_alloc_q_vectors Jeff Kirsher
2010-02-17 11:05 ` [net-next-2.6 PATCH 17/18] igb: change descriptor control thresholds Jeff Kirsher
2010-02-17 11:06 ` [net-next-2.6 PATCH 18/18] igb: update tx DMA mapping error handling Jeff Kirsher
2010-02-17 21:51 ` [net-next-2.6 PATCH 01/18] igb: remove unecessary q_vector declarations and remove itr_shift David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100217105953.17723.36633.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).