• Home
  • Raw
  • Download

Lines Matching refs:tx_ring

191 static void ixgbevf_unmap_and_free_tx_resource(struct ixgbevf_ring *tx_ring,  in ixgbevf_unmap_and_free_tx_resource()  argument
197 dma_unmap_single(tx_ring->dev, in ixgbevf_unmap_and_free_tx_resource()
202 dma_unmap_page(tx_ring->dev, in ixgbevf_unmap_and_free_tx_resource()
228 struct ixgbevf_ring *tx_ring) in ixgbevf_clean_tx_irq() argument
234 unsigned int budget = tx_ring->count / 2; in ixgbevf_clean_tx_irq()
235 unsigned int i = tx_ring->next_to_clean; in ixgbevf_clean_tx_irq()
240 tx_buffer = &tx_ring->tx_buffer_info[i]; in ixgbevf_clean_tx_irq()
241 tx_desc = IXGBEVF_TX_DESC(tx_ring, i); in ixgbevf_clean_tx_irq()
242 i -= tx_ring->count; in ixgbevf_clean_tx_irq()
269 dma_unmap_single(tx_ring->dev, in ixgbevf_clean_tx_irq()
284 i -= tx_ring->count; in ixgbevf_clean_tx_irq()
285 tx_buffer = tx_ring->tx_buffer_info; in ixgbevf_clean_tx_irq()
286 tx_desc = IXGBEVF_TX_DESC(tx_ring, 0); in ixgbevf_clean_tx_irq()
291 dma_unmap_page(tx_ring->dev, in ixgbevf_clean_tx_irq()
304 i -= tx_ring->count; in ixgbevf_clean_tx_irq()
305 tx_buffer = tx_ring->tx_buffer_info; in ixgbevf_clean_tx_irq()
306 tx_desc = IXGBEVF_TX_DESC(tx_ring, 0); in ixgbevf_clean_tx_irq()
316 i += tx_ring->count; in ixgbevf_clean_tx_irq()
317 tx_ring->next_to_clean = i; in ixgbevf_clean_tx_irq()
318 u64_stats_update_begin(&tx_ring->syncp); in ixgbevf_clean_tx_irq()
319 tx_ring->stats.bytes += total_bytes; in ixgbevf_clean_tx_irq()
320 tx_ring->stats.packets += total_packets; in ixgbevf_clean_tx_irq()
321 u64_stats_update_end(&tx_ring->syncp); in ixgbevf_clean_tx_irq()
326 if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) && in ixgbevf_clean_tx_irq()
327 (ixgbevf_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD))) { in ixgbevf_clean_tx_irq()
333 if (__netif_subqueue_stopped(tx_ring->netdev, in ixgbevf_clean_tx_irq()
334 tx_ring->queue_index) && in ixgbevf_clean_tx_irq()
336 netif_wake_subqueue(tx_ring->netdev, in ixgbevf_clean_tx_irq()
337 tx_ring->queue_index); in ixgbevf_clean_tx_irq()
338 ++tx_ring->tx_stats.restart_queue; in ixgbevf_clean_tx_irq()
921 a->tx_ring[t_idx]->next = q_vector->tx.ring; in map_vector_to_txq()
922 q_vector->tx.ring = a->tx_ring[t_idx]; in map_vector_to_txq()
1225 ixgbevf_configure_tx_ring(adapter, adapter->tx_ring[i]); in ixgbevf_configure_tx()
1567 adapter->tx_ring[0]->reg_idx = def_q; in ixgbevf_configure_dcb()
1744 static void ixgbevf_clean_tx_ring(struct ixgbevf_ring *tx_ring) in ixgbevf_clean_tx_ring() argument
1750 if (!tx_ring->tx_buffer_info) in ixgbevf_clean_tx_ring()
1754 for (i = 0; i < tx_ring->count; i++) { in ixgbevf_clean_tx_ring()
1755 tx_buffer_info = &tx_ring->tx_buffer_info[i]; in ixgbevf_clean_tx_ring()
1756 ixgbevf_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); in ixgbevf_clean_tx_ring()
1759 size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count; in ixgbevf_clean_tx_ring()
1760 memset(tx_ring->tx_buffer_info, 0, size); in ixgbevf_clean_tx_ring()
1762 memset(tx_ring->desc, 0, tx_ring->size); in ixgbevf_clean_tx_ring()
1786 ixgbevf_clean_tx_ring(adapter->tx_ring[i]); in ixgbevf_clean_all_tx_rings()
1822 u8 reg_idx = adapter->tx_ring[i]->reg_idx; in ixgbevf_down()
1967 adapter->tx_ring[tx] = ring; in ixgbevf_alloc_queues()
1989 kfree(adapter->tx_ring[--tx]); in ixgbevf_alloc_queues()
1990 adapter->tx_ring[tx] = NULL; in ixgbevf_alloc_queues()
2190 kfree(adapter->tx_ring[i]); in ixgbevf_clear_interrupt_scheme()
2191 adapter->tx_ring[i] = NULL; in ixgbevf_clear_interrupt_scheme()
2491 void ixgbevf_free_tx_resources(struct ixgbevf_ring *tx_ring) in ixgbevf_free_tx_resources() argument
2493 ixgbevf_clean_tx_ring(tx_ring); in ixgbevf_free_tx_resources()
2495 vfree(tx_ring->tx_buffer_info); in ixgbevf_free_tx_resources()
2496 tx_ring->tx_buffer_info = NULL; in ixgbevf_free_tx_resources()
2499 if (!tx_ring->desc) in ixgbevf_free_tx_resources()
2502 dma_free_coherent(tx_ring->dev, tx_ring->size, tx_ring->desc, in ixgbevf_free_tx_resources()
2503 tx_ring->dma); in ixgbevf_free_tx_resources()
2505 tx_ring->desc = NULL; in ixgbevf_free_tx_resources()
2519 if (adapter->tx_ring[i]->desc) in ixgbevf_free_all_tx_resources()
2520 ixgbevf_free_tx_resources(adapter->tx_ring[i]); in ixgbevf_free_all_tx_resources()
2529 int ixgbevf_setup_tx_resources(struct ixgbevf_ring *tx_ring) in ixgbevf_setup_tx_resources() argument
2533 size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count; in ixgbevf_setup_tx_resources()
2534 tx_ring->tx_buffer_info = vzalloc(size); in ixgbevf_setup_tx_resources()
2535 if (!tx_ring->tx_buffer_info) in ixgbevf_setup_tx_resources()
2539 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc); in ixgbevf_setup_tx_resources()
2540 tx_ring->size = ALIGN(tx_ring->size, 4096); in ixgbevf_setup_tx_resources()
2542 tx_ring->desc = dma_alloc_coherent(tx_ring->dev, tx_ring->size, in ixgbevf_setup_tx_resources()
2543 &tx_ring->dma, GFP_KERNEL); in ixgbevf_setup_tx_resources()
2544 if (!tx_ring->desc) in ixgbevf_setup_tx_resources()
2550 vfree(tx_ring->tx_buffer_info); in ixgbevf_setup_tx_resources()
2551 tx_ring->tx_buffer_info = NULL; in ixgbevf_setup_tx_resources()
2572 err = ixgbevf_setup_tx_resources(adapter->tx_ring[i]); in ixgbevf_setup_all_tx_resources()
2814 static void ixgbevf_tx_ctxtdesc(struct ixgbevf_ring *tx_ring, in ixgbevf_tx_ctxtdesc() argument
2819 u16 i = tx_ring->next_to_use; in ixgbevf_tx_ctxtdesc()
2821 context_desc = IXGBEVF_TX_CTXTDESC(tx_ring, i); in ixgbevf_tx_ctxtdesc()
2824 tx_ring->next_to_use = (i < tx_ring->count) ? i : 0; in ixgbevf_tx_ctxtdesc()
2835 static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, in ixgbevf_tso() argument
2898 ixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens, in ixgbevf_tso()
2904 static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring, in ixgbevf_tx_csum() argument
2926 dev_warn(tx_ring->dev, in ixgbevf_tx_csum()
2950 dev_warn(tx_ring->dev, in ixgbevf_tx_csum()
2965 ixgbevf_tx_ctxtdesc(tx_ring, vlan_macip_lens, in ixgbevf_tx_csum()
3012 static void ixgbevf_tx_map(struct ixgbevf_ring *tx_ring, in ixgbevf_tx_map() argument
3026 u16 i = tx_ring->next_to_use; in ixgbevf_tx_map()
3028 tx_desc = IXGBEVF_TX_DESC(tx_ring, i); in ixgbevf_tx_map()
3033 dma = dma_map_single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE); in ixgbevf_tx_map()
3034 if (dma_mapping_error(tx_ring->dev, dma)) in ixgbevf_tx_map()
3050 if (i == tx_ring->count) { in ixgbevf_tx_map()
3051 tx_desc = IXGBEVF_TX_DESC(tx_ring, 0); in ixgbevf_tx_map()
3069 if (i == tx_ring->count) { in ixgbevf_tx_map()
3070 tx_desc = IXGBEVF_TX_DESC(tx_ring, 0); in ixgbevf_tx_map()
3077 dma = skb_frag_dma_map(tx_ring->dev, frag, 0, size, in ixgbevf_tx_map()
3079 if (dma_mapping_error(tx_ring->dev, dma)) in ixgbevf_tx_map()
3082 tx_buffer = &tx_ring->tx_buffer_info[i]; in ixgbevf_tx_map()
3112 if (i == tx_ring->count) in ixgbevf_tx_map()
3115 tx_ring->next_to_use = i; in ixgbevf_tx_map()
3118 ixgbevf_write_tail(tx_ring, i); in ixgbevf_tx_map()
3122 dev_err(tx_ring->dev, "TX DMA map failed\n"); in ixgbevf_tx_map()
3126 tx_buffer = &tx_ring->tx_buffer_info[i]; in ixgbevf_tx_map()
3127 ixgbevf_unmap_and_free_tx_resource(tx_ring, tx_buffer); in ixgbevf_tx_map()
3131 i = tx_ring->count; in ixgbevf_tx_map()
3135 tx_ring->next_to_use = i; in ixgbevf_tx_map()
3138 static int __ixgbevf_maybe_stop_tx(struct ixgbevf_ring *tx_ring, int size) in __ixgbevf_maybe_stop_tx() argument
3140 netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index); in __ixgbevf_maybe_stop_tx()
3148 if (likely(ixgbevf_desc_unused(tx_ring) < size)) in __ixgbevf_maybe_stop_tx()
3152 netif_start_subqueue(tx_ring->netdev, tx_ring->queue_index); in __ixgbevf_maybe_stop_tx()
3153 ++tx_ring->tx_stats.restart_queue; in __ixgbevf_maybe_stop_tx()
3158 static int ixgbevf_maybe_stop_tx(struct ixgbevf_ring *tx_ring, int size) in ixgbevf_maybe_stop_tx() argument
3160 if (likely(ixgbevf_desc_unused(tx_ring) >= size)) in ixgbevf_maybe_stop_tx()
3162 return __ixgbevf_maybe_stop_tx(tx_ring, size); in ixgbevf_maybe_stop_tx()
3169 struct ixgbevf_ring *tx_ring; in ixgbevf_xmit_frame() local
3184 tx_ring = adapter->tx_ring[skb->queue_mapping]; in ixgbevf_xmit_frame()
3199 if (ixgbevf_maybe_stop_tx(tx_ring, count + 3)) { in ixgbevf_xmit_frame()
3200 tx_ring->tx_stats.tx_busy++; in ixgbevf_xmit_frame()
3205 first = &tx_ring->tx_buffer_info[tx_ring->next_to_use]; in ixgbevf_xmit_frame()
3220 tso = ixgbevf_tso(tx_ring, first, &hdr_len); in ixgbevf_xmit_frame()
3224 ixgbevf_tx_csum(tx_ring, first); in ixgbevf_xmit_frame()
3226 ixgbevf_tx_map(tx_ring, first, hdr_len); in ixgbevf_xmit_frame()
3228 ixgbevf_maybe_stop_tx(tx_ring, DESC_NEEDED); in ixgbevf_xmit_frame()
3413 ring = adapter->tx_ring[i]; in ixgbevf_get_stats()