Lines Matching refs:desc_cb

1087 	struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use];  in hns3_fill_desc()  local
1112 desc_cb->priv = priv; in hns3_fill_desc()
1113 desc_cb->length = size; in hns3_fill_desc()
1114 desc_cb->dma = dma; in hns3_fill_desc()
1115 desc_cb->type = type; in hns3_fill_desc()
1350 if (!ring->desc_cb[ring->next_to_use].dma) in hns3_clear_desc()
1354 if (ring->desc_cb[ring->next_to_use].type == DESC_TYPE_SKB || in hns3_clear_desc()
1355 ring->desc_cb[ring->next_to_use].type == in hns3_clear_desc()
1358 ring->desc_cb[ring->next_to_use].dma, in hns3_clear_desc()
1359 ring->desc_cb[ring->next_to_use].length, in hns3_clear_desc()
1361 else if (ring->desc_cb[ring->next_to_use].length) in hns3_clear_desc()
1363 ring->desc_cb[ring->next_to_use].dma, in hns3_clear_desc()
1364 ring->desc_cb[ring->next_to_use].length, in hns3_clear_desc()
1367 ring->desc_cb[ring->next_to_use].length = 0; in hns3_clear_desc()
1368 ring->desc_cb[ring->next_to_use].dma = 0; in hns3_clear_desc()
1369 ring->desc_cb[ring->next_to_use].type = DESC_TYPE_UNKNOWN; in hns3_clear_desc()
2386 hns3_unmap_buffer(ring, &ring->desc_cb[i]); in hns3_buffer_detach()
2393 struct hns3_desc_cb *cb = &ring->desc_cb[i]; in hns3_free_buffer_detach()
2395 if (!ring->desc_cb[i].dma) in hns3_free_buffer_detach()
2459 int ret = hns3_alloc_and_map_buffer(ring, &ring->desc_cb[i]); in hns3_alloc_and_attach_buffer()
2464 ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma); in hns3_alloc_and_attach_buffer()
2492 hns3_unmap_buffer(ring, &ring->desc_cb[i]); in hns3_replace_buffer()
2493 ring->desc_cb[i] = *res_cb; in hns3_replace_buffer()
2494 ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma); in hns3_replace_buffer()
2500 ring->desc_cb[i].reuse_flag = 0; in hns3_reuse_buffer()
2501 ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma + in hns3_reuse_buffer()
2502 ring->desc_cb[i].page_offset); in hns3_reuse_buffer()
2506 ring->desc_cb[i].dma + ring->desc_cb[i].page_offset, in hns3_reuse_buffer()
2520 struct hns3_desc_cb *desc_cb; in hns3_nic_reclaim_desc() local
2531 desc_cb = &ring->desc_cb[ntc]; in hns3_nic_reclaim_desc()
2532 (*pkts) += (desc_cb->type == DESC_TYPE_SKB); in hns3_nic_reclaim_desc()
2533 (*bytes) += desc_cb->length; in hns3_nic_reclaim_desc()
2541 prefetch(&ring->desc_cb[ntc]); in hns3_nic_reclaim_desc()
2604 struct hns3_desc_cb *desc_cb; in hns3_nic_alloc_rx_buffers() local
2609 desc_cb = &ring->desc_cb[ring->next_to_use]; in hns3_nic_alloc_rx_buffers()
2610 if (desc_cb->reuse_flag) { in hns3_nic_alloc_rx_buffers()
2654 struct hns3_desc_cb *desc_cb) in hns3_nic_reuse_page() argument
2660 desc_cb->pagecnt_bias--; in hns3_nic_reuse_page()
2661 skb_add_rx_frag(skb, i, desc_cb->priv, desc_cb->page_offset + pull_len, in hns3_nic_reuse_page()
2667 if (unlikely(!hns3_page_is_reusable(desc_cb->priv)) || in hns3_nic_reuse_page()
2668 (!desc_cb->page_offset && !hns3_can_reuse_page(desc_cb))) { in hns3_nic_reuse_page()
2669 __page_frag_cache_drain(desc_cb->priv, desc_cb->pagecnt_bias); in hns3_nic_reuse_page()
2674 desc_cb->page_offset += truesize; in hns3_nic_reuse_page()
2676 if (desc_cb->page_offset + truesize <= hns3_page_size(ring)) { in hns3_nic_reuse_page()
2677 desc_cb->reuse_flag = 1; in hns3_nic_reuse_page()
2678 } else if (hns3_can_reuse_page(desc_cb)) { in hns3_nic_reuse_page()
2679 desc_cb->reuse_flag = 1; in hns3_nic_reuse_page()
2680 desc_cb->page_offset = 0; in hns3_nic_reuse_page()
2681 } else if (desc_cb->pagecnt_bias) { in hns3_nic_reuse_page()
2682 __page_frag_cache_drain(desc_cb->priv, desc_cb->pagecnt_bias); in hns3_nic_reuse_page()
2686 if (unlikely(!desc_cb->pagecnt_bias)) { in hns3_nic_reuse_page()
2687 page_ref_add(desc_cb->priv, USHRT_MAX); in hns3_nic_reuse_page()
2688 desc_cb->pagecnt_bias = USHRT_MAX; in hns3_nic_reuse_page()
2878 struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_clean]; in hns3_alloc_skb() local
2904 if (likely(hns3_page_is_reusable(desc_cb->priv))) in hns3_alloc_skb()
2905 desc_cb->reuse_flag = 1; in hns3_alloc_skb()
2907 __page_frag_cache_drain(desc_cb->priv, in hns3_alloc_skb()
2908 desc_cb->pagecnt_bias); in hns3_alloc_skb()
2920 desc_cb); in hns3_alloc_skb()
2931 struct hns3_desc_cb *desc_cb; in hns3_add_frag() local
2937 desc_cb = &ring->desc_cb[ring->next_to_clean]; in hns3_add_frag()
2970 desc_cb->dma + desc_cb->page_offset, in hns3_add_frag()
2974 hns3_nic_reuse_page(skb, ring->frag_num++, ring, 0, desc_cb); in hns3_add_frag()
3107 struct hns3_desc_cb *desc_cb; in hns3_handle_rx_bd() local
3114 desc_cb = &ring->desc_cb[ring->next_to_clean]; in hns3_handle_rx_bd()
3128 ring->va = desc_cb->buf + desc_cb->page_offset; in hns3_handle_rx_bd()
3131 desc_cb->dma + desc_cb->page_offset, in hns3_handle_rx_bd()
3719 ring->desc_cb = NULL; in hns3_ring_get_cfg()
3771 ring->desc_cb = devm_kcalloc(ring_to_dev(ring), ring->desc_num, in hns3_alloc_ring_memory()
3772 sizeof(ring->desc_cb[0]), GFP_KERNEL); in hns3_alloc_ring_memory()
3773 if (!ring->desc_cb) { in hns3_alloc_ring_memory()
3793 devm_kfree(ring_to_dev(ring), ring->desc_cb); in hns3_alloc_ring_memory()
3794 ring->desc_cb = NULL; in hns3_alloc_ring_memory()
3802 devm_kfree(ring_to_dev(ring), ring->desc_cb); in hns3_fini_ring()
3803 ring->desc_cb = NULL; in hns3_fini_ring()
4236 if (!ring->desc_cb[ring->next_to_use].reuse_flag) { in hns3_clear_rx_ring()
4272 if (!ring->desc_cb[ring->next_to_use].reuse_flag) { in hns3_force_clear_rx_ring()
4274 &ring->desc_cb[ring->next_to_use]); in hns3_force_clear_rx_ring()
4275 ring->desc_cb[ring->next_to_use].dma = 0; in hns3_force_clear_rx_ring()