• Home
  • Raw
  • Download

Lines Matching refs:tx_ring

438 			     struct igbvf_ring *tx_ring)  in igbvf_setup_tx_resources()  argument
443 size = sizeof(struct igbvf_buffer) * tx_ring->count; in igbvf_setup_tx_resources()
444 tx_ring->buffer_info = vzalloc(size); in igbvf_setup_tx_resources()
445 if (!tx_ring->buffer_info) in igbvf_setup_tx_resources()
449 tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc); in igbvf_setup_tx_resources()
450 tx_ring->size = ALIGN(tx_ring->size, 4096); in igbvf_setup_tx_resources()
452 tx_ring->desc = dma_alloc_coherent(&pdev->dev, tx_ring->size, in igbvf_setup_tx_resources()
453 &tx_ring->dma, GFP_KERNEL); in igbvf_setup_tx_resources()
454 if (!tx_ring->desc) in igbvf_setup_tx_resources()
457 tx_ring->adapter = adapter; in igbvf_setup_tx_resources()
458 tx_ring->next_to_use = 0; in igbvf_setup_tx_resources()
459 tx_ring->next_to_clean = 0; in igbvf_setup_tx_resources()
463 vfree(tx_ring->buffer_info); in igbvf_setup_tx_resources()
516 static void igbvf_clean_tx_ring(struct igbvf_ring *tx_ring) in igbvf_clean_tx_ring() argument
518 struct igbvf_adapter *adapter = tx_ring->adapter; in igbvf_clean_tx_ring()
523 if (!tx_ring->buffer_info) in igbvf_clean_tx_ring()
527 for (i = 0; i < tx_ring->count; i++) { in igbvf_clean_tx_ring()
528 buffer_info = &tx_ring->buffer_info[i]; in igbvf_clean_tx_ring()
532 size = sizeof(struct igbvf_buffer) * tx_ring->count; in igbvf_clean_tx_ring()
533 memset(tx_ring->buffer_info, 0, size); in igbvf_clean_tx_ring()
536 memset(tx_ring->desc, 0, tx_ring->size); in igbvf_clean_tx_ring()
538 tx_ring->next_to_use = 0; in igbvf_clean_tx_ring()
539 tx_ring->next_to_clean = 0; in igbvf_clean_tx_ring()
541 writel(0, adapter->hw.hw_addr + tx_ring->head); in igbvf_clean_tx_ring()
542 writel(0, adapter->hw.hw_addr + tx_ring->tail); in igbvf_clean_tx_ring()
551 void igbvf_free_tx_resources(struct igbvf_ring *tx_ring) in igbvf_free_tx_resources() argument
553 struct pci_dev *pdev = tx_ring->adapter->pdev; in igbvf_free_tx_resources()
555 igbvf_clean_tx_ring(tx_ring); in igbvf_free_tx_resources()
557 vfree(tx_ring->buffer_info); in igbvf_free_tx_resources()
558 tx_ring->buffer_info = NULL; in igbvf_free_tx_resources()
560 dma_free_coherent(&pdev->dev, tx_ring->size, tx_ring->desc, in igbvf_free_tx_resources()
561 tx_ring->dma); in igbvf_free_tx_resources()
563 tx_ring->desc = NULL; in igbvf_free_tx_resources()
737 adapter->tx_ring->itr_range = in igbvf_set_itr()
739 adapter->tx_ring->itr_val, in igbvf_set_itr()
745 adapter->tx_ring->itr_range == lowest_latency) in igbvf_set_itr()
746 adapter->tx_ring->itr_range = low_latency; in igbvf_set_itr()
748 new_itr = igbvf_range_to_itr(adapter->tx_ring->itr_range); in igbvf_set_itr()
750 if (new_itr != adapter->tx_ring->itr_val) { in igbvf_set_itr()
751 u32 current_itr = adapter->tx_ring->itr_val; in igbvf_set_itr()
759 adapter->tx_ring->itr_val = new_itr; in igbvf_set_itr()
761 adapter->tx_ring->set_itr = 1; in igbvf_set_itr()
792 static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) in igbvf_clean_tx_irq() argument
794 struct igbvf_adapter *adapter = tx_ring->adapter; in igbvf_clean_tx_irq()
803 i = tx_ring->next_to_clean; in igbvf_clean_tx_irq()
804 buffer_info = &tx_ring->buffer_info[i]; in igbvf_clean_tx_irq()
823 tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); in igbvf_clean_tx_irq()
843 if (i == tx_ring->count) in igbvf_clean_tx_irq()
846 buffer_info = &tx_ring->buffer_info[i]; in igbvf_clean_tx_irq()
850 } while (count < tx_ring->count); in igbvf_clean_tx_irq()
852 tx_ring->next_to_clean = i; in igbvf_clean_tx_irq()
855 igbvf_desc_unused(tx_ring) >= IGBVF_TX_QUEUE_WAKE)) { in igbvf_clean_tx_irq()
869 return count < tx_ring->count; in igbvf_clean_tx_irq()
894 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_intr_msix_tx() local
896 if (tx_ring->set_itr) { in igbvf_intr_msix_tx()
897 writel(tx_ring->itr_val, in igbvf_intr_msix_tx()
898 adapter->hw.hw_addr + tx_ring->itr_register); in igbvf_intr_msix_tx()
899 adapter->tx_ring->set_itr = 0; in igbvf_intr_msix_tx()
908 if (!igbvf_clean_tx_irq(tx_ring)) in igbvf_intr_msix_tx()
910 ew32(EICS, tx_ring->eims_value); in igbvf_intr_msix_tx()
912 ew32(EIMS, tx_ring->eims_value); in igbvf_intr_msix_tx()
982 adapter->tx_ring[tx_queue].eims_value = BIT(msix_vector); in igbvf_assign_vector()
998 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_configure_msix() local
1005 adapter->eims_enable_mask |= tx_ring->eims_value; in igbvf_configure_msix()
1006 writel(tx_ring->itr_val, hw->hw_addr + tx_ring->itr_register); in igbvf_configure_msix()
1075 sprintf(adapter->tx_ring->name, "%s-tx-0", netdev->name); in igbvf_request_msix()
1078 memcpy(adapter->tx_ring->name, netdev->name, IFNAMSIZ); in igbvf_request_msix()
1083 igbvf_intr_msix_tx, 0, adapter->tx_ring->name, in igbvf_request_msix()
1088 adapter->tx_ring->itr_register = E1000_EITR(vector); in igbvf_request_msix()
1089 adapter->tx_ring->itr_val = adapter->current_itr; in igbvf_request_msix()
1121 adapter->tx_ring = kzalloc(sizeof(struct igbvf_ring), GFP_KERNEL); in igbvf_alloc_queues()
1122 if (!adapter->tx_ring) in igbvf_alloc_queues()
1127 kfree(adapter->tx_ring); in igbvf_alloc_queues()
1287 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_configure_tx() local
1298 ew32(TDLEN(0), tx_ring->count * sizeof(union e1000_adv_tx_desc)); in igbvf_configure_tx()
1299 tdba = tx_ring->dma; in igbvf_configure_tx()
1304 tx_ring->head = E1000_TDH(0); in igbvf_configure_tx()
1305 tx_ring->tail = E1000_TDT(0); in igbvf_configure_tx()
1545 igbvf_clean_tx_ring(adapter->tx_ring); in igbvf_down()
1659 err = igbvf_setup_tx_resources(adapter, adapter->tx_ring); in igbvf_open()
1698 igbvf_free_tx_resources(adapter->tx_ring); in igbvf_open()
1725 igbvf_free_tx_resources(adapter->tx_ring); in igbvf_close()
1850 struct igbvf_ring *tx_ring = adapter->tx_ring; in igbvf_watchdog_task() local
1880 tx_pending = (igbvf_desc_unused(tx_ring) + 1 < in igbvf_watchdog_task()
1881 tx_ring->count); in igbvf_watchdog_task()
1909 static void igbvf_tx_ctxtdesc(struct igbvf_ring *tx_ring, u32 vlan_macip_lens, in igbvf_tx_ctxtdesc() argument
1914 u16 i = tx_ring->next_to_use; in igbvf_tx_ctxtdesc()
1916 context_desc = IGBVF_TX_CTXTDESC_ADV(*tx_ring, i); in igbvf_tx_ctxtdesc()
1917 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_ctxtdesc()
1920 tx_ring->next_to_use = (i < tx_ring->count) ? i : 0; in igbvf_tx_ctxtdesc()
1934 static int igbvf_tso(struct igbvf_ring *tx_ring, in igbvf_tso() argument
2003 igbvf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, mss_l4len_idx); in igbvf_tso()
2017 static bool igbvf_tx_csum(struct igbvf_ring *tx_ring, struct sk_buff *skb, in igbvf_tx_csum() argument
2056 igbvf_tx_ctxtdesc(tx_ring, vlan_macip_lens, type_tucmd, 0); in igbvf_tx_csum()
2065 if (igbvf_desc_unused(adapter->tx_ring) >= size) in igbvf_maybe_stop_tx()
2077 if (igbvf_desc_unused(adapter->tx_ring) < size) in igbvf_maybe_stop_tx()
2090 struct igbvf_ring *tx_ring, in igbvf_tx_map_adv() argument
2099 i = tx_ring->next_to_use; in igbvf_tx_map_adv()
2101 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_map_adv()
2117 if (i == tx_ring->count) in igbvf_tx_map_adv()
2123 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_map_adv()
2134 tx_ring->buffer_info[i].skb = skb; in igbvf_tx_map_adv()
2152 i += tx_ring->count; in igbvf_tx_map_adv()
2154 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_map_adv()
2162 struct igbvf_ring *tx_ring, in igbvf_tx_queue_adv() argument
2194 i = tx_ring->next_to_use; in igbvf_tx_queue_adv()
2196 buffer_info = &tx_ring->buffer_info[i]; in igbvf_tx_queue_adv()
2197 tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); in igbvf_tx_queue_adv()
2203 if (i == tx_ring->count) in igbvf_tx_queue_adv()
2215 tx_ring->buffer_info[first].next_to_watch = tx_desc; in igbvf_tx_queue_adv()
2216 tx_ring->next_to_use = i; in igbvf_tx_queue_adv()
2217 writel(i, adapter->hw.hw_addr + tx_ring->tail); in igbvf_tx_queue_adv()
2226 struct igbvf_ring *tx_ring) in igbvf_xmit_frame_ring_adv() argument
2265 first = tx_ring->next_to_use; in igbvf_xmit_frame_ring_adv()
2267 tso = igbvf_tso(tx_ring, skb, tx_flags, &hdr_len); in igbvf_xmit_frame_ring_adv()
2275 else if (igbvf_tx_csum(tx_ring, skb, tx_flags, protocol) && in igbvf_xmit_frame_ring_adv()
2282 count = igbvf_tx_map_adv(adapter, tx_ring, skb); in igbvf_xmit_frame_ring_adv()
2285 igbvf_tx_queue_adv(adapter, tx_ring, tx_flags, count, in igbvf_xmit_frame_ring_adv()
2291 tx_ring->buffer_info[first].time_stamp = 0; in igbvf_xmit_frame_ring_adv()
2292 tx_ring->next_to_use = first; in igbvf_xmit_frame_ring_adv()
2302 struct igbvf_ring *tx_ring; in igbvf_xmit_frame() local
2309 tx_ring = &adapter->tx_ring[0]; in igbvf_xmit_frame()
2311 return igbvf_xmit_frame_ring_adv(skb, netdev, tx_ring); in igbvf_xmit_frame()
2503 igbvf_clean_tx_irq(adapter->tx_ring); in igbvf_netpoll()
2824 adapter->tx_ring->count = 1024; in igbvf_probe()
2849 kfree(adapter->tx_ring); in igbvf_probe()
2897 kfree(adapter->tx_ring); in igbvf_remove()