* [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
0 siblings, 1 reply; 2+ 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] 2+ 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
0 siblings, 0 replies; 2+ 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] 2+ messages in thread
end of thread, other threads:[~2026-11-20 9:48 UTC | newest]
Thread overview: 2+ 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox