Lines Matching refs:txp
91 struct ifb_q_private *txp = from_tasklet(txp, t, ifb_tasklet); in ifb_ri_tasklet() local
95 txq = netdev_get_tx_queue(txp->dev, txp->txqnum); in ifb_ri_tasklet()
96 skb = skb_peek(&txp->tq); in ifb_ri_tasklet()
100 skb_queue_splice_tail_init(&txp->rq, &txp->tq); in ifb_ri_tasklet()
104 while ((skb = __skb_dequeue(&txp->tq)) != NULL) { in ifb_ri_tasklet()
112 ifb_update_q_stats(&txp->tx_stats, skb->len); in ifb_ri_tasklet()
115 skb->dev = dev_get_by_index_rcu(dev_net(txp->dev), skb->skb_iif); in ifb_ri_tasklet()
119 txp->dev->stats.tx_dropped++; in ifb_ri_tasklet()
120 if (skb_queue_len(&txp->tq) != 0) in ifb_ri_tasklet()
125 skb->skb_iif = txp->dev->ifindex; in ifb_ri_tasklet()
136 skb = skb_peek(&txp->rq); in ifb_ri_tasklet()
138 txp->tasklet_pending = 0; in ifb_ri_tasklet()
148 txp->tasklet_pending = 1; in ifb_ri_tasklet()
149 tasklet_schedule(&txp->ifb_tasklet); in ifb_ri_tasklet()
158 struct ifb_q_private *txp = dp->tx_private; in ifb_stats64() local
163 for (i = 0; i < dev->num_tx_queues; i++,txp++) { in ifb_stats64()
165 start = u64_stats_fetch_begin(&txp->rx_stats.sync); in ifb_stats64()
166 packets = txp->rx_stats.packets; in ifb_stats64()
167 bytes = txp->rx_stats.bytes; in ifb_stats64()
168 } while (u64_stats_fetch_retry(&txp->rx_stats.sync, start)); in ifb_stats64()
173 start = u64_stats_fetch_begin(&txp->tx_stats.sync); in ifb_stats64()
174 packets = txp->tx_stats.packets; in ifb_stats64()
175 bytes = txp->tx_stats.bytes; in ifb_stats64()
176 } while (u64_stats_fetch_retry(&txp->tx_stats.sync, start)); in ifb_stats64()
187 struct ifb_q_private *txp; in ifb_dev_init() local
190 txp = kcalloc(dev->num_tx_queues, sizeof(*txp), GFP_KERNEL); in ifb_dev_init()
191 if (!txp) in ifb_dev_init()
193 dp->tx_private = txp; in ifb_dev_init()
194 for (i = 0; i < dev->num_tx_queues; i++,txp++) { in ifb_dev_init()
195 txp->txqnum = i; in ifb_dev_init()
196 txp->dev = dev; in ifb_dev_init()
197 __skb_queue_head_init(&txp->rq); in ifb_dev_init()
198 __skb_queue_head_init(&txp->tq); in ifb_dev_init()
199 u64_stats_init(&txp->rx_stats.sync); in ifb_dev_init()
200 u64_stats_init(&txp->tx_stats.sync); in ifb_dev_init()
201 tasklet_setup(&txp->ifb_tasklet, ifb_ri_tasklet); in ifb_dev_init()
262 struct ifb_q_private *txp; in ifb_get_ethtool_stats() local
266 txp = dp->tx_private + i; in ifb_get_ethtool_stats()
267 ifb_fill_stats_data(&data, &txp->rx_stats); in ifb_get_ethtool_stats()
271 txp = dp->tx_private + i; in ifb_get_ethtool_stats()
272 ifb_fill_stats_data(&data, &txp->tx_stats); in ifb_get_ethtool_stats()
299 struct ifb_q_private *txp = dp->tx_private; in ifb_dev_free() local
302 for (i = 0; i < dev->num_tx_queues; i++,txp++) { in ifb_dev_free()
303 tasklet_kill(&txp->ifb_tasklet); in ifb_dev_free()
304 __skb_queue_purge(&txp->rq); in ifb_dev_free()
305 __skb_queue_purge(&txp->tq); in ifb_dev_free()
341 struct ifb_q_private *txp = dp->tx_private + skb_get_queue_mapping(skb); in ifb_xmit() local
343 ifb_update_q_stats(&txp->rx_stats, skb->len); in ifb_xmit()
351 if (skb_queue_len(&txp->rq) >= dev->tx_queue_len) in ifb_xmit()
352 netif_tx_stop_queue(netdev_get_tx_queue(dev, txp->txqnum)); in ifb_xmit()
354 __skb_queue_tail(&txp->rq, skb); in ifb_xmit()
355 if (!txp->tasklet_pending) { in ifb_xmit()
356 txp->tasklet_pending = 1; in ifb_xmit()
357 tasklet_schedule(&txp->ifb_tasklet); in ifb_xmit()