[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALU+5VYnZfp2CqXqn7X14J5pGsXyHDOcC5mOCZx4nKA6tjzO2Q@mail.gmail.com>
Date: Fri, 25 Jul 2025 22:45:29 +0200
From: Olivier Tuchon <tcn@...gle.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: Add gadgetmon traffic monitor
> > The UDC core is modified to add an optional monitoring interface defined
> > by struct usb_gadget_mon_operations in <linux/usb/gadget.h>.
>
> This does not appear in the patch. Was it left out by mistake?
My bad, sorry for this silly mistake.
Files will be included in the next patch.
> Do you expect that other gadget monitoring modules will be written?
> If they are, assignment to the global pointer should be handled by a
> routine in the gadget core, not in the monitoring module as done here.
I have no plan to write another one but designing the API to support it
is a very interesting approach. I implemented it in the next patch.
> 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.
I simplified the logic to drop the payload for ALL Submit events.
Fixed in the next patch.
> Would it be better to keep the event but drop the tail end of the data?
Thanks, excellent suggestion. I implemented it in the next patch.
Thank you for your review, Alan.
Powered by blists - more mailing lists