<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>
<div>> Step 0: Define "really fast". (I work with boxes that have LACP bonds of<br/>
> 2x40gbit ethernet interfaces - your v4l2 device is probably the slow link at<br/>
> that point, and sendfile won't matter).</div>
</div>
<div> </div>
<div>Yes, I previously checked the performance boost. It is a 100MBit/s Ethernet connection on an armv7.</div>
<div>- send ~70MBit/s, 50% CPU usage, the bottleneck is in tcp_sendmsg -> __copy_from_user</div>
<div>- sendfile ~90MBit/s, but almost 0% CPU Usage -> uses the dma engine</div>
<div> </div>
<div>That's why I want to use sendfile. I need a mechanism to put the memory buffer into a filedescriptor, sendfile can handle.</div>
<div>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<strong> !(in.file->f_mode & FMODE_PREAD)</strong> causes these error, because FMODE_PREAD is not set in the dmafd. How to make the dmafd suitable?</div>
<div> </div>
<div>http://elixir.free-electrons.com/linux/v4.0/source/fs/read_write.c#L1276</div>
<div> </div>
<div> </div>
<div>
<div> </div>
</div>
</div></div></body></html>