Lines Matching refs:tx_queue

133 		gfar_write(baddr, priv->tx_queue[i]->tx_bd_dma_base);  in gfar_init_tx_rx_base()
248 if (likely(priv->tx_queue[i]->txcoalescing)) in gfar_configure_coalescing()
249 gfar_write(baddr + i, priv->tx_queue[i]->txic); in gfar_configure_coalescing()
263 if (likely(priv->tx_queue[0]->txcoalescing)) in gfar_configure_coalescing()
264 gfar_write(&regs->txic, priv->tx_queue[0]->txic); in gfar_configure_coalescing()
289 stats->tx_bytes += priv->tx_queue[i]->stats.tx_bytes; in gfar_get_stats64()
290 stats->tx_packets += priv->tx_queue[i]->stats.tx_packets; in gfar_get_stats64()
415 priv->tx_queue[i] = kzalloc(sizeof(struct gfar_priv_tx_q), in gfar_alloc_tx_queues()
417 if (!priv->tx_queue[i]) in gfar_alloc_tx_queues()
420 priv->tx_queue[i]->tx_skbuff = NULL; in gfar_alloc_tx_queues()
421 priv->tx_queue[i]->qindex = i; in gfar_alloc_tx_queues()
422 priv->tx_queue[i]->dev = priv->ndev; in gfar_alloc_tx_queues()
423 spin_lock_init(&(priv->tx_queue[i]->txlock)); in gfar_alloc_tx_queues()
449 kfree(priv->tx_queue[i]); in gfar_free_tx_queues()
561 if (!grp->tx_queue) in gfar_parse_group()
562 grp->tx_queue = priv->tx_queue[i]; in gfar_parse_group()
566 priv->tx_queue[i]->grp = grp; in gfar_parse_group()
1064 static void free_skb_tx_queue(struct gfar_priv_tx_q *tx_queue) in free_skb_tx_queue() argument
1067 struct gfar_private *priv = netdev_priv(tx_queue->dev); in free_skb_tx_queue()
1070 txbdp = tx_queue->tx_bd_base; in free_skb_tx_queue()
1072 for (i = 0; i < tx_queue->tx_ring_size; i++) { in free_skb_tx_queue()
1073 if (!tx_queue->tx_skbuff[i]) in free_skb_tx_queue()
1079 for (j = 0; j < skb_shinfo(tx_queue->tx_skbuff[i])->nr_frags; in free_skb_tx_queue()
1087 dev_kfree_skb_any(tx_queue->tx_skbuff[i]); in free_skb_tx_queue()
1088 tx_queue->tx_skbuff[i] = NULL; in free_skb_tx_queue()
1090 kfree(tx_queue->tx_skbuff); in free_skb_tx_queue()
1091 tx_queue->tx_skbuff = NULL; in free_skb_tx_queue()
1128 struct gfar_priv_tx_q *tx_queue = NULL; in free_skb_resources() local
1136 tx_queue = priv->tx_queue[i]; in free_skb_resources()
1137 txq = netdev_get_tx_queue(tx_queue->dev, tx_queue->qindex); in free_skb_resources()
1138 if (tx_queue->tx_skbuff) in free_skb_resources()
1139 free_skb_tx_queue(tx_queue); in free_skb_resources()
1152 priv->tx_queue[0]->tx_bd_base, in free_skb_resources()
1153 priv->tx_queue[0]->tx_bd_dma_base); in free_skb_resources()
1288 struct gfar_priv_tx_q *tx_queue = NULL; in gfar_init_bds() local
1295 tx_queue = priv->tx_queue[i]; in gfar_init_bds()
1297 tx_queue->num_txbdfree = tx_queue->tx_ring_size; in gfar_init_bds()
1298 tx_queue->dirty_tx = tx_queue->tx_bd_base; in gfar_init_bds()
1299 tx_queue->cur_tx = tx_queue->tx_bd_base; in gfar_init_bds()
1300 tx_queue->skb_curtx = 0; in gfar_init_bds()
1301 tx_queue->skb_dirtytx = 0; in gfar_init_bds()
1304 txbdp = tx_queue->tx_bd_base; in gfar_init_bds()
1305 for (j = 0; j < tx_queue->tx_ring_size; j++) { in gfar_init_bds()
1342 struct gfar_priv_tx_q *tx_queue = NULL; in gfar_alloc_skb_resources() local
1347 priv->total_tx_ring_size += priv->tx_queue[i]->tx_ring_size; in gfar_alloc_skb_resources()
1364 tx_queue = priv->tx_queue[i]; in gfar_alloc_skb_resources()
1365 tx_queue->tx_bd_base = vaddr; in gfar_alloc_skb_resources()
1366 tx_queue->tx_bd_dma_base = addr; in gfar_alloc_skb_resources()
1367 tx_queue->dev = ndev; in gfar_alloc_skb_resources()
1369 addr += sizeof(struct txbd8) * tx_queue->tx_ring_size; in gfar_alloc_skb_resources()
1370 vaddr += sizeof(struct txbd8) * tx_queue->tx_ring_size; in gfar_alloc_skb_resources()
1386 tx_queue = priv->tx_queue[i]; in gfar_alloc_skb_resources()
1387 tx_queue->tx_skbuff = in gfar_alloc_skb_resources()
1388 kmalloc_array(tx_queue->tx_ring_size, in gfar_alloc_skb_resources()
1389 sizeof(*tx_queue->tx_skbuff), in gfar_alloc_skb_resources()
1391 if (!tx_queue->tx_skbuff) in gfar_alloc_skb_resources()
1394 for (j = 0; j < tx_queue->tx_ring_size; j++) in gfar_alloc_skb_resources()
1395 tx_queue->tx_skbuff[j] = NULL; in gfar_alloc_skb_resources()
1774 struct gfar_priv_tx_q *tx_queue = NULL; in gfar_start_xmit() local
1787 tx_queue = priv->tx_queue[rq]; in gfar_start_xmit()
1789 base = tx_queue->tx_bd_base; in gfar_start_xmit()
1790 regs = tx_queue->grp->regs; in gfar_start_xmit()
1823 if (nr_txbds > tx_queue->num_txbdfree) { in gfar_start_xmit()
1832 tx_queue->stats.tx_bytes += bytes_sent; in gfar_start_xmit()
1835 tx_queue->stats.tx_packets++; in gfar_start_xmit()
1837 txbdp = txbdp_start = tx_queue->cur_tx; in gfar_start_xmit()
1884 tx_queue->tx_ring_size); in gfar_start_xmit()
1898 txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size); in gfar_start_xmit()
1958 tx_queue->tx_skbuff[tx_queue->skb_curtx] = skb; in gfar_start_xmit()
1963 tx_queue->skb_curtx = (tx_queue->skb_curtx + 1) & in gfar_start_xmit()
1964 TX_RING_MOD_MASK(tx_queue->tx_ring_size); in gfar_start_xmit()
1966 tx_queue->cur_tx = next_txbd(txbdp, base, tx_queue->tx_ring_size); in gfar_start_xmit()
1973 spin_lock_bh(&tx_queue->txlock); in gfar_start_xmit()
1975 tx_queue->num_txbdfree -= (nr_txbds); in gfar_start_xmit()
1976 spin_unlock_bh(&tx_queue->txlock); in gfar_start_xmit()
1981 if (!tx_queue->num_txbdfree) { in gfar_start_xmit()
1988 gfar_write(&regs->tstat, TSTAT_CLEAR_THALT >> tx_queue->qindex); in gfar_start_xmit()
1993 txbdp = next_txbd(txbdp_start, base, tx_queue->tx_ring_size); in gfar_start_xmit()
1995 txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size); in gfar_start_xmit()
2006 txbdp = next_txbd(txbdp, base, tx_queue->tx_ring_size); in gfar_start_xmit()
2150 static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) in gfar_clean_tx_ring() argument
2152 struct net_device *dev = tx_queue->dev; in gfar_clean_tx_ring()
2157 struct txbd8 *base = tx_queue->tx_bd_base; in gfar_clean_tx_ring()
2160 int tx_ring_size = tx_queue->tx_ring_size; in gfar_clean_tx_ring()
2164 int tqi = tx_queue->qindex; in gfar_clean_tx_ring()
2170 bdp = tx_queue->dirty_tx; in gfar_clean_tx_ring()
2171 skb_dirtytx = tx_queue->skb_dirtytx; in gfar_clean_tx_ring()
2173 while ((skb = tx_queue->tx_skbuff[skb_dirtytx])) { in gfar_clean_tx_ring()
2236 tx_queue->tx_skbuff[skb_dirtytx] = NULL; in gfar_clean_tx_ring()
2242 spin_lock(&tx_queue->txlock); in gfar_clean_tx_ring()
2243 tx_queue->num_txbdfree += nr_txbds; in gfar_clean_tx_ring()
2244 spin_unlock(&tx_queue->txlock); in gfar_clean_tx_ring()
2248 if (tx_queue->num_txbdfree && in gfar_clean_tx_ring()
2254 tx_queue->skb_dirtytx = skb_dirtytx; in gfar_clean_tx_ring()
2255 tx_queue->dirty_tx = bdp; in gfar_clean_tx_ring()
2642 struct gfar_priv_tx_q *tx_queue = gfargrp->tx_queue; in gfar_poll_tx_sq() local
2651 if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) in gfar_poll_tx_sq()
2652 gfar_clean_tx_ring(tx_queue); in gfar_poll_tx_sq()
3272 priv->tx_queue[i]->tx_ring_size = DEFAULT_TX_RING_SIZE; in gfar_probe()
3273 priv->tx_queue[i]->num_txbdfree = DEFAULT_TX_RING_SIZE; in gfar_probe()
3274 priv->tx_queue[i]->txcoalescing = DEFAULT_TX_COALESCE; in gfar_probe()
3275 priv->tx_queue[i]->txic = DEFAULT_TXIC; in gfar_probe()
3353 i, priv->tx_queue[i]->tx_ring_size); in gfar_probe()