Lines Matching refs:rds_ring
30 struct qlcnic_host_rds_ring *rds_ring);
93 struct qlcnic_host_rds_ring *rds_ring; in qlcnic_release_rx_buffers() local
99 rds_ring = &recv_ctx->rds_rings[ring]; in qlcnic_release_rx_buffers()
100 for (i = 0; i < rds_ring->num_desc; ++i) { in qlcnic_release_rx_buffers()
101 rx_buf = &(rds_ring->rx_buf_arr[i]); in qlcnic_release_rx_buffers()
107 rds_ring->dma_size, in qlcnic_release_rx_buffers()
118 struct qlcnic_host_rds_ring *rds_ring; in qlcnic_reset_rx_buffers_list() local
124 rds_ring = &recv_ctx->rds_rings[ring]; in qlcnic_reset_rx_buffers_list()
126 INIT_LIST_HEAD(&rds_ring->free_list); in qlcnic_reset_rx_buffers_list()
128 rx_buf = rds_ring->rx_buf_arr; in qlcnic_reset_rx_buffers_list()
129 for (i = 0; i < rds_ring->num_desc; i++) { in qlcnic_reset_rx_buffers_list()
131 &rds_ring->free_list); in qlcnic_reset_rx_buffers_list()
172 struct qlcnic_host_rds_ring *rds_ring; in qlcnic_free_sw_resources() local
182 rds_ring = &recv_ctx->rds_rings[ring]; in qlcnic_free_sw_resources()
183 vfree(rds_ring->rx_buf_arr); in qlcnic_free_sw_resources()
184 rds_ring->rx_buf_arr = NULL; in qlcnic_free_sw_resources()
202 struct qlcnic_host_rds_ring *rds_ring; in qlcnic_alloc_sw_resources() local
232 rds_ring = kzalloc(size, GFP_KERNEL); in qlcnic_alloc_sw_resources()
233 if (rds_ring == NULL) { in qlcnic_alloc_sw_resources()
237 recv_ctx->rds_rings = rds_ring; in qlcnic_alloc_sw_resources()
240 rds_ring = &recv_ctx->rds_rings[ring]; in qlcnic_alloc_sw_resources()
243 rds_ring->num_desc = adapter->num_rxd; in qlcnic_alloc_sw_resources()
244 rds_ring->dma_size = QLCNIC_P3P_RX_BUF_MAX_LEN; in qlcnic_alloc_sw_resources()
245 rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN; in qlcnic_alloc_sw_resources()
249 rds_ring->num_desc = adapter->num_jumbo_rxd; in qlcnic_alloc_sw_resources()
250 rds_ring->dma_size = in qlcnic_alloc_sw_resources()
254 rds_ring->dma_size += QLCNIC_LRO_BUFFER_EXTRA; in qlcnic_alloc_sw_resources()
256 rds_ring->skb_size = in qlcnic_alloc_sw_resources()
257 rds_ring->dma_size + NET_IP_ALIGN; in qlcnic_alloc_sw_resources()
260 rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring)); in qlcnic_alloc_sw_resources()
261 if (rds_ring->rx_buf_arr == NULL) { in qlcnic_alloc_sw_resources()
266 INIT_LIST_HEAD(&rds_ring->free_list); in qlcnic_alloc_sw_resources()
271 rx_buf = rds_ring->rx_buf_arr; in qlcnic_alloc_sw_resources()
272 for (i = 0; i < rds_ring->num_desc; i++) { in qlcnic_alloc_sw_resources()
274 &rds_ring->free_list); in qlcnic_alloc_sw_resources()
278 spin_lock_init(&rds_ring->lock); in qlcnic_alloc_sw_resources()
1334 struct qlcnic_host_rds_ring *rds_ring, in qlcnic_alloc_rx_skb() argument
1341 skb = dev_alloc_skb(rds_ring->skb_size); in qlcnic_alloc_rx_skb()
1350 rds_ring->dma_size, PCI_DMA_FROMDEVICE); in qlcnic_alloc_rx_skb()
1365 struct qlcnic_host_rds_ring *rds_ring, u16 index, u16 cksum) in qlcnic_process_rxbuf() argument
1370 buffer = &rds_ring->rx_buf_arr[index]; in qlcnic_process_rxbuf()
1377 pci_unmap_single(adapter->pdev, buffer->dma, rds_ring->dma_size, in qlcnic_process_rxbuf()
1431 struct qlcnic_host_rds_ring *rds_ring; in qlcnic_process_rcv() local
1438 rds_ring = &recv_ctx->rds_rings[ring]; in qlcnic_process_rcv()
1441 if (unlikely(index >= rds_ring->num_desc)) in qlcnic_process_rcv()
1444 buffer = &rds_ring->rx_buf_arr[index]; in qlcnic_process_rcv()
1450 skb = qlcnic_process_rxbuf(adapter, rds_ring, index, cksum); in qlcnic_process_rcv()
1454 if (length > rds_ring->skb_size) in qlcnic_process_rcv()
1455 skb_put(skb, rds_ring->skb_size); in qlcnic_process_rcv()
1494 struct qlcnic_host_rds_ring *rds_ring; in qlcnic_process_lro() local
1507 rds_ring = &recv_ctx->rds_rings[ring]; in qlcnic_process_lro()
1510 if (unlikely(index > rds_ring->num_desc)) in qlcnic_process_lro()
1513 buffer = &rds_ring->rx_buf_arr[index]; in qlcnic_process_lro()
1522 skb = qlcnic_process_rxbuf(adapter, rds_ring, index, STATUS_CKSUM_OK); in qlcnic_process_lro()
1627 struct qlcnic_host_rds_ring *rds_ring = in qlcnic_process_rcv_ring() local
1634 qlcnic_alloc_rx_skb(adapter, rds_ring, rxbuf); in qlcnic_process_rcv_ring()
1636 spin_lock(&rds_ring->lock); in qlcnic_process_rcv_ring()
1638 &rds_ring->free_list); in qlcnic_process_rcv_ring()
1639 spin_unlock(&rds_ring->lock); in qlcnic_process_rcv_ring()
1642 qlcnic_post_rx_buffers_nodb(adapter, rds_ring); in qlcnic_process_rcv_ring()
1655 struct qlcnic_host_rds_ring *rds_ring) in qlcnic_post_rx_buffers() argument
1662 producer = rds_ring->producer; in qlcnic_post_rx_buffers()
1664 head = &rds_ring->free_list; in qlcnic_post_rx_buffers()
1670 if (qlcnic_alloc_rx_skb(adapter, rds_ring, buffer)) in qlcnic_post_rx_buffers()
1678 pdesc = &rds_ring->desc_head[producer]; in qlcnic_post_rx_buffers()
1681 pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); in qlcnic_post_rx_buffers()
1683 producer = get_next_index(producer, rds_ring->num_desc); in qlcnic_post_rx_buffers()
1687 rds_ring->producer = producer; in qlcnic_post_rx_buffers()
1688 writel((producer-1) & (rds_ring->num_desc-1), in qlcnic_post_rx_buffers()
1689 rds_ring->crb_rcv_producer); in qlcnic_post_rx_buffers()
1695 struct qlcnic_host_rds_ring *rds_ring) in qlcnic_post_rx_buffers_nodb() argument
1702 if (!spin_trylock(&rds_ring->lock)) in qlcnic_post_rx_buffers_nodb()
1705 producer = rds_ring->producer; in qlcnic_post_rx_buffers_nodb()
1707 head = &rds_ring->free_list; in qlcnic_post_rx_buffers_nodb()
1713 if (qlcnic_alloc_rx_skb(adapter, rds_ring, buffer)) in qlcnic_post_rx_buffers_nodb()
1721 pdesc = &rds_ring->desc_head[producer]; in qlcnic_post_rx_buffers_nodb()
1723 pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); in qlcnic_post_rx_buffers_nodb()
1726 producer = get_next_index(producer, rds_ring->num_desc); in qlcnic_post_rx_buffers_nodb()
1730 rds_ring->producer = producer; in qlcnic_post_rx_buffers_nodb()
1731 writel((producer - 1) & (rds_ring->num_desc - 1), in qlcnic_post_rx_buffers_nodb()
1732 rds_ring->crb_rcv_producer); in qlcnic_post_rx_buffers_nodb()
1734 spin_unlock(&rds_ring->lock); in qlcnic_post_rx_buffers_nodb()