diff options
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 9f3168d6e239..aaee02e9e3f0 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -3254,6 +3254,13 @@ quit_polling: | |||
3254 | 3254 | ||
3255 | return 1; | 3255 | return 1; |
3256 | } | 3256 | } |
3257 | |||
3258 | static inline u32 get_head(struct igb_ring *tx_ring) | ||
3259 | { | ||
3260 | void *end = (struct e1000_tx_desc *)tx_ring->desc + tx_ring->count; | ||
3261 | return le32_to_cpu(*(volatile __le32 *)end); | ||
3262 | } | ||
3263 | |||
3257 | /** | 3264 | /** |
3258 | * igb_clean_tx_irq - Reclaim resources after transmit completes | 3265 | * igb_clean_tx_irq - Reclaim resources after transmit completes |
3259 | * @adapter: board private structure | 3266 | * @adapter: board private structure |
@@ -3275,9 +3282,7 @@ static bool igb_clean_tx_irq(struct igb_adapter *adapter, | |||
3275 | unsigned int total_bytes = 0, total_packets = 0; | 3282 | unsigned int total_bytes = 0, total_packets = 0; |
3276 | 3283 | ||
3277 | rmb(); | 3284 | rmb(); |
3278 | head = *(volatile u32 *)((struct e1000_tx_desc *)tx_ring->desc | 3285 | head = get_head(tx_ring); |
3279 | + tx_ring->count); | ||
3280 | head = le32_to_cpu(head); | ||
3281 | i = tx_ring->next_to_clean; | 3286 | i = tx_ring->next_to_clean; |
3282 | while (1) { | 3287 | while (1) { |
3283 | while (i != head) { | 3288 | while (i != head) { |
@@ -3312,9 +3317,7 @@ static bool igb_clean_tx_irq(struct igb_adapter *adapter, | |||
3312 | } | 3317 | } |
3313 | oldhead = head; | 3318 | oldhead = head; |
3314 | rmb(); | 3319 | rmb(); |
3315 | head = *(volatile u32 *)((struct e1000_tx_desc *)tx_ring->desc | 3320 | head = get_head(tx_ring); |
3316 | + tx_ring->count); | ||
3317 | head = le32_to_cpu(head); | ||
3318 | if (head == oldhead) | 3321 | if (head == oldhead) |
3319 | goto done_cleaning; | 3322 | goto done_cleaning; |
3320 | } /* while (1) */ | 3323 | } /* while (1) */ |
@@ -3388,7 +3391,7 @@ done_cleaning: | |||
3388 | * @vlan: descriptor vlan field as written by hardware (no le/be conversion) | 3391 | * @vlan: descriptor vlan field as written by hardware (no le/be conversion) |
3389 | * @skb: pointer to sk_buff to be indicated to stack | 3392 | * @skb: pointer to sk_buff to be indicated to stack |
3390 | **/ | 3393 | **/ |
3391 | static void igb_receive_skb(struct igb_adapter *adapter, u8 status, u16 vlan, | 3394 | static void igb_receive_skb(struct igb_adapter *adapter, u8 status, __le16 vlan, |
3392 | struct sk_buff *skb) | 3395 | struct sk_buff *skb) |
3393 | { | 3396 | { |
3394 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) | 3397 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) |