Lines Matching refs:rx_q
286 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_rx_dirty() local
289 if (rx_q->dirty_rx <= rx_q->cur_rx) in stmmac_rx_dirty()
290 dirty = rx_q->cur_rx - rx_q->dirty_rx; in stmmac_rx_dirty()
292 dirty = priv->dma_rx_size - rx_q->dirty_rx + rx_q->cur_rx; in stmmac_rx_dirty()
1117 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_display_rx_rings() local
1122 head_rx = (void *)rx_q->dma_erx; in stmmac_display_rx_rings()
1124 head_rx = (void *)rx_q->dma_rx; in stmmac_display_rx_rings()
1190 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_clear_rx_descriptors() local
1196 stmmac_init_rx_desc(priv, &rx_q->dma_erx[i].basic, in stmmac_clear_rx_descriptors()
1201 stmmac_init_rx_desc(priv, &rx_q->dma_rx[i], in stmmac_clear_rx_descriptors()
1269 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_init_rx_buffers() local
1270 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i]; in stmmac_init_rx_buffers()
1272 buf->page = page_pool_dev_alloc_pages(rx_q->page_pool); in stmmac_init_rx_buffers()
1277 buf->sec_page = page_pool_dev_alloc_pages(rx_q->page_pool); in stmmac_init_rx_buffers()
1303 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_free_rx_buffer() local
1304 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i]; in stmmac_free_rx_buffer()
1307 page_pool_put_full_page(rx_q->page_pool, buf->page, false); in stmmac_free_rx_buffer()
1311 page_pool_put_full_page(rx_q->page_pool, buf->sec_page, false); in stmmac_free_rx_buffer()
1367 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in init_dma_rx_desc_rings() local
1371 (u32)rx_q->dma_rx_phy); in init_dma_rx_desc_rings()
1379 p = &((rx_q->dma_erx + i)->basic); in init_dma_rx_desc_rings()
1381 p = rx_q->dma_rx + i; in init_dma_rx_desc_rings()
1389 rx_q->cur_rx = 0; in init_dma_rx_desc_rings()
1390 rx_q->dirty_rx = (unsigned int)(i - priv->dma_rx_size); in init_dma_rx_desc_rings()
1395 stmmac_mode_init(priv, rx_q->dma_erx, in init_dma_rx_desc_rings()
1396 rx_q->dma_rx_phy, in init_dma_rx_desc_rings()
1399 stmmac_mode_init(priv, rx_q->dma_rx, in init_dma_rx_desc_rings()
1400 rx_q->dma_rx_phy, in init_dma_rx_desc_rings()
1560 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in free_dma_rx_desc_resources() local
1569 rx_q->dma_rx, rx_q->dma_rx_phy); in free_dma_rx_desc_resources()
1573 rx_q->dma_erx, rx_q->dma_rx_phy); in free_dma_rx_desc_resources()
1575 kfree(rx_q->buf_pool); in free_dma_rx_desc_resources()
1576 if (rx_q->page_pool) in free_dma_rx_desc_resources()
1577 page_pool_destroy(rx_q->page_pool); in free_dma_rx_desc_resources()
1635 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in alloc_dma_rx_desc_resources() local
1639 rx_q->queue_index = queue; in alloc_dma_rx_desc_resources()
1640 rx_q->priv_data = priv; in alloc_dma_rx_desc_resources()
1650 rx_q->page_pool = page_pool_create(&pp_params); in alloc_dma_rx_desc_resources()
1651 if (IS_ERR(rx_q->page_pool)) { in alloc_dma_rx_desc_resources()
1652 ret = PTR_ERR(rx_q->page_pool); in alloc_dma_rx_desc_resources()
1653 rx_q->page_pool = NULL; in alloc_dma_rx_desc_resources()
1657 rx_q->buf_pool = kcalloc(priv->dma_rx_size, in alloc_dma_rx_desc_resources()
1658 sizeof(*rx_q->buf_pool), in alloc_dma_rx_desc_resources()
1660 if (!rx_q->buf_pool) in alloc_dma_rx_desc_resources()
1664 rx_q->dma_erx = dma_alloc_coherent(priv->device, in alloc_dma_rx_desc_resources()
1667 &rx_q->dma_rx_phy, in alloc_dma_rx_desc_resources()
1669 if (!rx_q->dma_erx) in alloc_dma_rx_desc_resources()
1673 rx_q->dma_rx = dma_alloc_coherent(priv->device, in alloc_dma_rx_desc_resources()
1676 &rx_q->dma_rx_phy, in alloc_dma_rx_desc_resources()
1678 if (!rx_q->dma_rx) in alloc_dma_rx_desc_resources()
2288 struct stmmac_rx_queue *rx_q; in stmmac_init_dma_engine() local
2320 rx_q = &priv->rx_queue[chan]; in stmmac_init_dma_engine()
2323 rx_q->dma_rx_phy, chan); in stmmac_init_dma_engine()
2325 rx_q->rx_tail_addr = rx_q->dma_rx_phy + in stmmac_init_dma_engine()
2329 rx_q->rx_tail_addr, chan); in stmmac_init_dma_engine()
3579 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_rx_refill() local
3581 unsigned int entry = rx_q->dirty_rx; in stmmac_rx_refill()
3586 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry]; in stmmac_rx_refill()
3591 p = (struct dma_desc *)(rx_q->dma_erx + entry); in stmmac_rx_refill()
3593 p = rx_q->dma_rx + entry; in stmmac_rx_refill()
3596 buf->page = page_pool_dev_alloc_pages(rx_q->page_pool); in stmmac_rx_refill()
3602 buf->sec_page = page_pool_dev_alloc_pages(rx_q->page_pool); in stmmac_rx_refill()
3622 stmmac_refill_desc3(priv, rx_q, p); in stmmac_rx_refill()
3624 rx_q->rx_count_frames++; in stmmac_rx_refill()
3625 rx_q->rx_count_frames += priv->rx_coal_frames; in stmmac_rx_refill()
3626 if (rx_q->rx_count_frames > priv->rx_coal_frames) in stmmac_rx_refill()
3627 rx_q->rx_count_frames = 0; in stmmac_rx_refill()
3630 use_rx_wd |= rx_q->rx_count_frames > 0; in stmmac_rx_refill()
3639 rx_q->dirty_rx = entry; in stmmac_rx_refill()
3640 rx_q->rx_tail_addr = rx_q->dma_rx_phy + in stmmac_rx_refill()
3641 (rx_q->dirty_rx * sizeof(struct dma_desc)); in stmmac_rx_refill()
3642 stmmac_set_rx_tail_ptr(priv, priv->ioaddr, rx_q->rx_tail_addr, queue); in stmmac_rx_refill()
3704 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_rx() local
3708 unsigned int next_entry = rx_q->cur_rx; in stmmac_rx()
3716 rx_head = (void *)rx_q->dma_erx; in stmmac_rx()
3718 rx_head = (void *)rx_q->dma_rx; in stmmac_rx()
3730 if (!count && rx_q->state_saved) { in stmmac_rx()
3731 skb = rx_q->state.skb; in stmmac_rx()
3732 error = rx_q->state.error; in stmmac_rx()
3733 len = rx_q->state.len; in stmmac_rx()
3735 rx_q->state_saved = false; in stmmac_rx()
3748 buf = &rx_q->buf_pool[entry]; in stmmac_rx()
3751 p = (struct dma_desc *)(rx_q->dma_erx + entry); in stmmac_rx()
3753 p = rx_q->dma_rx + entry; in stmmac_rx()
3762 rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx, in stmmac_rx()
3764 next_entry = rx_q->cur_rx; in stmmac_rx()
3767 np = (struct dma_desc *)(rx_q->dma_erx + next_entry); in stmmac_rx()
3769 np = rx_q->dma_rx + next_entry; in stmmac_rx()
3775 &priv->xstats, rx_q->dma_erx + entry); in stmmac_rx()
3777 page_pool_recycle_direct(rx_q->page_pool, buf->page); in stmmac_rx()
3837 page_pool_recycle_direct(rx_q->page_pool, buf->page); in stmmac_rx()
3847 page_pool_release_page(rx_q->page_pool, buf->page); in stmmac_rx()
3859 page_pool_release_page(rx_q->page_pool, buf->sec_page); in stmmac_rx()
3893 rx_q->state_saved = true; in stmmac_rx()
3894 rx_q->state.skb = skb; in stmmac_rx()
3895 rx_q->state.error = error; in stmmac_rx()
3896 rx_q->state.len = len; in stmmac_rx()
4125 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_interrupt() local
4134 rx_q->rx_tail_addr, in stmmac_interrupt()
4325 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_rings_status_show() local
4331 sysfs_display_ring((void *)rx_q->dma_erx, in stmmac_rings_status_show()
4335 sysfs_display_ring((void *)rx_q->dma_rx, in stmmac_rings_status_show()
5217 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; in stmmac_reset_queues_param() local
5219 rx_q->cur_rx = 0; in stmmac_reset_queues_param()
5220 rx_q->dirty_rx = 0; in stmmac_reset_queues_param()