From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLade-0003mz-DN for qemu-devel@nongnu.org; Tue, 09 Oct 2012 10:18:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLadY-0002Lc-Gj for qemu-devel@nongnu.org; Tue, 09 Oct 2012 10:18:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLadY-0002L7-7V for qemu-devel@nongnu.org; Tue, 09 Oct 2012 10:18:20 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q99EIJnP004573 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Oct 2012 10:18:19 -0400 Message-ID: <50743287.905@redhat.com> Date: Tue, 09 Oct 2012 16:19:51 +0200 From: Hans de Goede MIME-Version: 1.0 References: <1349682696-3046-1-git-send-email-hdegoede@redhat.com> <1349682696-3046-5-git-send-email-hdegoede@redhat.com> <5072CC04.4010300@redhat.com> <5072E838.8080104@redhat.com> <5073ECB6.4090408@redhat.com> <5073FF0A.6080304@redhat.com> <50742728.2020601@redhat.com> In-Reply-To: <50742728.2020601@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/12] usb: Add support for input pipelining List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Hi, On 10/09/2012 03:31 PM, Gerd Hoffmann wrote: >>> The core can and should do that for packets it owns (USBPacketState == >>> USB_PACKET_QUEUED) because they are not (yet) passed to the USBDevice. >>> >>> Packets owned by USBDevice (USBPacketState == USB_PACKET_ASYNC) must be >>> handled by the USBDevice itself. >> >> Getting offtopic a bit here, but this not how we currently handle >> things, currently the hcd code cancels packets after a queue halt, > > Ah, right. Well, that should continue to work. USB_RET_NOT_USED would > make the hcd code just free the packet, and anything not-yet freed will > be zapped by the queue halt handling. > Right. >> 2) If you agree with 1, then I assume you agree we will want to share >> the combining code between host-linux.c (or host-* for that matter) and >> redirect.c ? > > I'm not sure there is that much to share. > It is not much, but you rightly called it "magic" before, as it is somewhat tricky code, so better to write (and debug) it once :) > A helper function which takes a USBEndpoint and returns an iovec for all > USBPackets lined up there would probably be useful. Likewise for one > for completing the packets (takes xfer length + status, then fill > USBPacket->result & call usb_packet_complete for each packet). That is more or less what I had in mind yes :) > But beyond that? > >> 3) If you agree with 2, then all we need is a place for the shared logic >> to live, we could put it in a new file called input-pipeline.c ? > > Just stick the helpers into hw/usb/core.c? I think core.c is getting a bit crowded, so I'll go with a new file for the next revision, if you don't like that moving the functions someplace else is easy :) I'll start working on a new reworked version of the patchset which hopefully will be more to your liking :) Regards, Hans