Lines Matching refs:rx_ring

241 	struct e1000_ring *rx_ring = adapter->rx_ring;  in e1000e_dump()  local
357 0, rx_ring->next_to_use, rx_ring->next_to_clean); in e1000e_dump()
393 for (i = 0; i < rx_ring->count; i++) { in e1000e_dump()
395 buffer_info = &rx_ring->buffer_info[i]; in e1000e_dump()
396 rx_desc_ps = E1000_RX_DESC_PS(*rx_ring, i); in e1000e_dump()
401 if (i == rx_ring->next_to_use) in e1000e_dump()
403 else if (i == rx_ring->next_to_clean) in e1000e_dump()
459 for (i = 0; i < rx_ring->count; i++) { in e1000e_dump()
462 buffer_info = &rx_ring->buffer_info[i]; in e1000e_dump()
463 rx_desc = E1000_RX_DESC_EXT(*rx_ring, i); in e1000e_dump()
467 if (i == rx_ring->next_to_use) in e1000e_dump()
469 else if (i == rx_ring->next_to_clean) in e1000e_dump()
640 static void e1000e_update_rdt_wa(struct e1000_ring *rx_ring, unsigned int i) in e1000e_update_rdt_wa() argument
642 struct e1000_adapter *adapter = rx_ring->adapter; in e1000e_update_rdt_wa()
646 writel(i, rx_ring->tail); in e1000e_update_rdt_wa()
648 if (unlikely(i != readl(rx_ring->tail))) { in e1000e_update_rdt_wa()
680 static void e1000_alloc_rx_buffers(struct e1000_ring *rx_ring, in e1000_alloc_rx_buffers() argument
683 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_alloc_rx_buffers()
692 i = rx_ring->next_to_use; in e1000_alloc_rx_buffers()
693 buffer_info = &rx_ring->buffer_info[i]; in e1000_alloc_rx_buffers()
720 rx_desc = E1000_RX_DESC_EXT(*rx_ring, i); in e1000_alloc_rx_buffers()
731 e1000e_update_rdt_wa(rx_ring, i); in e1000_alloc_rx_buffers()
733 writel(i, rx_ring->tail); in e1000_alloc_rx_buffers()
736 if (i == rx_ring->count) in e1000_alloc_rx_buffers()
738 buffer_info = &rx_ring->buffer_info[i]; in e1000_alloc_rx_buffers()
741 rx_ring->next_to_use = i; in e1000_alloc_rx_buffers()
750 static void e1000_alloc_rx_buffers_ps(struct e1000_ring *rx_ring, in e1000_alloc_rx_buffers_ps() argument
753 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_alloc_rx_buffers_ps()
762 i = rx_ring->next_to_use; in e1000_alloc_rx_buffers_ps()
763 buffer_info = &rx_ring->buffer_info[i]; in e1000_alloc_rx_buffers_ps()
766 rx_desc = E1000_RX_DESC_PS(*rx_ring, i); in e1000_alloc_rx_buffers_ps()
833 e1000e_update_rdt_wa(rx_ring, i << 1); in e1000_alloc_rx_buffers_ps()
835 writel(i << 1, rx_ring->tail); in e1000_alloc_rx_buffers_ps()
839 if (i == rx_ring->count) in e1000_alloc_rx_buffers_ps()
841 buffer_info = &rx_ring->buffer_info[i]; in e1000_alloc_rx_buffers_ps()
845 rx_ring->next_to_use = i; in e1000_alloc_rx_buffers_ps()
855 static void e1000_alloc_jumbo_rx_buffers(struct e1000_ring *rx_ring, in e1000_alloc_jumbo_rx_buffers() argument
858 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_alloc_jumbo_rx_buffers()
867 i = rx_ring->next_to_use; in e1000_alloc_jumbo_rx_buffers()
868 buffer_info = &rx_ring->buffer_info[i]; in e1000_alloc_jumbo_rx_buffers()
906 rx_desc = E1000_RX_DESC_EXT(*rx_ring, i); in e1000_alloc_jumbo_rx_buffers()
909 if (unlikely(++i == rx_ring->count)) in e1000_alloc_jumbo_rx_buffers()
911 buffer_info = &rx_ring->buffer_info[i]; in e1000_alloc_jumbo_rx_buffers()
914 if (likely(rx_ring->next_to_use != i)) { in e1000_alloc_jumbo_rx_buffers()
915 rx_ring->next_to_use = i; in e1000_alloc_jumbo_rx_buffers()
917 i = (rx_ring->count - 1); in e1000_alloc_jumbo_rx_buffers()
926 e1000e_update_rdt_wa(rx_ring, i); in e1000_alloc_jumbo_rx_buffers()
928 writel(i, rx_ring->tail); in e1000_alloc_jumbo_rx_buffers()
948 static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done, in e1000_clean_rx_irq() argument
951 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_clean_rx_irq()
963 i = rx_ring->next_to_clean; in e1000_clean_rx_irq()
964 rx_desc = E1000_RX_DESC_EXT(*rx_ring, i); in e1000_clean_rx_irq()
966 buffer_info = &rx_ring->buffer_info[i]; in e1000_clean_rx_irq()
982 if (i == rx_ring->count) in e1000_clean_rx_irq()
984 next_rxd = E1000_RX_DESC_EXT(*rx_ring, i); in e1000_clean_rx_irq()
987 next_buffer = &rx_ring->buffer_info[i]; in e1000_clean_rx_irq()
1074 adapter->alloc_rx_buf(rx_ring, cleaned_count, in e1000_clean_rx_irq()
1085 rx_ring->next_to_clean = i; in e1000_clean_rx_irq()
1087 cleaned_count = e1000_desc_unused(rx_ring); in e1000_clean_rx_irq()
1089 adapter->alloc_rx_buf(rx_ring, cleaned_count, GFP_ATOMIC); in e1000_clean_rx_irq()
1344 static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done, in e1000_clean_rx_irq_ps() argument
1347 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_clean_rx_irq_ps()
1361 i = rx_ring->next_to_clean; in e1000_clean_rx_irq_ps()
1362 rx_desc = E1000_RX_DESC_PS(*rx_ring, i); in e1000_clean_rx_irq_ps()
1364 buffer_info = &rx_ring->buffer_info[i]; in e1000_clean_rx_irq_ps()
1377 if (i == rx_ring->count) in e1000_clean_rx_irq_ps()
1379 next_rxd = E1000_RX_DESC_PS(*rx_ring, i); in e1000_clean_rx_irq_ps()
1382 next_buffer = &rx_ring->buffer_info[i]; in e1000_clean_rx_irq_ps()
1508 adapter->alloc_rx_buf(rx_ring, cleaned_count, in e1000_clean_rx_irq_ps()
1519 rx_ring->next_to_clean = i; in e1000_clean_rx_irq_ps()
1521 cleaned_count = e1000_desc_unused(rx_ring); in e1000_clean_rx_irq_ps()
1523 adapter->alloc_rx_buf(rx_ring, cleaned_count, GFP_ATOMIC); in e1000_clean_rx_irq_ps()
1548 static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done, in e1000_clean_jumbo_rx_irq() argument
1551 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_clean_jumbo_rx_irq()
1563 i = rx_ring->next_to_clean; in e1000_clean_jumbo_rx_irq()
1564 rx_desc = E1000_RX_DESC_EXT(*rx_ring, i); in e1000_clean_jumbo_rx_irq()
1566 buffer_info = &rx_ring->buffer_info[i]; in e1000_clean_jumbo_rx_irq()
1580 if (i == rx_ring->count) in e1000_clean_jumbo_rx_irq()
1582 next_rxd = E1000_RX_DESC_EXT(*rx_ring, i); in e1000_clean_jumbo_rx_irq()
1585 next_buffer = &rx_ring->buffer_info[i]; in e1000_clean_jumbo_rx_irq()
1602 if (rx_ring->rx_skb_top) in e1000_clean_jumbo_rx_irq()
1603 dev_kfree_skb_irq(rx_ring->rx_skb_top); in e1000_clean_jumbo_rx_irq()
1604 rx_ring->rx_skb_top = NULL; in e1000_clean_jumbo_rx_irq()
1607 #define rxtop (rx_ring->rx_skb_top) in e1000_clean_jumbo_rx_irq()
1689 adapter->alloc_rx_buf(rx_ring, cleaned_count, in e1000_clean_jumbo_rx_irq()
1700 rx_ring->next_to_clean = i; in e1000_clean_jumbo_rx_irq()
1702 cleaned_count = e1000_desc_unused(rx_ring); in e1000_clean_jumbo_rx_irq()
1704 adapter->alloc_rx_buf(rx_ring, cleaned_count, GFP_ATOMIC); in e1000_clean_jumbo_rx_irq()
1715 static void e1000_clean_rx_ring(struct e1000_ring *rx_ring) in e1000_clean_rx_ring() argument
1717 struct e1000_adapter *adapter = rx_ring->adapter; in e1000_clean_rx_ring()
1724 for (i = 0; i < rx_ring->count; i++) { in e1000_clean_rx_ring()
1725 buffer_info = &rx_ring->buffer_info[i]; in e1000_clean_rx_ring()
1764 if (rx_ring->rx_skb_top) { in e1000_clean_rx_ring()
1765 dev_kfree_skb(rx_ring->rx_skb_top); in e1000_clean_rx_ring()
1766 rx_ring->rx_skb_top = NULL; in e1000_clean_rx_ring()
1770 memset(rx_ring->desc, 0, rx_ring->size); in e1000_clean_rx_ring()
1772 rx_ring->next_to_clean = 0; in e1000_clean_rx_ring()
1773 rx_ring->next_to_use = 0; in e1000_clean_rx_ring()
1983 struct e1000_ring *rx_ring = adapter->rx_ring; in e1000_intr_msix_rx() local
1988 if (rx_ring->set_itr) { in e1000_intr_msix_rx()
1989 u32 itr = rx_ring->itr_val ? in e1000_intr_msix_rx()
1990 1000000000 / (rx_ring->itr_val * 256) : 0; in e1000_intr_msix_rx()
1992 writel(itr, rx_ring->itr_register); in e1000_intr_msix_rx()
1993 rx_ring->set_itr = 0; in e1000_intr_msix_rx()
2014 struct e1000_ring *rx_ring = adapter->rx_ring; in e1000_configure_msix() local
2030 rx_ring->ims_val = E1000_IMS_RXQ0; in e1000_configure_msix()
2031 adapter->eiac_mask |= rx_ring->ims_val; in e1000_configure_msix()
2032 if (rx_ring->itr_val) in e1000_configure_msix()
2033 writel(1000000000 / (rx_ring->itr_val * 256), in e1000_configure_msix()
2034 rx_ring->itr_register); in e1000_configure_msix()
2036 writel(1, rx_ring->itr_register); in e1000_configure_msix()
2053 if (rx_ring->itr_val) in e1000_configure_msix()
2054 writel(1000000000 / (rx_ring->itr_val * 256), in e1000_configure_msix()
2152 snprintf(adapter->rx_ring->name, in e1000_request_msix()
2153 sizeof(adapter->rx_ring->name) - 1, in e1000_request_msix()
2156 memcpy(adapter->rx_ring->name, netdev->name, IFNAMSIZ); in e1000_request_msix()
2158 e1000_intr_msix_rx, 0, adapter->rx_ring->name, in e1000_request_msix()
2162 adapter->rx_ring->itr_register = adapter->hw.hw_addr + in e1000_request_msix()
2164 adapter->rx_ring->itr_val = adapter->itr; in e1000_request_msix()
2406 int e1000e_setup_rx_resources(struct e1000_ring *rx_ring) in e1000e_setup_rx_resources() argument
2408 struct e1000_adapter *adapter = rx_ring->adapter; in e1000e_setup_rx_resources()
2412 size = sizeof(struct e1000_buffer) * rx_ring->count; in e1000e_setup_rx_resources()
2413 rx_ring->buffer_info = vzalloc(size); in e1000e_setup_rx_resources()
2414 if (!rx_ring->buffer_info) in e1000e_setup_rx_resources()
2417 for (i = 0; i < rx_ring->count; i++) { in e1000e_setup_rx_resources()
2418 buffer_info = &rx_ring->buffer_info[i]; in e1000e_setup_rx_resources()
2429 rx_ring->size = rx_ring->count * desc_len; in e1000e_setup_rx_resources()
2430 rx_ring->size = ALIGN(rx_ring->size, 4096); in e1000e_setup_rx_resources()
2432 err = e1000_alloc_ring_dma(adapter, rx_ring); in e1000e_setup_rx_resources()
2436 rx_ring->next_to_clean = 0; in e1000e_setup_rx_resources()
2437 rx_ring->next_to_use = 0; in e1000e_setup_rx_resources()
2438 rx_ring->rx_skb_top = NULL; in e1000e_setup_rx_resources()
2443 for (i = 0; i < rx_ring->count; i++) { in e1000e_setup_rx_resources()
2444 buffer_info = &rx_ring->buffer_info[i]; in e1000e_setup_rx_resources()
2448 vfree(rx_ring->buffer_info); in e1000e_setup_rx_resources()
2506 void e1000e_free_rx_resources(struct e1000_ring *rx_ring) in e1000e_free_rx_resources() argument
2508 struct e1000_adapter *adapter = rx_ring->adapter; in e1000e_free_rx_resources()
2512 e1000_clean_rx_ring(rx_ring); in e1000e_free_rx_resources()
2514 for (i = 0; i < rx_ring->count; i++) in e1000e_free_rx_resources()
2515 kfree(rx_ring->buffer_info[i].ps_pages); in e1000e_free_rx_resources()
2517 vfree(rx_ring->buffer_info); in e1000e_free_rx_resources()
2518 rx_ring->buffer_info = NULL; in e1000e_free_rx_resources()
2520 dma_free_coherent(&pdev->dev, rx_ring->size, rx_ring->desc, in e1000e_free_rx_resources()
2521 rx_ring->dma); in e1000e_free_rx_resources()
2522 rx_ring->desc = NULL; in e1000e_free_rx_resources()
2640 adapter->rx_ring->itr_val = new_itr; in e1000_set_itr()
2642 adapter->rx_ring->set_itr = 1; in e1000_set_itr()
2686 adapter->rx_ring = kzalloc(size, GFP_KERNEL); in e1000_alloc_queues()
2687 if (!adapter->rx_ring) in e1000_alloc_queues()
2689 adapter->rx_ring->count = adapter->rx_ring_count; in e1000_alloc_queues()
2690 adapter->rx_ring->adapter = adapter; in e1000_alloc_queues()
2695 kfree(adapter->rx_ring); in e1000_alloc_queues()
2716 (adapter->rx_ring->ims_val & adapter->tx_ring->ims_val)) in e1000e_poll()
2719 adapter->clean_rx(adapter->rx_ring, &work_done, budget); in e1000e_poll()
2732 ew32(IMS, adapter->rx_ring->ims_val); in e1000e_poll()
3236 struct e1000_ring *rx_ring = adapter->rx_ring; in e1000_configure_rx() local
3242 rdlen = rx_ring->count * in e1000_configure_rx()
3247 rdlen = rx_ring->count * sizeof(union e1000_rx_desc_extended); in e1000_configure_rx()
3251 rdlen = rx_ring->count * sizeof(union e1000_rx_desc_extended); in e1000_configure_rx()
3294 rdba = rx_ring->dma; in e1000_configure_rx()
3300 rx_ring->head = adapter->hw.hw_addr + E1000_RDH(0); in e1000_configure_rx()
3301 rx_ring->tail = adapter->hw.hw_addr + E1000_RDT(0); in e1000_configure_rx()
3303 writel(0, rx_ring->head); in e1000_configure_rx()
3305 e1000e_update_rdt_wa(rx_ring, 0); in e1000_configure_rx()
3307 writel(0, rx_ring->tail); in e1000_configure_rx()
3796 struct e1000_ring *rx_ring = adapter->rx_ring; in e1000_configure() local
3809 adapter->alloc_rx_buf(rx_ring, e1000_desc_unused(rx_ring), GFP_KERNEL); in e1000_configure()
4366 e1000_clean_rx_ring(adapter->rx_ring); in e1000e_down()
4677 err = e1000e_setup_rx_resources(adapter->rx_ring); in e1000e_open()
4741 e1000e_free_rx_resources(adapter->rx_ring); in e1000e_open()
4786 e1000e_free_rx_resources(adapter->rx_ring); in e1000e_close()
5451 ew32(ICS, adapter->rx_ring->ims_val); in e1000_watchdog_task()
7683 kfree(adapter->rx_ring); in e1000_probe()
7749 kfree(adapter->rx_ring); in e1000_remove()