virtio: change comment in transmit
[deliverable/linux.git] / drivers / net / virtio_net.c
index f1ff3666f090d886e6b8ecc99bc6ac09d8687ef6..4e84236b62ce7ec8668c0a7792af318e088e29e6 100644 (file)
@@ -939,8 +939,12 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
        skb_orphan(skb);
        nf_reset(skb);
 
-       /* Apparently nice girls don't return TX_BUSY; stop the queue
-        * before it gets out of hand.  Naturally, this wastes entries. */
+       /* 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 (sq->vq->num_free < 2+MAX_SKB_FRAGS) {
                netif_stop_subqueue(dev, qnum);
                if (unlikely(!virtqueue_enable_cb_delayed(sq->vq))) {
@@ -1448,8 +1452,10 @@ static void virtnet_free_queues(struct virtnet_info *vi)
 {
        int i;
 
-       for (i = 0; i < vi->max_queue_pairs; i++)
+       for (i = 0; i < vi->max_queue_pairs; i++) {
+               napi_hash_del(&vi->rq[i].napi);
                netif_napi_del(&vi->rq[i].napi);
+       }
 
        kfree(vi->rq);
        kfree(vi->sq);
@@ -1948,11 +1954,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
        cancel_delayed_work_sync(&vi->refill);
 
        if (netif_running(vi->dev)) {
-               for (i = 0; i < vi->max_queue_pairs; i++) {
+               for (i = 0; i < vi->max_queue_pairs; i++)
                        napi_disable(&vi->rq[i].napi);
-                       napi_hash_del(&vi->rq[i].napi);
-                       netif_napi_del(&vi->rq[i].napi);
-               }
        }
 
        remove_vq_common(vi);
This page took 0.025198 seconds and 5 git commands to generate.