From: Wei Liu <wei.liu2@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: <netdev@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
Ian Campbell <ian.campbell@citrix.com>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH 2/3] xen-netback: fix unlimited guest Rx internal queue and carrier flapping
Date: Thu, 23 Oct 2014 12:40:17 +0100 [thread overview]
Message-ID: <20141023114017.GG9188@zion.uk.xensource.com> (raw)
In-Reply-To: <1413983335-8307-3-git-send-email-david.vrabel@citrix.com>
On Wed, Oct 22, 2014 at 02:08:54PM +0100, David Vrabel wrote:
> Netback needs to discard old to-guest skb's (guest Rx queue drain) and
> it needs detect guest Rx stalls (to disable the carrier so packets are
> discarded earlier), but the current implementation is very broken.
>
> 1. The check in hard_start_xmit of the slot availability did not
> consider the number of packets that were already in the guest Rx
> queue. This could allow the queue to grow without bound.
>
> The guest stops consuming packets and the ring was allowed to fill
> leaving S slot free. Netback queues a packet requiring more than S
> slots (ensuring that the ring stays with S slots free). Netback
> queue indefinately packets provided that then require S or fewer
> slots.
>
> 2. The Rx stall detection is not triggered in this case since the
> (host) Tx queue is not stopped.
>
> 3. If the Tx queue is stopped and a guest Rx interrupt occurs, netback
> will consider this an Rx purge event which may result in it taking
> the carrier down unnecessarily. It also considers a queue with
> only 1 slot free as unstalled (even though the next packet might
> not fit in this).
>
> The internal guest Rx queue is limited by a byte length (to 512 Kib,
> enough for half the ring). The (host) Tx queue is stopped and started
> based on this limit. This sets an upper bound on the amount of memory
> used by packets on the internal queue.
>
> This allows the estimatation of the number of slots for an skb to be
> removed (it wasn't a very good estimate anyway). Instead, the guest
+1 for this.
> Rx thread just waits for enough free slots for a maximum sized packet.
>
> skbs queued on the internal queue have an 'expires' time (set to the
> current time plus the drain timeout). The guest Rx thread will detect
> when the skb at the head of the queue has expired and discard expired
> skbs. This sets a clear upper bound on the length of time an skb can
> be queued for. For a guest being destroyed the maximum time needed to
> wait for all the packets it sent to be dropped is still the drain
> timeout (10 s) since it will not be sending new packets.
>
> Rx stall detection is reintroduced in a later commit.
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
next prev parent reply other threads:[~2014-10-23 11:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 13:08 [PATCHv1 0/3 net-next] xen-netback: guest Rx queue drain and stall fixes David Vrabel
2014-10-22 13:08 ` [PATCH 1/3] xen-netback: make feature-rx-notify mandatory David Vrabel
2014-10-23 11:16 ` Wei Liu
2014-10-23 11:32 ` Wei Liu
2014-10-23 11:32 ` Wei Liu
2014-10-23 11:37 ` David Vrabel
2014-10-23 11:44 ` Wei Liu
2014-10-23 11:52 ` David Vrabel
2014-10-23 11:52 ` David Vrabel
2014-10-23 11:44 ` Wei Liu
2014-10-23 11:37 ` David Vrabel
2014-10-23 11:16 ` Wei Liu
2014-10-22 13:08 ` David Vrabel
2014-10-22 13:08 ` [PATCH 2/3] xen-netback: fix unlimited guest Rx internal queue and carrier flapping David Vrabel
2014-10-22 13:08 ` David Vrabel
2014-10-23 11:40 ` Wei Liu
2014-10-23 11:40 ` Wei Liu [this message]
2014-10-22 13:08 ` [PATCH 3/3] xen-netback: reintroduce guest Rx stall detection David Vrabel
2014-10-23 11:49 ` Wei Liu
2014-10-23 11:49 ` Wei Liu
2014-10-22 13:08 ` David Vrabel
2014-10-25 18:14 ` [PATCHv1 0/3 net-next] xen-netback: guest Rx queue drain and stall fixes David Miller
2014-10-25 18:17 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141023114017.GG9188@zion.uk.xensource.com \
--to=wei.liu2@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.