Commit 545c67c0 authored by Jeff Kirsher's avatar Jeff Kirsher Committed by Jeff Garzik

[PATCH] e1000: General Fixes

These fixes update the TX and RX ring structures.  Prepare driver for up-coming fixes.
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 9a3056da
...@@ -191,7 +191,6 @@ struct e1000_tx_ring { ...@@ -191,7 +191,6 @@ struct e1000_tx_ring {
spinlock_t tx_lock; spinlock_t tx_lock;
uint16_t tdh; uint16_t tdh;
uint16_t tdt; uint16_t tdt;
uint64_t pkt;
boolean_t last_tx_tso; boolean_t last_tx_tso;
...@@ -216,9 +215,14 @@ struct e1000_rx_ring { ...@@ -216,9 +215,14 @@ struct e1000_rx_ring {
struct e1000_ps_page *ps_page; struct e1000_ps_page *ps_page;
struct e1000_ps_page_dma *ps_page_dma; struct e1000_ps_page_dma *ps_page_dma;
struct sk_buff *rx_skb_top;
struct sk_buff *rx_skb_prev;
/* cpu for rx queue */
int cpu;
uint16_t rdh; uint16_t rdh;
uint16_t rdt; uint16_t rdt;
uint64_t pkt;
}; };
#define E1000_DESC_UNUSED(R) \ #define E1000_DESC_UNUSED(R) \
......
...@@ -2204,7 +2204,7 @@ static void ...@@ -2204,7 +2204,7 @@ static void
e1000_watchdog_task(struct e1000_adapter *adapter) e1000_watchdog_task(struct e1000_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct e1000_tx_ring *txdr = &adapter->tx_ring[0]; struct e1000_tx_ring *txdr = adapter->tx_ring;
uint32_t link; uint32_t link;
e1000_check_for_link(&adapter->hw); e1000_check_for_link(&adapter->hw);
...@@ -2314,6 +2314,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2314,6 +2314,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
{ {
#ifdef NETIF_F_TSO #ifdef NETIF_F_TSO
struct e1000_context_desc *context_desc; struct e1000_context_desc *context_desc;
struct e1000_buffer *buffer_info;
unsigned int i; unsigned int i;
uint32_t cmd_length = 0; uint32_t cmd_length = 0;
uint16_t ipcse = 0, tucse, mss; uint16_t ipcse = 0, tucse, mss;
...@@ -2363,6 +2364,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2363,6 +2364,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
i = tx_ring->next_to_use; i = tx_ring->next_to_use;
context_desc = E1000_CONTEXT_DESC(*tx_ring, i); context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
buffer_info = &tx_ring->buffer_info[i];
context_desc->lower_setup.ip_fields.ipcss = ipcss; context_desc->lower_setup.ip_fields.ipcss = ipcss;
context_desc->lower_setup.ip_fields.ipcso = ipcso; context_desc->lower_setup.ip_fields.ipcso = ipcso;
...@@ -2374,6 +2376,8 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2374,6 +2376,8 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
context_desc->tcp_seg_setup.fields.hdr_len = hdr_len; context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
context_desc->cmd_and_length = cpu_to_le32(cmd_length); context_desc->cmd_and_length = cpu_to_le32(cmd_length);
buffer_info->time_stamp = jiffies;
if (++i == tx_ring->count) i = 0; if (++i == tx_ring->count) i = 0;
tx_ring->next_to_use = i; tx_ring->next_to_use = i;
...@@ -2389,6 +2393,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2389,6 +2393,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct e1000_context_desc *context_desc; struct e1000_context_desc *context_desc;
struct e1000_buffer *buffer_info;
unsigned int i; unsigned int i;
uint8_t css; uint8_t css;
...@@ -2396,6 +2401,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2396,6 +2401,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
css = skb->h.raw - skb->data; css = skb->h.raw - skb->data;
i = tx_ring->next_to_use; i = tx_ring->next_to_use;
buffer_info = &tx_ring->buffer_info[i];
context_desc = E1000_CONTEXT_DESC(*tx_ring, i); context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
context_desc->upper_setup.tcp_fields.tucss = css; context_desc->upper_setup.tcp_fields.tucss = css;
...@@ -2404,6 +2410,8 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2404,6 +2410,8 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
context_desc->tcp_seg_setup.data = 0; context_desc->tcp_seg_setup.data = 0;
context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT); context_desc->cmd_and_length = cpu_to_le32(E1000_TXD_CMD_DEXT);
buffer_info->time_stamp = jiffies;
if (unlikely(++i == tx_ring->count)) i = 0; if (unlikely(++i == tx_ring->count)) i = 0;
tx_ring->next_to_use = i; tx_ring->next_to_use = i;
...@@ -3255,8 +3263,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3255,8 +3263,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
if(unlikely(++i == tx_ring->count)) i = 0; if(unlikely(++i == tx_ring->count)) i = 0;
} }
tx_ring->pkt++;
eop = tx_ring->buffer_info[i].next_to_watch; eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC(*tx_ring, eop); eop_desc = E1000_TX_DESC(*tx_ring, eop);
} }
...@@ -3461,7 +3467,6 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, ...@@ -3461,7 +3467,6 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
} }
#endif /* CONFIG_E1000_NAPI */ #endif /* CONFIG_E1000_NAPI */
netdev->last_rx = jiffies; netdev->last_rx = jiffies;
rx_ring->pkt++;
next_desc: next_desc:
rx_desc->status = 0; rx_desc->status = 0;
...@@ -3592,7 +3597,6 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, ...@@ -3592,7 +3597,6 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
} }
#endif /* CONFIG_E1000_NAPI */ #endif /* CONFIG_E1000_NAPI */
netdev->last_rx = jiffies; netdev->last_rx = jiffies;
rx_ring->pkt++;
next_desc: next_desc:
rx_desc->wb.middle.status_error &= ~0xFF; rx_desc->wb.middle.status_error &= ~0xFF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment