Re: sendfile(2) use with a char driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 







Sent with Proton Mail secure email.

------- Original Message -------
On Wednesday, November 30th, 2022 at 8:05 AM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:


> On Tue, Nov 29, 2022 at 09:15:24PM +0000, hinxx wrote:
> 
> > I'm looking to use a sendfile(2) with a Xilinx XDMA kernel driver in order to move data from a PCIe board with Xilinx FPGA to the network card with "zero-copy".
> > 
> > Currently I'm getting EINVAL return status from sendfile(2) when providing opened XDMA device file descriptor as input fd.
> > 
> > The device driver provides a character device that can be mmap'ed.
> > 
> > There seem to be other restrictions. Can anyone provide insight on what would be needed to make this work?
> 
> 
> Please contact the authors of your kernel driver, they can answer this
> best.
> 

That would make sense, sadly they are MIA on their github repo engagement.

But in general, if I write a PCIe, DMA capable char device, what is the general guidance on what it takes to support splice/sendfile from a char device driver? Maybe there is an existing one in the kernel I could look at?

Is it even something worth pursuing? This line make me think it might not work for char devices https://elixir.bootlin.com/linux/v5.19.17/source/fs/splice.c#L827. Is going for block device the only way that such device driver can work with the sendfile?

Thanks! //hinko




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux