Re: [PATCH v3] tools: usb: aio example applications

2014-02-06 Thread Michal Nazarewicz
On Thu, Feb 06 2014, David Laight wrote: > From: Michal Nazarewicz >> On Tue, Feb 04 2014, Robert Baldyga wrote: >> > This code is an example. Don't you think it would be better to keep it >> > simple? >> >> PS. Of course another approach is to use two threads one for ep0 and the >> other for trans

RE: [PATCH v3] tools: usb: aio example applications

2014-02-06 Thread David Laight
From: Michal Nazarewicz > On Tue, Feb 04 2014, Robert Baldyga wrote: > > This code is an example. Don't you think it would be better to keep it > > simple? > > PS. Of course another approach is to use two threads one for ep0 and the > other for transfers. Yet another, is to add AIO to ep0 in the

Re: [PATCH v3] tools: usb: aio example applications

2014-02-06 Thread Michal Nazarewicz
On Tue, Feb 04 2014, Robert Baldyga wrote: > This code is an example. Don't you think it would be better to keep it > simple? PS. Of course another approach is to use two threads one for ep0 and the other for transfers. Yet another, is to add AIO to ep0 in the kernel. -- Best regards,

Re: [PATCH v3] tools: usb: aio example applications

2014-02-04 Thread Michal Nazarewicz
> On 01/30/2014 03:09 PM, Michal Nazarewicz wrote: >> This is not a good way to do this. You are looping around with >> 1 µseconds delays in each loop. This is active polling and is not a way >> to implement anything. To properly use AIO with a single thread while >> you also handling ep0, you n

Re: [PATCH v3] tools: usb: aio example applications

2014-02-03 Thread Robert Baldyga
On 01/30/2014 03:09 PM, Michal Nazarewicz wrote: > On Thu, Jan 30 2014, Robert Baldyga wrote: >> diff --git a/tools/usb/aio_multibuff/device_app/aio_multibuff.c >> b/tools/usb/aio_multibuff/device_app/aio_multibuff.c > >> +static void display_event(struct usb_functionfs_event *event) >> +{ >> +

Re: [PATCH v3] tools: usb: aio example applications

2014-01-31 Thread Robert Baldyga
On 01/30/2014 11:40 AM, David Laight wrote: > From: Robert Baldyga > This patch adds two example applications showing usage of Asynchronous I/O API >> of FunctionFS. First one (aio_simple) is simple example of bidirectional data >> transfer. Second one (aio_multibuff) shows multi-buffer data transf

Re: [PATCH v3] tools: usb: aio example applications

2014-01-31 Thread Robert Baldyga
On 01/30/2014 04:30 PM, Peter Stuge wrote: > Robert Baldyga wrote: >> v3: > .. >> +++ b/tools/usb/aio_multibuff/host_app/Makefile >> @@ -0,0 +1,13 @@ >> +CC = gcc >> +LIBUSB_CFLAGS = $(shell pkg-config --cflags libusb-1.0) >> +LIBUSB_LIBS = $(shell pkg-config --libs libusb-1.0) >> +WARNINGS = -Wall

Re: [PATCH v3] tools: usb: aio example applications

2014-01-30 Thread Peter Stuge
Robert Baldyga wrote: > v3: .. > +++ b/tools/usb/aio_multibuff/host_app/Makefile > @@ -0,0 +1,13 @@ > +CC = gcc > +LIBUSB_CFLAGS = $(shell pkg-config --cflags libusb-1.0) > +LIBUSB_LIBS = $(shell pkg-config --libs libusb-1.0) > +WARNINGS = -Wall -Wextra > +CFLAGS = $(LIBUSB_CFLAGS) $(WARNINGS) > +L

Re: [PATCH v3] tools: usb: aio example applications

2014-01-30 Thread Michal Nazarewicz
On Thu, Jan 30 2014, Robert Baldyga wrote: > diff --git a/tools/usb/aio_multibuff/device_app/aio_multibuff.c > b/tools/usb/aio_multibuff/device_app/aio_multibuff.c > +static void display_event(struct usb_functionfs_event *event) > +{ > + static const char *const names[] = { > + [F

RE: [PATCH v3] tools: usb: aio example applications

2014-01-30 Thread David Laight
From: Robert Baldyga This patch adds two example applications showing usage of Asynchronous I/O API > of FunctionFS. First one (aio_simple) is simple example of bidirectional data > transfer. Second one (aio_multibuff) shows multi-buffer data transfer, which > may to be used in high performance app

[PATCH v3] tools: usb: aio example applications

2014-01-30 Thread Robert Baldyga
This patch adds two example applications showing usage of Asynchronous I/O API of FunctionFS. First one (aio_simple) is simple example of bidirectional data transfer. Second one (aio_multibuff) shows multi-buffer data transfer, which may to be used in high performance applications. Both examples c