All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: hinxx <hinxx@protonmail.com>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: sendfile(2) use with a char driver
Date: Thu, 1 Dec 2022 13:23:03 +0100	[thread overview]
Message-ID: <Y4icp/D2U9FMSbsR@kroah.com> (raw)
In-Reply-To: <6ZmbsuZEj6y7IRkPIzEouIl5ZnBP6uAdlUpdODJRW-oxQYZvQFL8pDZmg8eKm2y3_3B28xk_ii34yUc9VbW0isBJVDgXf6klMqEs9uzj6ck=@protonmail.com>

On Thu, Dec 01, 2022 at 09:08:27AM +0000, hinxx wrote:
> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> ------- Original Message -------
> On Wednesday, November 30th, 2022 at 11:48 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> 
> 
> > On Wed, Nov 30, 2022 at 08:23:45AM +0000, hinxx wrote:
> > 
> > > Sent with Proton Mail secure email.
> > > 
> > > ------- Original Message -------
> > > On Wednesday, November 30th, 2022 at 8:05 AM, Greg KH gregkh@linuxfoundation.org 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.
> > 
> > 
> > Have a link to that repo? Again, they are the only ones that can
> > resolve this, or you can modify the code to support this.
> > 
> 
> Thank you for your time Greg!
> 
> I'm trying to understand the concepts behind the sendfile and modify the drivers myself.
> 
> Here is the Xilinx XDMA driver repo:
> 
> https://github.com/Xilinx/dma_ip_drivers/tree/master/XDMA/linux-kernel

That's a very odd driver, it creates a lot of different char device
nodes, all doing different things.  Please work with the authors on that
to figure out how to get this to go faster if you need it and have
determined that the extra copy is the speed limiter here (for most
processors that is not the case, they can copy memory very fast).

And a char device node can support sendfile if the driver supports it,
so this is up to the driver to do so.

good luck!

greg k-h

      reply	other threads:[~2022-12-01 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 21:15 sendfile(2) use with a char driver hinxx
2022-11-30  7:05 ` Greg KH
2022-11-30  8:23   ` hinxx
2022-11-30 10:48     ` Greg KH
2022-12-01  9:08       ` hinxx
2022-12-01 12:23         ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4icp/D2U9FMSbsR@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=hinxx@protonmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.