From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH v2] tools/ocaml/xb: Correct calculations of data/space the ring Date: Tue, 10 Nov 2015 10:49:03 +0000 Message-ID: <20151110104903.GB18492@zion.uk.xensource.com> References: <1447152404-3672-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1447152404-3672-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Wei Liu , Ian Campbell , Ian Jackson , Xen-devel , David Scott , Samuel Thibault List-Id: xen-devel@lists.xenproject.org On Tue, Nov 10, 2015 at 10:46:44AM +0000, Andrew Cooper wrote: > ml_interface_{read,write}() would miscalculate the quantity of > data/space in the ring if it crossed the ring boundary, and incorrectly > return a short read/write. > > This causes a protocol stall, as either side of the ring ends up waiting > for what they believe to be the other side needing to take the next > action. > > Correct the calculations to cope with crossing the ring boundary. > > In addition, correct the error detection. It is a hard error if the > producer index gets more than a ring size ahead of the consumer, or if > the consumer ever overtakes the producer. > > Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu