skb_orphan(skb);
nf_reset(skb);
- /* It is better to stop queue if running out of space
- * instead of forcing queuing layer to requeue the skb
- * by returning TX_BUSY (and cause a BUG message).
- * Since most packets only take 1 or 2 ring slots
- * this means 16 slots are typically wasted.
+ /* If running out of space, stop queue to avoid getting packets that we
+ * are then unable to transmit.
+ * An alternative would be to force queuing layer to requeue the skb by
+ * returning NETDEV_TX_BUSY. However, NETDEV_TX_BUSY should not be
+ * returned in a normal path of operation: it means that driver is not
+ * maintaining the TX queue stop/start state properly, and causes
+ * the stack to do a non-trivial amount of useless work.
+ * Since most packets only take 1 or 2 ring slots, stopping the queue
+ * early means 16 slots are typically wasted.
*/
if (sq->vq->num_free < 2+MAX_SKB_FRAGS) {
netif_stop_subqueue(dev, qnum);