Skip to content

Break down the MTP write operation

Bandan Das qemu-devel 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 0 repliesNew
  2. v33 patches 2 repliesSuperseded
  3. v22 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches1 replySuperseded

Changes in v4 from the cover letter

Used KiB for MTP_WRITE_BUF_SZ (1/3)
Add back the Suggested-by tag (3/3)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb-mtp: Reallocate buffer in multiples of MTP_WRITE_BUF_SZhw/usb/dev-mtp.c+13 -140 replies
2/3usb-mtp: breakup MTP write into smaller chunkshw/usb/dev-mtp.c+91 -430 replies
3/3usb-mtp: replace the homebrew write with qemu_write_fullhw/usb/dev-mtp.c+3 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/3] Break down the MTP write operation

v4:
Used KiB for MTP_WRITE_BUF_SZ (1/3)
Add back the Suggested-by tag (3/3)
v3:
Added patch 3/3
v2:
Rebased on top of master and retested

For larger files, not only do we keep reallocating to increase the mtp buffer size, the write also happens in one go. This does two things:

Write to file upto a certain data size we have received so far and second, reuse the buffer again instead of reallocating to a larger buffer size.

Tested with different file sizes on a Linux guest.

Bandan Das (3):
usb-mtp: Reallocate buffer in multiples of MTP_WRITE_BUF_SZ
usb-mtp: breakup MTP write into smaller chunks
usb-mtp: replace the homebrew write with qemu_write_full

 hw/usb/dev-mtp.c | 167 +++++++++++++++++++++++++++++------------------
 1 file changed, 103 insertions(+), 64 deletions(-)
Signature · 1 line
2.19.2