[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y4mlhglx.fsf@rustcorp.com.au>
Date: Wed, 25 Mar 2015 14:29:38 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Stephen Hemminger <stephen@...workplumber.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
David Miller <davem@...emloft.net>
Cc: virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] virtio: change comment in transmit
Stephen Hemminger <stephen@...workplumber.org> writes:
> The original comment was not really informative or funny
> as well as sexist. Replace it with a better explanation of
> why the driver does stop and what the impacts are.
>
> Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
Fair call. Comment was certainly snarky, probably sexist. I think it
expressed my feelings perfectly, however.
I note that there's still no comment saying "don't do this" in
netdevice.h; I gather returning NETDEV_TX_BUSY is still considered a Bad
Thing?
(Does it really BUG_ON?)
Thanks,
Rusty.
> --- a/drivers/net/virtio_net.c 2015-03-24 15:20:25.174671000 -0700
> +++ b/drivers/net/virtio_net.c 2015-03-24 16:17:28.478525333 -0700
> @@ -939,8 +939,12 @@ static netdev_tx_t start_xmit(struct sk_
> 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))) {
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists