The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server
@ 2026-11-20  6:19 Zhu Jun
  2026-11-20  9:48 ` Michael Grzeschik
  2026-11-23  0:59 ` Dominique Martinet
  0 siblings, 2 replies; 5+ messages in thread
From: Zhu Jun @ 2026-11-20  6:19 UTC (permalink / raw)
  To: mgr; +Cc: nkapron, gregkh, linux-usb, v9fs, linux-kernel, Zhu Jun

socket.send() can return after sending only a prefix of a request.
The forwarder ignores that result and waits for a response to an
incomplete message. Use sendall() so request forwarding completes
only once all bytes have been sent or a write error is reported.

Fixes: 673f0c3ffc75 ("tools: usb: p9_fwd: add usb gadget packet forwarder script")
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 tools/usb/p9_fwd.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/usb/p9_fwd.py b/tools/usb/p9_fwd.py
index 12c76cbb046b..d5ffb2f0c5ab 100755
--- a/tools/usb/p9_fwd.py
+++ b/tools/usb/p9_fwd.py
@@ -124,7 +124,7 @@ class Forwarder:
             data += self.ep_in.read(size - len(data))
         logging.log(logging.TRACE, "c2s: writing")
         self._log_hexdump(data)
-        self.s.send(data)
+        self.s.sendall(data)
         logging.debug("c2s: forwarded %i bytes", size)
         self.stats["c2s packets"] += 1
         self.stats["c2s bytes"] += size



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server
  2026-11-20  6:19 [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server Zhu Jun
@ 2026-11-20  9:48 ` Michael Grzeschik
  2026-11-23  0:59 ` Dominique Martinet
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Grzeschik @ 2026-11-20  9:48 UTC (permalink / raw)
  To: Zhu Jun; +Cc: nkapron, gregkh, linux-usb, v9fs, linux-kernel

On Fri, Nov 20, 2026 at 02:19:37PM +0800, Zhu Jun wrote:
> socket.send() can return after sending only a prefix of a request.
> The forwarder ignores that result and waits for a response to an
> incomplete message. Use sendall() so request forwarding completes
> only once all bytes have been sent or a write error is reported.
> 
> Fixes: 673f0c3ffc75 ("tools: usb: p9_fwd: add usb gadget packet forwarder script")
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>

Acked-by: Michael Grzeschik <mgr@kernel.org>

> ---
>  tools/usb/p9_fwd.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/usb/p9_fwd.py b/tools/usb/p9_fwd.py
> index 12c76cbb046b..d5ffb2f0c5ab 100755
> --- a/tools/usb/p9_fwd.py
> +++ b/tools/usb/p9_fwd.py
> @@ -124,7 +124,7 @@ class Forwarder:
>              data += self.ep_in.read(size - len(data))
>          logging.log(logging.TRACE, "c2s: writing")
>          self._log_hexdump(data)
> -        self.s.send(data)
> +        self.s.sendall(data)
>          logging.debug("c2s: forwarded %i bytes", size)
>          self.stats["c2s packets"] += 1
>          self.stats["c2s bytes"] += size
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server
  2026-11-20  6:19 [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server Zhu Jun
  2026-11-20  9:48 ` Michael Grzeschik
@ 2026-11-23  0:59 ` Dominique Martinet
  2026-11-23 15:16   ` Michael Grzeschik
  1 sibling, 1 reply; 5+ messages in thread
From: Dominique Martinet @ 2026-11-23  0:59 UTC (permalink / raw)
  To: Zhu Jun; +Cc: mgr, nkapron, gregkh, linux-usb, v9fs, linux-kernel

Zhu Jun wrote on Fri, Nov 20, 2026 at 02:19:37PM +0800:
> socket.send() can return after sending only a prefix of a request.
> The forwarder ignores that result and waits for a response to an
> incomplete message. Use sendall() so request forwarding completes
> only once all bytes have been sent or a write error is reported.
> 
> Fixes: 673f0c3ffc75 ("tools: usb: p9_fwd: add usb gadget packet forwarder script")
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>

Thank you, picked up

-- 
Dominique Martinet | Asmadeus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server
  2026-11-23  0:59 ` Dominique Martinet
@ 2026-11-23 15:16   ` Michael Grzeschik
  2026-11-23 20:51     ` Dominique Martinet
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Grzeschik @ 2026-11-23 15:16 UTC (permalink / raw)
  To: Dominique Martinet
  Cc: Zhu Jun, nkapron, gregkh, linux-usb, v9fs, linux-kernel

On Mon, Nov 23, 2026 at 09:59:59AM +0900, Dominique Martinet wrote:
> Zhu Jun wrote on Fri, Nov 20, 2026 at 02:19:37PM +0800:
> > socket.send() can return after sending only a prefix of a request.
> > The forwarder ignores that result and waits for a response to an
> > incomplete message. Use sendall() so request forwarding completes
> > only once all bytes have been sent or a write error is reported.
> > 
> > Fixes: 673f0c3ffc75 ("tools: usb: p9_fwd: add usb gadget packet forwarder script")
> > Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> 
> Thank you, picked up

gregkh already picked it to usb-next

> -- 
> Dominique Martinet | Asmadeus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server
  2026-11-23 15:16   ` Michael Grzeschik
@ 2026-11-23 20:51     ` Dominique Martinet
  0 siblings, 0 replies; 5+ messages in thread
From: Dominique Martinet @ 2026-11-23 20:51 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: Zhu Jun, nkapron, gregkh, linux-usb, v9fs, linux-kernel

Michael Grzeschik wrote on Mon, Nov 23, 2026 at 04:16:21PM +0100:
> On Mon, Nov 23, 2026 at 09:59:59AM +0900, Dominique Martinet wrote:
> > Zhu Jun wrote on Fri, Nov 20, 2026 at 02:19:37PM +0800:
> > > socket.send() can return after sending only a prefix of a request.
> > > The forwarder ignores that result and waits for a response to an
> > > incomplete message. Use sendall() so request forwarding completes
> > > only once all bytes have been sent or a write error is reported.
> > > 
> > > Fixes: 673f0c3ffc75 ("tools: usb: p9_fwd: add usb gadget packet forwarder script")
> > > Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> > 
> > Thank you, picked up
> 
> gregkh already picked it to usb-next

Oh.
Dropped from 9p-next, thanks for the heads up.

-- 
Dominique

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-23 20:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  6:19 [PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server Zhu Jun
2026-11-20  9:48 ` Michael Grzeschik
2026-11-23  0:59 ` Dominique Martinet
2026-11-23 15:16   ` Michael Grzeschik
2026-11-23 20:51     ` Dominique Martinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox