From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zoltan Kiss Subject: Re: RING_HAS_UNCONSUMED_REQUESTS oddness Date: Wed, 12 Mar 2014 14:41:42 +0000 Message-ID: <53207226.7090002@citrix.com> References: <5318987C.3030303@citrix.com> <1394552666.30915.64.camel@kazak.uk.xensource.com> <531F9B17.5060107@citrix.com> <1394620083.21145.21.camel@kazak.uk.xensource.com> <9AAE0902D5BC7E449B7C8E4E778ABCD0282CBF@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNkLr-0002zT-RN for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 14:41:48 +0000 In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD0282CBF@AMSPEX01CL01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant , Ian Campbell Cc: "xen-devel@lists.xenproject.org" , Wei Liu , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On 12/03/14 11:38, Paul Durrant wrote: >> -----Original Message----- >> From: Paul Durrant >> Sent: 12 March 2014 11:26 >> To: Ian Campbell; Zoltan Kiss >> Cc: xen-devel@lists.xenproject.org; Wei Liu; Tim (Xen.org) >> Subject: RE: [Xen-devel] RING_HAS_UNCONSUMED_REQUESTS oddness >> >>> -----Original Message----- >>> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel- >>> bounces@lists.xen.org] On Behalf Of Ian Campbell >>> Sent: 12 March 2014 10:28 >>> To: Zoltan Kiss >>> Cc: xen-devel@lists.xenproject.org; Wei Liu; Tim (Xen.org) >>> Subject: Re: [Xen-devel] RING_HAS_UNCONSUMED_REQUESTS oddness >>> >>> On Tue, 2014-03-11 at 23:24 +0000, Zoltan Kiss wrote: >>>> On 11/03/14 15:44, Ian Campbell wrote: >>> >>>>> Is it the case that this macro considers a request to be unconsumed if >>>>> the *response* to a request is outstanding as well as if the request >>>>> itself is still on the ring? >>>> I don't think that would make sense. I think everywhere where this >> macro >>>> is called the caller is not interested in pending request (pending means >>>> consumed but not responded) >>> >>> It might be interested in such pending requests in some of the >>> pathological cases I allude to in the next paragraph though? >>> >>> For example if the ring has unconsumed requests but there are no slots >>> free for a response, it would be better to treat it as no unconsumed >>> requests until space opens up for a response, otherwise something else >>> just has to abort the processing of the request when it notices the lack >>> of space. >>> >> >> Huh? The act of consuming the request will create the space for the >> response. If responses and requests are not balanced then I'd argue that the >> protocol is broken. >> > > Actually ancient memory tells me that, unfortunately, netback's backend->frontend GSO protocol is broken in this way... it requires one more response slot than the number of requests it consumes (for the extra metadata), which means that if the frontend keeps the ring full you can get overflow. It's a bit of a tangent though, because that code doesn't use this macro (or in fact check the ring has space in any way IIRC). The prefix variant of the protocol is ok though. I think it's not: it consumes a request for the metadata, and when the packet is grant copied to the guest, it creates a response for that slot as well.