Lines Matching refs:rds_ring
49 struct nx_host_rds_ring *rds_ring);
110 struct nx_host_rds_ring *rds_ring; in netxen_release_rx_buffers() local
116 rds_ring = &recv_ctx->rds_rings[ring]; in netxen_release_rx_buffers()
117 for (i = 0; i < rds_ring->num_desc; ++i) { in netxen_release_rx_buffers()
118 rx_buf = &(rds_ring->rx_buf_arr[i]); in netxen_release_rx_buffers()
123 rds_ring->dma_size, in netxen_release_rx_buffers()
166 struct nx_host_rds_ring *rds_ring; in netxen_free_sw_resources() local
176 rds_ring = &recv_ctx->rds_rings[ring]; in netxen_free_sw_resources()
177 vfree(rds_ring->rx_buf_arr); in netxen_free_sw_resources()
178 rds_ring->rx_buf_arr = NULL; in netxen_free_sw_resources()
195 struct nx_host_rds_ring *rds_ring; in netxen_alloc_sw_resources() local
228 rds_ring = kzalloc(size, GFP_KERNEL); in netxen_alloc_sw_resources()
229 if (rds_ring == NULL) { in netxen_alloc_sw_resources()
234 recv_ctx->rds_rings = rds_ring; in netxen_alloc_sw_resources()
237 rds_ring = &recv_ctx->rds_rings[ring]; in netxen_alloc_sw_resources()
240 rds_ring->num_desc = adapter->num_rxd; in netxen_alloc_sw_resources()
242 rds_ring->dma_size = in netxen_alloc_sw_resources()
244 rds_ring->skb_size = in netxen_alloc_sw_resources()
248 rds_ring->dma_size = in netxen_alloc_sw_resources()
251 rds_ring->dma_size = in netxen_alloc_sw_resources()
253 rds_ring->skb_size = in netxen_alloc_sw_resources()
254 rds_ring->dma_size + NET_IP_ALIGN; in netxen_alloc_sw_resources()
259 rds_ring->num_desc = adapter->num_jumbo_rxd; in netxen_alloc_sw_resources()
261 rds_ring->dma_size = in netxen_alloc_sw_resources()
264 rds_ring->dma_size = in netxen_alloc_sw_resources()
268 rds_ring->dma_size += NX_LRO_BUFFER_EXTRA; in netxen_alloc_sw_resources()
270 rds_ring->skb_size = in netxen_alloc_sw_resources()
271 rds_ring->dma_size + NET_IP_ALIGN; in netxen_alloc_sw_resources()
275 rds_ring->num_desc = adapter->num_lro_rxd; in netxen_alloc_sw_resources()
276 rds_ring->dma_size = NX_RX_LRO_BUFFER_LENGTH; in netxen_alloc_sw_resources()
277 rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN; in netxen_alloc_sw_resources()
281 rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring)); in netxen_alloc_sw_resources()
282 if (rds_ring->rx_buf_arr == NULL) { in netxen_alloc_sw_resources()
289 INIT_LIST_HEAD(&rds_ring->free_list); in netxen_alloc_sw_resources()
294 rx_buf = rds_ring->rx_buf_arr; in netxen_alloc_sw_resources()
295 for (i = 0; i < rds_ring->num_desc; i++) { in netxen_alloc_sw_resources()
297 &rds_ring->free_list); in netxen_alloc_sw_resources()
302 spin_lock_init(&rds_ring->lock); in netxen_alloc_sw_resources()
1439 struct nx_host_rds_ring *rds_ring, in netxen_alloc_rx_skb() argument
1446 buffer->skb = dev_alloc_skb(rds_ring->skb_size); in netxen_alloc_rx_skb()
1456 rds_ring->dma_size, PCI_DMA_FROMDEVICE); in netxen_alloc_rx_skb()
1472 struct nx_host_rds_ring *rds_ring, u16 index, u16 cksum) in netxen_process_rxbuf() argument
1477 buffer = &rds_ring->rx_buf_arr[index]; in netxen_process_rxbuf()
1479 pci_unmap_single(adapter->pdev, buffer->dma, rds_ring->dma_size, in netxen_process_rxbuf()
1509 struct nx_host_rds_ring *rds_ring; in netxen_process_rcv() local
1515 rds_ring = &recv_ctx->rds_rings[ring]; in netxen_process_rcv()
1518 if (unlikely(index >= rds_ring->num_desc)) in netxen_process_rcv()
1521 buffer = &rds_ring->rx_buf_arr[index]; in netxen_process_rcv()
1527 skb = netxen_process_rxbuf(adapter, rds_ring, index, cksum); in netxen_process_rcv()
1531 if (length > rds_ring->skb_size) in netxen_process_rcv()
1532 skb_put(skb, rds_ring->skb_size); in netxen_process_rcv()
1563 struct nx_host_rds_ring *rds_ring; in netxen_process_lro() local
1575 rds_ring = &recv_ctx->rds_rings[ring]; in netxen_process_lro()
1578 if (unlikely(index > rds_ring->num_desc)) in netxen_process_lro()
1581 buffer = &rds_ring->rx_buf_arr[index]; in netxen_process_lro()
1590 skb = netxen_process_rxbuf(adapter, rds_ring, index, STATUS_CKSUM_OK); in netxen_process_lro()
1690 struct nx_host_rds_ring *rds_ring = in netxen_process_rcv_ring() local
1697 netxen_alloc_rx_skb(adapter, rds_ring, rxbuf); in netxen_process_rcv_ring()
1699 spin_lock(&rds_ring->lock); in netxen_process_rcv_ring()
1701 &rds_ring->free_list); in netxen_process_rcv_ring()
1702 spin_unlock(&rds_ring->lock); in netxen_process_rcv_ring()
1705 netxen_post_rx_buffers_nodb(adapter, rds_ring); in netxen_process_rcv_ring()
1790 struct nx_host_rds_ring *rds_ring) in netxen_post_rx_buffers() argument
1798 producer = rds_ring->producer; in netxen_post_rx_buffers()
1800 head = &rds_ring->free_list; in netxen_post_rx_buffers()
1806 if (netxen_alloc_rx_skb(adapter, rds_ring, buffer)) in netxen_post_rx_buffers()
1814 pdesc = &rds_ring->desc_head[producer]; in netxen_post_rx_buffers()
1817 pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); in netxen_post_rx_buffers()
1819 producer = get_next_index(producer, rds_ring->num_desc); in netxen_post_rx_buffers()
1823 rds_ring->producer = producer; in netxen_post_rx_buffers()
1824 NXWRIO(adapter, rds_ring->crb_rcv_producer, in netxen_post_rx_buffers()
1825 (producer-1) & (rds_ring->num_desc-1)); in netxen_post_rx_buffers()
1837 (rds_ring->num_desc - 1))); in netxen_post_rx_buffers()
1848 struct nx_host_rds_ring *rds_ring) in netxen_post_rx_buffers_nodb() argument
1855 if (!spin_trylock(&rds_ring->lock)) in netxen_post_rx_buffers_nodb()
1858 producer = rds_ring->producer; in netxen_post_rx_buffers_nodb()
1860 head = &rds_ring->free_list; in netxen_post_rx_buffers_nodb()
1866 if (netxen_alloc_rx_skb(adapter, rds_ring, buffer)) in netxen_post_rx_buffers_nodb()
1874 pdesc = &rds_ring->desc_head[producer]; in netxen_post_rx_buffers_nodb()
1876 pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); in netxen_post_rx_buffers_nodb()
1879 producer = get_next_index(producer, rds_ring->num_desc); in netxen_post_rx_buffers_nodb()
1883 rds_ring->producer = producer; in netxen_post_rx_buffers_nodb()
1884 NXWRIO(adapter, rds_ring->crb_rcv_producer, in netxen_post_rx_buffers_nodb()
1885 (producer - 1) & (rds_ring->num_desc - 1)); in netxen_post_rx_buffers_nodb()
1887 spin_unlock(&rds_ring->lock); in netxen_post_rx_buffers_nodb()