[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090619141014.GA19828@gondor.apana.org.au>
Date: Fri, 19 Jun 2009 22:10:14 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
David Miller <davem@...emloft.net>,
Matt Carlson <mcarlson@...adcom.com>
Subject: Re: [PATCH 2/4] virtio_net: return NETDEV_TX_BUSY instead of
queueing an extra skb.
On Fri, Jun 19, 2009 at 11:20:44PM +0930, Rusty Russell wrote:
>
> Your use of the word guarantee here indicates an idealized concept of QoS
> which cannot exist on any NIC which has a queue. We should try to approach
> the ideal, but understand we cannot reach it.
I'm just pointing out that it's better to not have to do this.
Since TX_BUSY and requeueing the packet is unnecessary in the
first place because we can avoid it by managing the stop-queue
action properly, there is no reason to do this because of its
downsides.
> On the other hand, we're underutilizing the queue to avoid it. I find that a
> little embarrassing.
Here's why I think this is not an issue. If your NIC is high
bandwidth then your ring is going to have to be huge so the
amount that is underutilised (a 64K packet) is tiny. If your
NIC is low bandwidth then this is where you often need QoS and
in that case you do *NOT* want to fully utilise the HW queue.
> I feel we're being horribly deceptive by giving them a nice API, and upon
> review, telling them "don't use that". And it's been ongoing for far too
> long.
If you look at our API documentation it actually says:
Return codes:
o NETDEV_TX_OK everything ok.
o NETDEV_TX_BUSY Cannot transmit packet, try later
Usually a bug, means queue start/stop flow control is broken in
the driver. Note: the driver must NOT put the skb in its DMA ring.
o NETDEV_TX_LOCKED Locking failed, please retry quickly.
Only valid when NETIF_F_LLTX is set.
So I don't feel too bad :)
> > In fact queueing it in the driver is just as bad as return TX_BUSY!
>
> Agreed (modulo the tcpdump issue). And worse, because it's ugly and complex!
The right solution is to stop the queue properly.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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