Lines Matching refs:rx_ring

100 	napi_gro_receive(&adapter->rx_ring->napi, skb);  in igbvf_receive_skb()
133 static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring, in igbvf_alloc_rx_buffers() argument
136 struct igbvf_adapter *adapter = rx_ring->adapter; in igbvf_alloc_rx_buffers()
145 i = rx_ring->next_to_use; in igbvf_alloc_rx_buffers()
146 buffer_info = &rx_ring->buffer_info[i]; in igbvf_alloc_rx_buffers()
154 rx_desc = IGBVF_RX_DESC_ADV(*rx_ring, i); in igbvf_alloc_rx_buffers()
212 if (i == rx_ring->count) in igbvf_alloc_rx_buffers()
214 buffer_info = &rx_ring->buffer_info[i]; in igbvf_alloc_rx_buffers()
218 if (rx_ring->next_to_use != i) { in igbvf_alloc_rx_buffers()
219 rx_ring->next_to_use = i; in igbvf_alloc_rx_buffers()
221 i = (rx_ring->count - 1); in igbvf_alloc_rx_buffers()
231 writel(i, adapter->hw.hw_addr + rx_ring->tail); in igbvf_alloc_rx_buffers()
247 struct igbvf_ring *rx_ring = adapter->rx_ring; in igbvf_clean_rx_irq() local
259 i = rx_ring->next_to_clean; in igbvf_clean_rx_irq()
260 rx_desc = IGBVF_RX_DESC_ADV(*rx_ring, i); in igbvf_clean_rx_irq()
269 buffer_info = &rx_ring->buffer_info[i]; in igbvf_clean_rx_irq()
329 if (i == rx_ring->count) in igbvf_clean_rx_irq()
331 next_rxd = IGBVF_RX_DESC_ADV(*rx_ring, i); in igbvf_clean_rx_irq()
333 next_buffer = &rx_ring->buffer_info[i]; in igbvf_clean_rx_irq()
363 igbvf_alloc_rx_buffers(rx_ring, cleaned_count); in igbvf_clean_rx_irq()
374 rx_ring->next_to_clean = i; in igbvf_clean_rx_irq()
375 cleaned_count = igbvf_desc_unused(rx_ring); in igbvf_clean_rx_irq()
378 igbvf_alloc_rx_buffers(rx_ring, cleaned_count); in igbvf_clean_rx_irq()
457 struct igbvf_ring *rx_ring) in igbvf_setup_rx_resources() argument
462 size = sizeof(struct igbvf_buffer) * rx_ring->count; in igbvf_setup_rx_resources()
463 rx_ring->buffer_info = vzalloc(size); in igbvf_setup_rx_resources()
464 if (!rx_ring->buffer_info) in igbvf_setup_rx_resources()
470 rx_ring->size = rx_ring->count * desc_len; in igbvf_setup_rx_resources()
471 rx_ring->size = ALIGN(rx_ring->size, 4096); in igbvf_setup_rx_resources()
473 rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size, in igbvf_setup_rx_resources()
474 &rx_ring->dma, GFP_KERNEL); in igbvf_setup_rx_resources()
475 if (!rx_ring->desc) in igbvf_setup_rx_resources()
478 rx_ring->next_to_clean = 0; in igbvf_setup_rx_resources()
479 rx_ring->next_to_use = 0; in igbvf_setup_rx_resources()
481 rx_ring->adapter = adapter; in igbvf_setup_rx_resources()
486 vfree(rx_ring->buffer_info); in igbvf_setup_rx_resources()
487 rx_ring->buffer_info = NULL; in igbvf_setup_rx_resources()
551 static void igbvf_clean_rx_ring(struct igbvf_ring *rx_ring) in igbvf_clean_rx_ring() argument
553 struct igbvf_adapter *adapter = rx_ring->adapter; in igbvf_clean_rx_ring()
559 if (!rx_ring->buffer_info) in igbvf_clean_rx_ring()
563 for (i = 0; i < rx_ring->count; i++) { in igbvf_clean_rx_ring()
564 buffer_info = &rx_ring->buffer_info[i]; in igbvf_clean_rx_ring()
596 size = sizeof(struct igbvf_buffer) * rx_ring->count; in igbvf_clean_rx_ring()
597 memset(rx_ring->buffer_info, 0, size); in igbvf_clean_rx_ring()
600 memset(rx_ring->desc, 0, rx_ring->size); in igbvf_clean_rx_ring()
602 rx_ring->next_to_clean = 0; in igbvf_clean_rx_ring()
603 rx_ring->next_to_use = 0; in igbvf_clean_rx_ring()
605 writel(0, adapter->hw.hw_addr + rx_ring->head); in igbvf_clean_rx_ring()
606 writel(0, adapter->hw.hw_addr + rx_ring->tail); in igbvf_clean_rx_ring()
616 void igbvf_free_rx_resources(struct igbvf_ring *rx_ring) in igbvf_free_rx_resources() argument
618 struct pci_dev *pdev = rx_ring->adapter->pdev; in igbvf_free_rx_resources()
620 igbvf_clean_rx_ring(rx_ring); in igbvf_free_rx_resources()
622 vfree(rx_ring->buffer_info); in igbvf_free_rx_resources()
623 rx_ring->buffer_info = NULL; in igbvf_free_rx_resources()
625 dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc, in igbvf_free_rx_resources()
626 rx_ring->dma); in igbvf_free_rx_resources()
627 rx_ring->desc = NULL; in igbvf_free_rx_resources()
745 adapter->rx_ring->itr_range = in igbvf_set_itr()
746 igbvf_update_itr(adapter, adapter->rx_ring->itr_val, in igbvf_set_itr()
750 adapter->rx_ring->itr_range == lowest_latency) in igbvf_set_itr()
751 adapter->rx_ring->itr_range = low_latency; in igbvf_set_itr()
753 new_itr = igbvf_range_to_itr(adapter->rx_ring->itr_range); in igbvf_set_itr()
755 if (new_itr != adapter->rx_ring->itr_val) { in igbvf_set_itr()
756 u32 current_itr = adapter->rx_ring->itr_val; in igbvf_set_itr()
761 adapter->rx_ring->itr_val = new_itr; in igbvf_set_itr()
763 adapter->rx_ring->set_itr = 1; in igbvf_set_itr()
908 if (adapter->rx_ring->set_itr) { in igbvf_intr_msix_rx()
909 writel(adapter->rx_ring->itr_val, in igbvf_intr_msix_rx()
910 adapter->hw.hw_addr + adapter->rx_ring->itr_register); in igbvf_intr_msix_rx()
911 adapter->rx_ring->set_itr = 0; in igbvf_intr_msix_rx()
914 if (napi_schedule_prep(&adapter->rx_ring->napi)) { in igbvf_intr_msix_rx()
917 __napi_schedule(&adapter->rx_ring->napi); in igbvf_intr_msix_rx()
948 adapter->rx_ring[rx_queue].eims_value = BIT(msix_vector); in igbvf_assign_vector()
980 struct igbvf_ring *rx_ring = adapter->rx_ring; in igbvf_configure_msix() local
989 adapter->eims_enable_mask |= rx_ring->eims_value; in igbvf_configure_msix()
990 writel(rx_ring->itr_val, hw->hw_addr + rx_ring->itr_register); in igbvf_configure_msix()
1057 sprintf(adapter->rx_ring->name, "%s-rx-0", netdev->name); in igbvf_request_msix()
1060 memcpy(adapter->rx_ring->name, netdev->name, IFNAMSIZ); in igbvf_request_msix()
1074 igbvf_intr_msix_rx, 0, adapter->rx_ring->name, in igbvf_request_msix()
1079 adapter->rx_ring->itr_register = E1000_EITR(vector); in igbvf_request_msix()
1080 adapter->rx_ring->itr_val = adapter->current_itr; in igbvf_request_msix()
1106 adapter->rx_ring = kzalloc(sizeof(struct igbvf_ring), GFP_KERNEL); in igbvf_alloc_queues()
1107 if (!adapter->rx_ring) { in igbvf_alloc_queues()
1112 netif_napi_add(netdev, &adapter->rx_ring->napi, igbvf_poll, 64); in igbvf_alloc_queues()
1186 struct igbvf_ring *rx_ring = container_of(napi, struct igbvf_ring, napi); in igbvf_poll() local
1187 struct igbvf_adapter *adapter = rx_ring->adapter; in igbvf_poll()
1204 ew32(EIMS, adapter->rx_ring->eims_value); in igbvf_poll()
1369 struct igbvf_ring *rx_ring = adapter->rx_ring; in igbvf_configure_rx() local
1382 rdba = rx_ring->dma; in igbvf_configure_rx()
1385 ew32(RDLEN(0), rx_ring->count * sizeof(union e1000_adv_rx_desc)); in igbvf_configure_rx()
1386 rx_ring->head = E1000_RDH(0); in igbvf_configure_rx()
1387 rx_ring->tail = E1000_RDT(0); in igbvf_configure_rx()
1501 igbvf_alloc_rx_buffers(adapter->rx_ring, in igbvf_configure()
1502 igbvf_desc_unused(adapter->rx_ring)); in igbvf_configure()
1548 napi_enable(&adapter->rx_ring->napi); in igbvf_up()
1589 napi_disable(&adapter->rx_ring->napi); in igbvf_down()
1603 igbvf_clean_rx_ring(adapter->rx_ring); in igbvf_down()
1722 err = igbvf_setup_rx_resources(adapter, adapter->rx_ring); in igbvf_open()
1740 napi_enable(&adapter->rx_ring->napi); in igbvf_open()
1754 igbvf_free_rx_resources(adapter->rx_ring); in igbvf_open()
1784 igbvf_free_rx_resources(adapter->rx_ring); in igbvf_close()
1961 ew32(EICS, adapter->rx_ring->eims_value); in igbvf_watchdog_task()
2850 adapter->rx_ring->count = 1024; in igbvf_probe()
2877 kfree(adapter->rx_ring); in igbvf_probe()
2923 netif_napi_del(&adapter->rx_ring->napi); in igbvf_remove()
2925 kfree(adapter->rx_ring); in igbvf_remove()