Re: How to use V4L2 dmafd with sendfile?

2017-06-07 Thread Frank Smith


> Step 0: Define "really fast". (I work with boxes that have LACP bonds of
> 2x40gbit ethernet interfaces - your v4l2 device is probably the slow link at
> that point, and sendfile won't matter).


 

Yes, I previously checked the performance boost. It is a 100MBit/s Ethernet connection on an armv7.

- send ~70MBit/s, 50% CPU usage, the bottleneck is in tcp_sendmsg -> __copy_from_user

- sendfile ~90MBit/s, but almost 0% CPU Usage -> uses the dma engine

 

That's why I want to use sendfile. I need a mechanism to put the memory buffer into a filedescriptor, sendfile can handle.

v4l2's ioctl VIDIOC_EXPBUF exports a dmafd, which is not suitable. sendfile returns with error -29, which is ESPIPE. Looking into sendfile's kernel source the if conndition !(in.file->f_mode & FMODE_PREAD) causes these error, because FMODE_PREAD is not set in the dmafd. How to make the dmafd suitable?

 

http://elixir.free-electrons.com/linux/v4.0/source/fs/read_write.c#L1276

 

 


 



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to use V4L2 dmafd with sendfile?

2017-06-06 Thread valdis . kletnieks
On Tue, 06 Jun 2017 15:02:45 +0200, "Frank Smith" said:

> I want to use sendfile to send my images really fast over the network.

Step 0:  Define "really fast".  (I work with boxes that have LACP bonds of
2x40gbit ethernet interfaces - your v4l2 device is probably the slow link at
that point, and sendfile won't matter).

Step 1: Look at the performance of your v4l2 device and your network
device, and determine whether sendfile is likely to resolve any actual
bottleneck you're seeing.

(Yes, as usual - before expending a lot of effort trying to make something
work, spend a little time making sure you're solving the right problem)


pgpDaPqq8QYPW.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies