public inbox for [email protected]
 help / color / mirror / Atom feed
* io uring support for character device
@ 2022-05-25  0:56 Changman Lee
  2022-05-25  3:00 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Changman Lee @ 2022-05-25  0:56 UTC (permalink / raw)
  To: io-uring

Hi List,

I'm CM Lee. I'm developing a custom character device managing pcie dma.
I've tried to use io uring for the char device which supports readv
and writev with synchronous and blocking manner and seek.
When I use a io uring with IORING_SETUP_IOPOLL and IORING_SETUP_SQPOLL
for reducing syscall overhead, a readv of the char device driver seems
to be not called. So I added a_ops->direct_IO when the device is
opened with O_DIRECT. But the result was the same.
This is my question.
Q1: Does io uring support a character device ?
Q2: Is it better to reimplement a device driver as block device type ?

Thanks,
CM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: io uring support for character device
  2022-05-25  0:56 io uring support for character device Changman Lee
@ 2022-05-25  3:00 ` Jens Axboe
  2022-05-26  1:49   ` Changman Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2022-05-25  3:00 UTC (permalink / raw)
  To: Changman Lee, io-uring

On 5/24/22 6:56 PM, Changman Lee wrote:
> Hi List,
> 
> I'm CM Lee. I'm developing a custom character device managing pcie dma.
> I've tried to use io uring for the char device which supports readv
> and writev with synchronous and blocking manner and seek.
> When I use a io uring with IORING_SETUP_IOPOLL and IORING_SETUP_SQPOLL
> for reducing syscall overhead, a readv of the char device driver seems
> to be not called. So I added a_ops->direct_IO when the device is
> opened with O_DIRECT. But the result was the same.
> This is my question.
> Q1: Does io uring support a character device ?
> Q2: Is it better to reimplement a device driver as block device type ?

io_uring doesn't care what file type it is, I suspect your problem lies
elsewhere. Do you have a ->read() defined as well? If you do, the vfs
will pick that over ->read_iter().

If regular read/write works with O_DIRECT and reading from the device in
general, then io_uring will too.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: io uring support for character device
  2022-05-25  3:00 ` Jens Axboe
@ 2022-05-26  1:49   ` Changman Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Changman Lee @ 2022-05-26  1:49 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring

I have both ->read() and ->read_iter(). I'll negate a ->read() and
a_ops->direct_IO() because those were for testing.
I'll go over my io_uring test code in user space.
Thanks for your advice.

2022년 5월 25일 (수) 오후 12:00, Jens Axboe <[email protected]>님이 작성:
>
> On 5/24/22 6:56 PM, Changman Lee wrote:
> > Hi List,
> >
> > I'm CM Lee. I'm developing a custom character device managing pcie dma.
> > I've tried to use io uring for the char device which supports readv
> > and writev with synchronous and blocking manner and seek.
> > When I use a io uring with IORING_SETUP_IOPOLL and IORING_SETUP_SQPOLL
> > for reducing syscall overhead, a readv of the char device driver seems
> > to be not called. So I added a_ops->direct_IO when the device is
> > opened with O_DIRECT. But the result was the same.
> > This is my question.
> > Q1: Does io uring support a character device ?
> > Q2: Is it better to reimplement a device driver as block device type ?
>
> io_uring doesn't care what file type it is, I suspect your problem lies
> elsewhere. Do you have a ->read() defined as well? If you do, the vfs
> will pick that over ->read_iter().
>
> If regular read/write works with O_DIRECT and reading from the device in
> general, then io_uring will too.
>
> --
> Jens Axboe
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-26  1:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-25  0:56 io uring support for character device Changman Lee
2022-05-25  3:00 ` Jens Axboe
2022-05-26  1:49   ` Changman Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox