[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1e4a2aca-cde2-45ea-aebd-408fe9bf9672@rowland.harvard.edu>
Date: Fri, 25 Jul 2025 22:10:11 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Olivier Tuchon <tcn@...gle.com>
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: Add gadgetmon traffic monitor
On Fri, Jul 25, 2025 at 10:45:29PM +0200, Olivier Tuchon wrote:
> > There should be a similar optimization for IN givebacks. The data to
> > be transferred to the host was already recorded by the submission
> > hook, so you can save space by not copying it a second time during the
> > giveback.
>
> After a couple of tests, I found that the payload at the Submit ('S') stage
> is often meaningless (zero-filled) for both IN and OUT transfers or the
> payload size is already set to zero.
That doesn't sound right at all. Maybe your tests only covered
situations where no data was being sent? Certainly the response to a
Get-Device-Descriptor or Get-Config-Descriptor IN request would not have
a meaningless, zero-filled, or zero-length payload.
> I simplified the logic to drop the payload for ALL Submit events.
> Fixed in the next patch.
usbmon takes the opposite approach, omitting the payload for OUT
transfers during the giveback event rather than the submit event, and so
that's what I'm used to. But I suppose you could reasonably do it
either way.
Also, Greg will no doubt complain about some problems with the v2 patch
email. The most notable one was that formatting was messed up again
(tab characters replaced by a single space) -- you should try mailing
the patch to yourself first and then verifying that you can apply it as
received. In addition, it wasn't really a v2 patch because it applies
on top of the original patch, not as a replacement for the original.
Alan Stern
Powered by blists - more mailing lists