Lines Matching refs:rx_queue
142 int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit);
156 static void gfar_init_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp, in gfar_init_rxbdp() argument
164 if (bdp == rx_queue->rx_bd_base + rx_queue->rx_ring_size - 1) in gfar_init_rxbdp()
177 struct gfar_priv_rx_q *rx_queue = NULL; in gfar_init_bds() local
209 rx_queue = priv->rx_queue[i]; in gfar_init_bds()
210 rx_queue->cur_rx = rx_queue->rx_bd_base; in gfar_init_bds()
211 rx_queue->skb_currx = 0; in gfar_init_bds()
212 rxbdp = rx_queue->rx_bd_base; in gfar_init_bds()
214 for (j = 0; j < rx_queue->rx_ring_size; j++) { in gfar_init_bds()
215 struct sk_buff *skb = rx_queue->rx_skbuff[j]; in gfar_init_bds()
225 rx_queue->rx_skbuff[j] = skb; in gfar_init_bds()
228 gfar_init_rxbdp(rx_queue, rxbdp, bufaddr); in gfar_init_bds()
232 rx_queue->rfbptr = rfbptr; in gfar_init_bds()
247 struct gfar_priv_rx_q *rx_queue = NULL; in gfar_alloc_skb_resources() local
255 priv->total_rx_ring_size += priv->rx_queue[i]->rx_ring_size; in gfar_alloc_skb_resources()
279 rx_queue = priv->rx_queue[i]; in gfar_alloc_skb_resources()
280 rx_queue->rx_bd_base = vaddr; in gfar_alloc_skb_resources()
281 rx_queue->rx_bd_dma_base = addr; in gfar_alloc_skb_resources()
282 rx_queue->dev = ndev; in gfar_alloc_skb_resources()
283 addr += sizeof(struct rxbd8) * rx_queue->rx_ring_size; in gfar_alloc_skb_resources()
284 vaddr += sizeof(struct rxbd8) * rx_queue->rx_ring_size; in gfar_alloc_skb_resources()
302 rx_queue = priv->rx_queue[i]; in gfar_alloc_skb_resources()
303 rx_queue->rx_skbuff = in gfar_alloc_skb_resources()
304 kmalloc_array(rx_queue->rx_ring_size, in gfar_alloc_skb_resources()
305 sizeof(*rx_queue->rx_skbuff), in gfar_alloc_skb_resources()
307 if (!rx_queue->rx_skbuff) in gfar_alloc_skb_resources()
310 for (j = 0; j < rx_queue->rx_ring_size; j++) in gfar_alloc_skb_resources()
311 rx_queue->rx_skbuff[j] = NULL; in gfar_alloc_skb_resources()
338 gfar_write(baddr, priv->rx_queue[i]->rx_bd_dma_base); in gfar_init_tx_rx_base()
351 gfar_write(baddr, priv->rx_queue[i]->rx_ring_size | in gfar_init_rqprm()
469 if (likely(priv->rx_queue[i]->rxcoalescing)) in gfar_configure_coalescing()
470 gfar_write(baddr + i, priv->rx_queue[i]->rxic); in gfar_configure_coalescing()
481 if (unlikely(priv->rx_queue[0]->rxcoalescing)) in gfar_configure_coalescing()
482 gfar_write(®s->rxic, priv->rx_queue[0]->rxic); in gfar_configure_coalescing()
499 rx_packets += priv->rx_queue[i]->stats.rx_packets; in gfar_get_stats()
500 rx_bytes += priv->rx_queue[i]->stats.rx_bytes; in gfar_get_stats()
501 rx_dropped += priv->rx_queue[i]->stats.rx_dropped; in gfar_get_stats()
598 priv->rx_queue[i] = kzalloc(sizeof(struct gfar_priv_rx_q), in gfar_alloc_rx_queues()
600 if (!priv->rx_queue[i]) in gfar_alloc_rx_queues()
603 priv->rx_queue[i]->rx_skbuff = NULL; in gfar_alloc_rx_queues()
604 priv->rx_queue[i]->qindex = i; in gfar_alloc_rx_queues()
605 priv->rx_queue[i]->dev = priv->ndev; in gfar_alloc_rx_queues()
623 kfree(priv->rx_queue[i]); in gfar_free_rx_queues()
738 if (!grp->rx_queue) in gfar_parse_group()
739 grp->rx_queue = priv->rx_queue[i]; in gfar_parse_group()
743 priv->rx_queue[i]->grp = grp; in gfar_parse_group()
1435 priv->rx_queue[i]->rx_ring_size = DEFAULT_RX_RING_SIZE; in gfar_probe()
1436 priv->rx_queue[i]->rxcoalescing = DEFAULT_RX_COALESCE; in gfar_probe()
1437 priv->rx_queue[i]->rxic = DEFAULT_RXIC; in gfar_probe()
1492 i, priv->rx_queue[i]->rx_ring_size); in gfar_probe()
1923 static void free_skb_rx_queue(struct gfar_priv_rx_q *rx_queue) in free_skb_rx_queue() argument
1926 struct gfar_private *priv = netdev_priv(rx_queue->dev); in free_skb_rx_queue()
1929 rxbdp = rx_queue->rx_bd_base; in free_skb_rx_queue()
1931 for (i = 0; i < rx_queue->rx_ring_size; i++) { in free_skb_rx_queue()
1932 if (rx_queue->rx_skbuff[i]) { in free_skb_rx_queue()
1936 dev_kfree_skb_any(rx_queue->rx_skbuff[i]); in free_skb_rx_queue()
1937 rx_queue->rx_skbuff[i] = NULL; in free_skb_rx_queue()
1943 kfree(rx_queue->rx_skbuff); in free_skb_rx_queue()
1944 rx_queue->rx_skbuff = NULL; in free_skb_rx_queue()
1953 struct gfar_priv_rx_q *rx_queue = NULL; in free_skb_resources() local
1968 rx_queue = priv->rx_queue[i]; in free_skb_resources()
1969 if (rx_queue->rx_skbuff) in free_skb_resources()
1970 free_skb_rx_queue(rx_queue); in free_skb_resources()
2893 int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit) in gfar_clean_rx_ring() argument
2895 struct net_device *dev = rx_queue->dev; in gfar_clean_rx_ring()
2904 bdp = rx_queue->cur_rx; in gfar_clean_rx_ring()
2905 base = rx_queue->rx_bd_base; in gfar_clean_rx_ring()
2918 skb = rx_queue->rx_skbuff[rx_queue->skb_currx]; in gfar_clean_rx_ring()
2940 rx_queue->stats.rx_packets++; in gfar_clean_rx_ring()
2948 rx_queue->stats.rx_bytes += pkt_len; in gfar_clean_rx_ring()
2949 skb_record_rx_queue(skb, rx_queue->qindex); in gfar_clean_rx_ring()
2951 &rx_queue->grp->napi_rx); in gfar_clean_rx_ring()
2955 rx_queue->stats.rx_dropped++; in gfar_clean_rx_ring()
2961 rx_queue->rx_skbuff[rx_queue->skb_currx] = newskb; in gfar_clean_rx_ring()
2964 gfar_init_rxbdp(rx_queue, bdp, bufaddr); in gfar_clean_rx_ring()
2967 if (unlikely(rx_queue->rfbptr && priv->tx_actual_en)) in gfar_clean_rx_ring()
2968 gfar_write(rx_queue->rfbptr, (u32)bdp); in gfar_clean_rx_ring()
2971 bdp = next_bd(bdp, base, rx_queue->rx_ring_size); in gfar_clean_rx_ring()
2974 rx_queue->skb_currx = (rx_queue->skb_currx + 1) & in gfar_clean_rx_ring()
2975 RX_RING_MOD_MASK(rx_queue->rx_ring_size); in gfar_clean_rx_ring()
2979 rx_queue->cur_rx = bdp; in gfar_clean_rx_ring()
2989 struct gfar_priv_rx_q *rx_queue = gfargrp->rx_queue; in gfar_poll_rx_sq() local
2997 work_done = gfar_clean_rx_ring(rx_queue, budget); in gfar_poll_rx_sq()
3049 struct gfar_priv_rx_q *rx_queue = NULL; in gfar_poll_rx() local
3071 rx_queue = priv->rx_queue[i]; in gfar_poll_rx()
3073 gfar_clean_rx_ring(rx_queue, budget_per_q); in gfar_poll_rx()
3504 struct gfar_priv_rx_q *rx_queue = NULL; in gfar_update_link_state() local
3563 rx_queue = priv->rx_queue[i]; in gfar_update_link_state()
3564 bdp = rx_queue->cur_rx; in gfar_update_link_state()
3566 bdp = skip_bd(bdp, rx_queue->rx_ring_size - 1, in gfar_update_link_state()
3567 rx_queue->rx_bd_base, in gfar_update_link_state()
3568 rx_queue->rx_ring_size); in gfar_update_link_state()
3570 if (rx_queue->rfbptr) in gfar_update_link_state()
3571 gfar_write(rx_queue->rfbptr, (u32)bdp); in gfar_update_link_state()