aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 11:51:27 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 04:20:24 -0400
commitfce99e341524c204ef3dd3e7c5f77265a7e05ddd (patch)
treede53c88cf94f52431f5fb662043c5c2dc15a7d90
parent952f72a8ceee3996ef8476a2f05ece1627080c20 (diff)
igb: change the head and tail offsets into pointers
Since we are writting to the head/tail pointers frequently we might as well save ourselves some processing time by converting the head and tail offsets directly to pointers. This will shave a few cycles off the rx/tx path and allows us to move one step closer to the rings being a bit more independant of each other. 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>
-rw-r--r--drivers/net/igb/igb.h4
-rw-r--r--drivers/net/igb/igb_main.c32
2 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 303df02a6907..e52fee44aeac 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -178,8 +178,8 @@ struct igb_ring {
178 unsigned int count; /* number of desc. in the ring */ 178 unsigned int count; /* number of desc. in the ring */
179 u16 next_to_use; 179 u16 next_to_use;
180 u16 next_to_clean; 180 u16 next_to_clean;
181 u16 head; 181 void __iomem *head;
182 u16 tail; 182 void __iomem *tail;
183 struct igb_buffer *buffer_info; /* array of buffer info structs */ 183 struct igb_buffer *buffer_info; /* array of buffer info structs */
184 184
185 u8 queue_index; 185 u8 queue_index;
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index dfca8217c5ea..2728f9316027 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2124,10 +2124,10 @@ static void igb_configure_tx_ring(struct igb_adapter *adapter,
2124 tdba & 0x00000000ffffffffULL); 2124 tdba & 0x00000000ffffffffULL);
2125 wr32(E1000_TDBAH(reg_idx), tdba >> 32); 2125 wr32(E1000_TDBAH(reg_idx), tdba >> 32);
2126 2126
2127 ring->head = E1000_TDH(reg_idx); 2127 ring->head = hw->hw_addr + E1000_TDH(reg_idx);
2128 ring->tail = E1000_TDT(reg_idx); 2128 ring->tail = hw->hw_addr + E1000_TDT(reg_idx);
2129 writel(0, hw->hw_addr + ring->tail); 2129 writel(0, ring->head);
2130 writel(0, hw->hw_addr + ring->head); 2130 writel(0, ring->tail);
2131 2131
2132 txdctl |= IGB_TX_PTHRESH; 2132 txdctl |= IGB_TX_PTHRESH;
2133 txdctl |= IGB_TX_HTHRESH << 8; 2133 txdctl |= IGB_TX_HTHRESH << 8;
@@ -2354,10 +2354,10 @@ static void igb_configure_rx_ring(struct igb_adapter *adapter,
2354 ring->count * sizeof(union e1000_adv_rx_desc)); 2354 ring->count * sizeof(union e1000_adv_rx_desc));
2355 2355
2356 /* initialize head and tail */ 2356 /* initialize head and tail */
2357 ring->head = E1000_RDH(reg_idx); 2357 ring->head = hw->hw_addr + E1000_RDH(reg_idx);
2358 ring->tail = E1000_RDT(reg_idx); 2358 ring->tail = hw->hw_addr + E1000_RDT(reg_idx);
2359 writel(0, hw->hw_addr + ring->head); 2359 writel(0, ring->head);
2360 writel(0, hw->hw_addr + ring->tail); 2360 writel(0, ring->tail);
2361 2361
2362 /* set descriptor configuration */ 2362 /* set descriptor configuration */
2363 if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) { 2363 if (adapter->rx_buffer_len < IGB_RXBUFFER_1024) {
@@ -2567,8 +2567,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
2567 tx_ring->next_to_use = 0; 2567 tx_ring->next_to_use = 0;
2568 tx_ring->next_to_clean = 0; 2568 tx_ring->next_to_clean = 0;
2569 2569
2570 writel(0, adapter->hw.hw_addr + tx_ring->head); 2570 writel(0, tx_ring->head);
2571 writel(0, adapter->hw.hw_addr + tx_ring->tail); 2571 writel(0, tx_ring->tail);
2572} 2572}
2573 2573
2574/** 2574/**
@@ -2667,8 +2667,8 @@ static void igb_clean_rx_ring(struct igb_ring *rx_ring)
2667 rx_ring->next_to_clean = 0; 2667 rx_ring->next_to_clean = 0;
2668 rx_ring->next_to_use = 0; 2668 rx_ring->next_to_use = 0;
2669 2669
2670 writel(0, adapter->hw.hw_addr + rx_ring->head); 2670 writel(0, rx_ring->head);
2671 writel(0, adapter->hw.hw_addr + rx_ring->tail); 2671 writel(0, rx_ring->tail);
2672} 2672}
2673 2673
2674/** 2674/**
@@ -3556,7 +3556,7 @@ static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
3556 wmb(); 3556 wmb();
3557 3557
3558 tx_ring->next_to_use = i; 3558 tx_ring->next_to_use = i;
3559 writel(i, adapter->hw.hw_addr + tx_ring->tail); 3559 writel(i, tx_ring->tail);
3560 /* we need this if more than one processor can write to our tail 3560 /* we need this if more than one processor can write to our tail
3561 * at a time, it syncronizes IO on IA64/Altix systems */ 3561 * at a time, it syncronizes IO on IA64/Altix systems */
3562 mmiowb(); 3562 mmiowb();
@@ -4761,8 +4761,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
4761 " jiffies <%lx>\n" 4761 " jiffies <%lx>\n"
4762 " desc.status <%x>\n", 4762 " desc.status <%x>\n",
4763 tx_ring->queue_index, 4763 tx_ring->queue_index,
4764 readl(adapter->hw.hw_addr + tx_ring->head), 4764 readl(tx_ring->head),
4765 readl(adapter->hw.hw_addr + tx_ring->tail), 4765 readl(tx_ring->tail),
4766 tx_ring->next_to_use, 4766 tx_ring->next_to_use,
4767 tx_ring->next_to_clean, 4767 tx_ring->next_to_clean,
4768 tx_ring->buffer_info[i].time_stamp, 4768 tx_ring->buffer_info[i].time_stamp,
@@ -5103,7 +5103,7 @@ no_buffers:
5103 * applicable for weak-ordered memory model archs, 5103 * applicable for weak-ordered memory model archs,
5104 * such as IA-64). */ 5104 * such as IA-64). */
5105 wmb(); 5105 wmb();
5106 writel(i, adapter->hw.hw_addr + rx_ring->tail); 5106 writel(i, rx_ring->tail);
5107 } 5107 }
5108} 5108}
5109 5109