Subject: Re: USB stack needs early review (Re: Someone should fix our
To: None <tech-kern@netbsd.org>
From: Dmitri Epshtein <dima@marvell.com>
List: tech-kern
Date: 03/29/2007 17:07:23
Hi,
I am trying to understand why USB performance of mass storage device is
bad.
I mounted attached USB disk as /mnt/disk and run simple 'dd' command to
read and write data to disk
=3D> dd if=3D/dev/zero of=3D/mnt/disk/new_file2 bs=3D131072 count=3D8196 =
//
write
=3D> dd of=3D/dev/zero if=3D/mnt/disk/1G_file bs=3D131072 count=3D8196 =
// read
After profiling and adding some debug messages I understand that in
umass.c file
Function umass_bbb_state() all read/write data is copied between two
kernel buffers using memcpy routine.
Write: memcpy(sc->data_buffer, sc->transfer_data,
sc->transfer_datalen);
Read: memcpy(sc->transfer_data, sc->data_buffer,
sc->transfer_actlen);
For write operation this data already was copied from user space to
kernel
For read operation this data will be later copied to user space
My question if this is absolutely needed ? Maybe it is possible to skip
at least one copy ?
P.S.
We are working on NetBSD - release 4.0
Thanks in advance
Dima
=20
Dmitri Epshtein - Software engineer
Marvell Semiconductor Israel Ltd
6 Hamada Street=20
Mordot HaCarmel Industrial Park
Yokneam 20692, ISRAEL
Email - dima@marvell.com
Tel - + 972 4 9091455=20
Fax - + 972 4 9091501
WWW Page: http://www.marvell.com=20
This message may contain confidential, proprietary or legally privileged
information. The information is intended only for the use of the
individual or entity named above. If the reader of this message is not
the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If
you have received this communication in error, please notify us
immediately by telephone, or by e-mail and delete the message from your
computer.