Lines Matching refs:tx_ring

417 			     struct igbvf_ring *tx_ring)  in igbvf_setup_tx_resources()  argument
422 size = sizeof(struct igbvf_buffer) * tx_ring->count; in igbvf_setup_tx_resources()
423 tx_ring->buffer_info = vzalloc(size); in igbvf_setup_tx_resources()
424 if (!tx_ring->buffer_info) in igbvf_setup_tx_resources()
428 tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc); in igbvf_setup_tx_resources()
429 tx_ring->size = ALIGN(tx_ring->size, 4096); in igbvf_setup_tx_resources()
431 tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size, in igbvf_setup_tx_resources()
432 &tx_ring->dma, GFP_KERNEL); in igbvf_setup_tx_resources()
433 if (!tx_ring->desc) in igbvf_setup_tx_resources()
436 tx_ring->adapter = adapter; in igbvf_setup_tx_resources()
437 tx_ring->next_to_use = 0; in igbvf_setup_tx_resources()
438 tx_ring->next_to_clean = 0; in igbvf_setup_tx_resources()
442 vfree(tx_ring->buffer_info); in igbvf_setup_tx_resources()
496 static void igbvf_clean_tx_ring(struct igbvf_ring *tx_ring) in igbvf_clean_tx_ring() argument
498 struct igbvf_adapter *adapter = tx_ring->adapter; in igbvf_clean_tx_ring()
503 if (!tx_ring->buffer_info) in igbvf_clean_tx_ring()
507 for (i = 0; i < tx_ring->count; i++) { in igbvf_clean_tx_ring()
508 buffer_info = &tx_ring->buffer_info[i]; in igbvf_clean_tx_ring()
512 size = sizeof(struct igbvf_buffer) * tx_ring->count; in igbvf_clean_tx_ring()
513 memset(tx_ring->buffer_info, 0, size); in igbvf_clean_tx_ring()
516 memset(tx_ring->desc, 0, tx_ring->size); in igbvf_clean_tx_ring()
518 tx_ring->next_to_use = 0; in igbvf_clean_tx_ring()
519 tx_ring->next_to_clean = 0; in igbvf_clean_tx_ring()
521 writel(0, adapter->hw.hw_addr + tx_ring->head); in igbvf_clean_tx_ring()
522 writel(0, adapter->hw.hw_addr + tx_ring->tail); in igbvf_clean_tx_ring()
531 void igbvf_free_tx_resources(struct igbvf_ring *tx_ring) in igbvf_free_tx_resources() argument
533 struct pci_dev *pdev = tx_ring->adapter->pdev; in igbvf_free_tx_resources()
535 igbvf_clean_tx_ring(tx_ring); in igbvf_free_tx_resources()
537 vfree(tx_ring->buffer_info); in igbvf_free_tx_resources()
538 tx_ring->buffer_info = NULL; in igbvf_free_tx_resources()
540 dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc, in igbvf_free_tx_resources()
541 tx_ring->dma); in igbvf_free_tx_resources()
543 tx_ring->desc = NULL; in igbvf_free_tx_resources()
717 adapter->tx_ring->itr_range = in igbvf_set_itr()
719 adapter->tx_ring->itr_val, in igbvf_set_itr()
725 adapter->tx_ring->itr_range == lowest_latency) in igbvf_set_itr()
726 adapter->tx_ring->itr_range = low_latency; in igbvf_set_itr()
728 new_itr = igbvf_range_to_itr(adapter->tx_ring->itr_range); in igbvf_set_itr()
730 if (new_itr != adapter->tx_ring->itr_val) { in igbvf_set_itr()
731 u32 current_itr = adapter->tx_ring->itr_val; in igbvf_set_itr()
739 adapter->tx_ring->itr_val = new_itr; in igbvf_set_itr()
741 adapter->tx_ring->set_itr = 1; in igbvf_set_itr()
772 static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) in igbvf_clean_tx_irq() argument
774 struct igbvf_adapter *adapter = tx_ring->adapter; in igbvf_clean_tx_irq()
783 i = tx_ring->next_to_clean; in igbvf_clean_tx_irq()
784 buffer_info = &tx_ring->buffer_info[i]; in igbvf_clean_tx_irq()
803 tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); in igbvf_clean_tx_irq()
823 if (i == tx_ring->count) in igbvf_clean_tx_irq()
826 buffer_info = &tx_ring->buffer_info[i]; in igbvf_clean_tx_irq()
830 } while (count < tx_ring->count); in igbvf_clean_tx_irq()
832 tx_ring->next_to_clean = i; in igbvf_clean_tx_irq()
835 igbvf_desc_unused(tx_ring) >= IGBVF_TX_QUEUE_WAKE)) { in igbvf_clean_tx_irq()
849 return count < tx_ring->count; in igbvf_clean_tx_irq()
874 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_intr_msix_tx() local
876 if (tx_ring->set_itr) { in igbvf_intr_msix_tx()
877 writel(tx_ring->itr_val, in igbvf_intr_msix_tx()
878 adapter->hw.hw_addr + tx_ring->itr_register); in igbvf_intr_msix_tx()
879 adapter->tx_ring->set_itr = 0; in igbvf_intr_msix_tx()
888 if (!igbvf_clean_tx_irq(tx_ring)) in igbvf_intr_msix_tx()
890 ew32(EICS, tx_ring->eims_value); in igbvf_intr_msix_tx()
892 ew32(EIMS, tx_ring->eims_value); in igbvf_intr_msix_tx()
962 adapter->tx_ring[tx_queue].eims_value = BIT(msix_vector); in igbvf_assign_vector()
978 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_configure_msix() local
985 adapter->eims_enable_mask |= tx_ring->eims_value; in igbvf_configure_msix()
986 writel(tx_ring->itr_val, hw->hw_addr + tx_ring->itr_register); in igbvf_configure_msix()
1055 sprintf(adapter->tx_ring->name, "%s-tx-0", netdev->name); in igbvf_request_msix()
1058 memcpy(adapter->tx_ring->name, netdev->name, IFNAMSIZ); in igbvf_request_msix()
1063 igbvf_intr_msix_tx, 0, adapter->tx_ring->name, in igbvf_request_msix()
1068 adapter->tx_ring->itr_register = E1000_EITR(vector); in igbvf_request_msix()
1069 adapter->tx_ring->itr_val = adapter->current_itr; in igbvf_request_msix()
1105 adapter->tx_ring = kzalloc(sizeof(struct igbvf_ring), GFP_KERNEL); in igbvf_alloc_queues()
1106 if (!adapter->tx_ring) in igbvf_alloc_queues()
1111 kfree(adapter->tx_ring); in igbvf_alloc_queues()
1291 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_configure_tx() local
1302 ew32(TDLEN(0), tx_ring->count * sizeof(union e1000_adv_tx_desc)); in igbvf_configure_tx()
1303 tdba = tx_ring->dma; in igbvf_configure_tx()
1308 tx_ring->head = E1000_TDH(0); in igbvf_configure_tx()
1309 tx_ring->tail = E1000_TDT(0); in igbvf_configure_tx()
1604 igbvf_clean_tx_ring(adapter->tx_ring); in igbvf_down()
1719 err = igbvf_setup_tx_resources(adapter, adapter->tx_ring); in igbvf_open()
1758 igbvf_free_tx_resources(adapter->tx_ring); in igbvf_open()
1785 igbvf_free_tx_resources(adapter->tx_ring); in igbvf_close()
1919 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_watchdog_task() local
1949 tx_pending = (igbvf_desc_unused(tx_ring) + 1 < in igbvf_watchdog_task()
1950 tx_ring->count); in igbvf_watchdog_task()
1978 static void igbvf_tx_ctxtdesc(struct igbvf_ring *tx_ring, u32 vlan_macip_lens, in igbvf_tx_ctxtdesc() argument
1983 u16 i = tx_ring->next_to_use; in igbvf_tx_ctxtdesc()
1985 context_desc = IGBVF_TX_CTXTDESC_ADV(*tx_ring, i); in igbvf_tx_ctxtdesc()
1986 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_ctxtdesc()
1989 tx_ring->next_to_use = (i < tx_ring->count) ? i : 0; in igbvf_tx_ctxtdesc()
2003 static int igbvf_tso(struct igbvf_ring *tx_ring, in igbvf_tso() argument
2072 igbvf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, mss_l4len_idx); in igbvf_tso()
2077 static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb, in igbvf_tx_csum() argument
2114 igbvf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0); in igbvf_tx_csum()
2123 if (igbvf_desc_unused(adapter->tx_ring) >= size) in igbvf_maybe_stop_tx()
2135 if (igbvf_desc_unused(adapter->tx_ring) < size) in igbvf_maybe_stop_tx()
2148 struct igbvf_ring *tx_ring, in igbvf_tx_map_adv() argument
2157 i = tx_ring->next_to_use; in igbvf_tx_map_adv()
2159 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_map_adv()
2175 if (i == tx_ring->count) in igbvf_tx_map_adv()
2181 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_map_adv()
2192 tx_ring->buffer_info[i].skb = skb; in igbvf_tx_map_adv()
2210 i += tx_ring->count; in igbvf_tx_map_adv()
2212 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_map_adv()
2220 struct igbvf_ring *tx_ring, in igbvf_tx_queue_adv() argument
2252 i = tx_ring->next_to_use; in igbvf_tx_queue_adv()
2254 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_queue_adv()
2255 tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); in igbvf_tx_queue_adv()
2261 if (i == tx_ring->count) in igbvf_tx_queue_adv()
2273 tx_ring->buffer_info[first].next_to_watch = tx_desc; in igbvf_tx_queue_adv()
2274 tx_ring->next_to_use = i; in igbvf_tx_queue_adv()
2275 writel(i, adapter->hw.hw_addr + tx_ring->tail); in igbvf_tx_queue_adv()
2280 struct igbvf_ring *tx_ring) in igbvf_xmit_frame_ring_adv() argument
2319 first = tx_ring->next_to_use; in igbvf_xmit_frame_ring_adv()
2321 tso = igbvf_tso(tx_ring, skb, tx_flags, &hdr_len); in igbvf_xmit_frame_ring_adv()
2329 else if (igbvf_tx_csum(tx_ring, skb, tx_flags, protocol) && in igbvf_xmit_frame_ring_adv()
2336 count = igbvf_tx_map_adv(adapter, tx_ring, skb); in igbvf_xmit_frame_ring_adv()
2339 igbvf_tx_queue_adv(adapter, tx_ring, tx_flags, count, in igbvf_xmit_frame_ring_adv()
2345 tx_ring->buffer_info[first].time_stamp = 0; in igbvf_xmit_frame_ring_adv()
2346 tx_ring->next_to_use = first; in igbvf_xmit_frame_ring_adv()
2356 struct igbvf_ring *tx_ring; in igbvf_xmit_frame() local
2363 tx_ring = &adapter->tx_ring[0]; in igbvf_xmit_frame()
2365 return igbvf_xmit_frame_ring_adv(skb, netdev, tx_ring); in igbvf_xmit_frame()
2514 igbvf_clean_tx_irq(adapter->tx_ring); in igbvf_netpoll()
2857 adapter->tx_ring->count = 1024; in igbvf_probe()
2883 kfree(adapter->tx_ring); in igbvf_probe()
2931 kfree(adapter->tx_ring); in igbvf_remove()