diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2010-08-19 09:40:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-19 19:44:27 -0400 |
commit | 31f05a2d875327ef133ac4b62261c4b875d1d10c (patch) | |
tree | 9a43b360c95d8648466c2f38a496175bae384b55 /drivers/net/ixgbe | |
parent | 9e10e045f8223e09f2c70cd6849ff86803d50c88 (diff) |
ixgbe: update all DESC_ADV macros to accept a ring pointer
All of the DESC_ADV macros are currently needing the pointers to be
de-referenced before accessing the ring. Instead of having to add all of
the asterisks it is easier to just update the macro to expect a pointer to
the ring.
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/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 6 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 4 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_fcoe.c | 2 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 24 |
4 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 7233fef7e9b8..ac4b90edb58e 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -256,11 +256,11 @@ struct ixgbe_q_vector { | |||
256 | (R)->next_to_clean - (R)->next_to_use - 1) | 256 | (R)->next_to_clean - (R)->next_to_use - 1) |
257 | 257 | ||
258 | #define IXGBE_RX_DESC_ADV(R, i) \ | 258 | #define IXGBE_RX_DESC_ADV(R, i) \ |
259 | (&(((union ixgbe_adv_rx_desc *)((R).desc))[i])) | 259 | (&(((union ixgbe_adv_rx_desc *)((R)->desc))[i])) |
260 | #define IXGBE_TX_DESC_ADV(R, i) \ | 260 | #define IXGBE_TX_DESC_ADV(R, i) \ |
261 | (&(((union ixgbe_adv_tx_desc *)((R).desc))[i])) | 261 | (&(((union ixgbe_adv_tx_desc *)((R)->desc))[i])) |
262 | #define IXGBE_TX_CTXTDESC_ADV(R, i) \ | 262 | #define IXGBE_TX_CTXTDESC_ADV(R, i) \ |
263 | (&(((struct ixgbe_adv_tx_context_desc *)((R).desc))[i])) | 263 | (&(((struct ixgbe_adv_tx_context_desc *)((R)->desc))[i])) |
264 | 264 | ||
265 | #define IXGBE_MAX_JUMBO_FRAME_SIZE 16128 | 265 | #define IXGBE_MAX_JUMBO_FRAME_SIZE 16128 |
266 | #ifdef IXGBE_FCOE | 266 | #ifdef IXGBE_FCOE |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index fb6d8e88eb05..4d74f4bc7a01 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -1560,7 +1560,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter) | |||
1560 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(0), reg_data); | 1560 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(0), reg_data); |
1561 | 1561 | ||
1562 | for (i = 0; i < tx_ring->count; i++) { | 1562 | for (i = 0; i < tx_ring->count; i++) { |
1563 | union ixgbe_adv_tx_desc *desc = IXGBE_TX_DESC_ADV(*tx_ring, i); | 1563 | union ixgbe_adv_tx_desc *desc = IXGBE_TX_DESC_ADV(tx_ring, i); |
1564 | struct sk_buff *skb; | 1564 | struct sk_buff *skb; |
1565 | unsigned int size = 1024; | 1565 | unsigned int size = 1024; |
1566 | 1566 | ||
@@ -1661,7 +1661,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter) | |||
1661 | 1661 | ||
1662 | for (i = 0; i < rx_ring->count; i++) { | 1662 | for (i = 0; i < rx_ring->count; i++) { |
1663 | union ixgbe_adv_rx_desc *rx_desc = | 1663 | union ixgbe_adv_rx_desc *rx_desc = |
1664 | IXGBE_RX_DESC_ADV(*rx_ring, i); | 1664 | IXGBE_RX_DESC_ADV(rx_ring, i); |
1665 | struct sk_buff *skb; | 1665 | struct sk_buff *skb; |
1666 | 1666 | ||
1667 | skb = alloc_skb(IXGBE_RXBUFFER_2048 + NET_IP_ALIGN, GFP_KERNEL); | 1667 | skb = alloc_skb(IXGBE_RXBUFFER_2048 + NET_IP_ALIGN, GFP_KERNEL); |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index 072327c5e41a..86fa07cb061d 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
@@ -471,7 +471,7 @@ int ixgbe_fso(struct ixgbe_adapter *adapter, | |||
471 | 471 | ||
472 | /* write context desc */ | 472 | /* write context desc */ |
473 | i = tx_ring->next_to_use; | 473 | i = tx_ring->next_to_use; |
474 | context_desc = IXGBE_TX_CTXTDESC_ADV(*tx_ring, i); | 474 | context_desc = IXGBE_TX_CTXTDESC_ADV(tx_ring, i); |
475 | context_desc->vlan_macip_lens = cpu_to_le32(vlan_macip_lens); | 475 | context_desc->vlan_macip_lens = cpu_to_le32(vlan_macip_lens); |
476 | context_desc->seqnum_seed = cpu_to_le32(fcoe_sof_eof); | 476 | context_desc->seqnum_seed = cpu_to_le32(fcoe_sof_eof); |
477 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd); | 477 | context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index c88ba13c1131..85ecf0e39b99 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -385,7 +385,7 @@ static void ixgbe_dump(struct ixgbe_adapter *adapter) | |||
385 | "leng ntw timestamp bi->skb\n"); | 385 | "leng ntw timestamp bi->skb\n"); |
386 | 386 | ||
387 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { | 387 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { |
388 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i); | 388 | tx_desc = IXGBE_TX_DESC_ADV(tx_ring, i); |
389 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; | 389 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; |
390 | u0 = (struct my_u0 *)tx_desc; | 390 | u0 = (struct my_u0 *)tx_desc; |
391 | printk(KERN_INFO "T [0x%03X] %016llX %016llX %016llX" | 391 | printk(KERN_INFO "T [0x%03X] %016llX %016llX %016llX" |
@@ -466,7 +466,7 @@ rx_ring_summary: | |||
466 | 466 | ||
467 | for (i = 0; i < rx_ring->count; i++) { | 467 | for (i = 0; i < rx_ring->count; i++) { |
468 | rx_buffer_info = &rx_ring->rx_buffer_info[i]; | 468 | rx_buffer_info = &rx_ring->rx_buffer_info[i]; |
469 | rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i); | 469 | rx_desc = IXGBE_RX_DESC_ADV(rx_ring, i); |
470 | u0 = (struct my_u0 *)rx_desc; | 470 | u0 = (struct my_u0 *)rx_desc; |
471 | staterr = le32_to_cpu(rx_desc->wb.upper.status_error); | 471 | staterr = le32_to_cpu(rx_desc->wb.upper.status_error); |
472 | if (staterr & IXGBE_RXD_STAT_DD) { | 472 | if (staterr & IXGBE_RXD_STAT_DD) { |
@@ -695,7 +695,7 @@ static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, | |||
695 | ixgbe_tx_xon_state(adapter, tx_ring)) { | 695 | ixgbe_tx_xon_state(adapter, tx_ring)) { |
696 | /* detected Tx unit hang */ | 696 | /* detected Tx unit hang */ |
697 | union ixgbe_adv_tx_desc *tx_desc; | 697 | union ixgbe_adv_tx_desc *tx_desc; |
698 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 698 | tx_desc = IXGBE_TX_DESC_ADV(tx_ring, eop); |
699 | e_err(drv, "Detected Tx Unit Hang\n" | 699 | e_err(drv, "Detected Tx Unit Hang\n" |
700 | " Tx Queue <%d>\n" | 700 | " Tx Queue <%d>\n" |
701 | " TDH, TDT <%x>, <%x>\n" | 701 | " TDH, TDT <%x>, <%x>\n" |
@@ -743,7 +743,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
743 | 743 | ||
744 | i = tx_ring->next_to_clean; | 744 | i = tx_ring->next_to_clean; |
745 | eop = tx_ring->tx_buffer_info[i].next_to_watch; | 745 | eop = tx_ring->tx_buffer_info[i].next_to_watch; |
746 | eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 746 | eop_desc = IXGBE_TX_DESC_ADV(tx_ring, eop); |
747 | 747 | ||
748 | while ((eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)) && | 748 | while ((eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)) && |
749 | (count < tx_ring->work_limit)) { | 749 | (count < tx_ring->work_limit)) { |
@@ -751,7 +751,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
751 | rmb(); /* read buffer_info after eop_desc */ | 751 | rmb(); /* read buffer_info after eop_desc */ |
752 | for ( ; !cleaned; count++) { | 752 | for ( ; !cleaned; count++) { |
753 | struct sk_buff *skb; | 753 | struct sk_buff *skb; |
754 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i); | 754 | tx_desc = IXGBE_TX_DESC_ADV(tx_ring, i); |
755 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; | 755 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; |
756 | cleaned = (i == eop); | 756 | cleaned = (i == eop); |
757 | skb = tx_buffer_info->skb; | 757 | skb = tx_buffer_info->skb; |
@@ -791,7 +791,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, | |||
791 | } | 791 | } |
792 | 792 | ||
793 | eop = tx_ring->tx_buffer_info[i].next_to_watch; | 793 | eop = tx_ring->tx_buffer_info[i].next_to_watch; |
794 | eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 794 | eop_desc = IXGBE_TX_DESC_ADV(tx_ring, eop); |
795 | } | 795 | } |
796 | 796 | ||
797 | tx_ring->next_to_clean = i; | 797 | tx_ring->next_to_clean = i; |
@@ -1047,7 +1047,7 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
1047 | bi = &rx_ring->rx_buffer_info[i]; | 1047 | bi = &rx_ring->rx_buffer_info[i]; |
1048 | 1048 | ||
1049 | while (cleaned_count--) { | 1049 | while (cleaned_count--) { |
1050 | rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i); | 1050 | rx_desc = IXGBE_RX_DESC_ADV(rx_ring, i); |
1051 | 1051 | ||
1052 | if (!bi->page_dma && | 1052 | if (!bi->page_dma && |
1053 | (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)) { | 1053 | (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)) { |
@@ -1188,7 +1188,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1188 | #endif /* IXGBE_FCOE */ | 1188 | #endif /* IXGBE_FCOE */ |
1189 | 1189 | ||
1190 | i = rx_ring->next_to_clean; | 1190 | i = rx_ring->next_to_clean; |
1191 | rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i); | 1191 | rx_desc = IXGBE_RX_DESC_ADV(rx_ring, i); |
1192 | staterr = le32_to_cpu(rx_desc->wb.upper.status_error); | 1192 | staterr = le32_to_cpu(rx_desc->wb.upper.status_error); |
1193 | rx_buffer_info = &rx_ring->rx_buffer_info[i]; | 1193 | rx_buffer_info = &rx_ring->rx_buffer_info[i]; |
1194 | 1194 | ||
@@ -1263,7 +1263,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1263 | if (i == rx_ring->count) | 1263 | if (i == rx_ring->count) |
1264 | i = 0; | 1264 | i = 0; |
1265 | 1265 | ||
1266 | next_rxd = IXGBE_RX_DESC_ADV(*rx_ring, i); | 1266 | next_rxd = IXGBE_RX_DESC_ADV(rx_ring, i); |
1267 | prefetch(next_rxd); | 1267 | prefetch(next_rxd); |
1268 | cleaned_count++; | 1268 | cleaned_count++; |
1269 | 1269 | ||
@@ -5813,7 +5813,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
5813 | i = tx_ring->next_to_use; | 5813 | i = tx_ring->next_to_use; |
5814 | 5814 | ||
5815 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; | 5815 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; |
5816 | context_desc = IXGBE_TX_CTXTDESC_ADV(*tx_ring, i); | 5816 | context_desc = IXGBE_TX_CTXTDESC_ADV(tx_ring, i); |
5817 | 5817 | ||
5818 | /* VLAN MACLEN IPLEN */ | 5818 | /* VLAN MACLEN IPLEN */ |
5819 | if (tx_flags & IXGBE_TX_FLAGS_VLAN) | 5819 | if (tx_flags & IXGBE_TX_FLAGS_VLAN) |
@@ -5872,7 +5872,7 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | |||
5872 | (tx_flags & IXGBE_TX_FLAGS_VLAN)) { | 5872 | (tx_flags & IXGBE_TX_FLAGS_VLAN)) { |
5873 | i = tx_ring->next_to_use; | 5873 | i = tx_ring->next_to_use; |
5874 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; | 5874 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; |
5875 | context_desc = IXGBE_TX_CTXTDESC_ADV(*tx_ring, i); | 5875 | context_desc = IXGBE_TX_CTXTDESC_ADV(tx_ring, i); |
5876 | 5876 | ||
5877 | if (tx_flags & IXGBE_TX_FLAGS_VLAN) | 5877 | if (tx_flags & IXGBE_TX_FLAGS_VLAN) |
5878 | vlan_macip_lens |= | 5878 | vlan_macip_lens |= |
@@ -6101,7 +6101,7 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | |||
6101 | i = tx_ring->next_to_use; | 6101 | i = tx_ring->next_to_use; |
6102 | while (count--) { | 6102 | while (count--) { |
6103 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; | 6103 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; |
6104 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i); | 6104 | tx_desc = IXGBE_TX_DESC_ADV(tx_ring, i); |
6105 | tx_desc->read.buffer_addr = cpu_to_le64(tx_buffer_info->dma); | 6105 | tx_desc->read.buffer_addr = cpu_to_le64(tx_buffer_info->dma); |
6106 | tx_desc->read.cmd_type_len = | 6106 | tx_desc->read.cmd_type_len = |
6107 | cpu_to_le32(cmd_type_len | tx_buffer_info->length); | 6107 | cpu_to_le32(cmd_type_len | tx_buffer_info->length); |