From: Alan Stern <stern@rowland.harvard.edu>
To: Olivier Tuchon <tcn@google.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: Add gadgetmon traffic monitor
Date: Fri, 25 Jul 2025 22:10:11 -0400 [thread overview]
Message-ID: <1e4a2aca-cde2-45ea-aebd-408fe9bf9672@rowland.harvard.edu> (raw)
In-Reply-To: <CALU+5VYnZfp2CqXqn7X14J5pGsXyHDOcC5mOCZx4nKA6tjzO2Q@mail.gmail.com>
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
prev parent reply other threads:[~2025-07-26 2:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 15:25 [PATCH] usb: gadget: Add gadgetmon traffic monitor Olivier Tuchon
2025-07-25 15:33 ` Greg KH
2025-07-25 20:51 ` Olivier Tuchon
2025-07-25 15:46 ` Alan Stern
2025-07-25 20:45 ` Olivier Tuchon
2025-07-26 2:10 ` Alan Stern [this message]
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=1e4a2aca-cde2-45ea-aebd-408fe9bf9672@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=tcn@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox