USB CDC performance test

Jeffrey Walton noloader at
Fri Mar 4 11:13:49 EST 2022

On Fri, Mar 4, 2022 at 9:37 AM Mithran B <mithranb22 at> wrote:
> On Fri, 4 Mar 2022 at 19:48, Greg KH <greg at> wrote:
>> On Fri, Mar 04, 2022 at 04:27:50PM +0530, Mithran B wrote:
>> > Hello,
>> >
>> > In Host and Gadget systems, enabled the USB CDC drivers.
>> > Then nodes are created as /dev/ttyAcm0 and /dev/ttyGs0.
>> > Then opened the nodes and write and read back the data.
>> > It is working.
>> >
>> > I want to test the performance of this interface and drivers.
>> > Do we have any utility for this?
>> > How to do the performance test?
>> What exactly do you want to measure?  Determine that first before trying
>> to find a test for that.  Without knowing what you want to measure, it's
>> hard to tell you how to measure it :)
> I want to send the data at the rate of 5mbps from Host device to target device using USB CDC - ACM.
> In termios functions, how to configure this 5mbps as baud rate and USB payload size, i.e. packet
> size to be in 2K bytes.
> How to achieve this?

It seems like dd with a sync could be a good choice. You need the sync
to ensure the writes are flushed.

Maybe something like:

    $ su -
    # dd if=/dev/zero of=<dev> bs=512 count=1M && sync

Also see the dd(1) man page.


More information about the Kernelnewbies mailing list