* ublk: expose ublk device info in sysfs or support ioctls on ublk-control
@ 2025-02-07 19:50 Matthew Broomfield
2025-02-07 20:13 ` Keith Busch
2025-02-08 6:03 ` Ming Lei
0 siblings, 2 replies; 3+ messages in thread
From: Matthew Broomfield @ 2025-02-07 19:50 UTC (permalink / raw)
To: linux-block; +Cc: ming.lei
Hi all,
It would be great if there was a sysfs file which exposed "struct
ublksrv_ctrl_dev_info" so programs written in languages without
io_uring libraries (such as python) could easily read this information
for management, testing, or record keeping. Ideally if possible this
could be something like "/sys/block/ublkbX/ublk_info". Is this
possible?
Alternatively, the "/dev/ublk-control" file could support ioctls which
mimic the io_uring cmds such as UBLK_CMD_GET_DEV_INFO,
UBLK_CMD_ADD_DEV, etc. This would be more powerful as the block device
lifecycle management program could be completely independent of both
io_uring and the program which handles the block IO. However I'm
skeptical it's worth it in the long run to create a ioctl -> io_uring
adapter. (As opposed to languages natively supporting io_uring)
Thank you,
-Matthew Broomfield
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ublk: expose ublk device info in sysfs or support ioctls on ublk-control
2025-02-07 19:50 ublk: expose ublk device info in sysfs or support ioctls on ublk-control Matthew Broomfield
@ 2025-02-07 20:13 ` Keith Busch
2025-02-08 6:03 ` Ming Lei
1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2025-02-07 20:13 UTC (permalink / raw)
To: Matthew Broomfield; +Cc: linux-block, ming.lei
On Fri, Feb 07, 2025 at 11:50:33AM -0800, Matthew Broomfield wrote:
> Hi all,
>
> It would be great if there was a sysfs file which exposed "struct
> ublksrv_ctrl_dev_info" so programs written in languages without
> io_uring libraries (such as python) could easily read this information
> for management, testing, or record keeping. Ideally if possible this
> could be something like "/sys/block/ublkbX/ublk_info". Is this
> possible?
>
> Alternatively, the "/dev/ublk-control" file could support ioctls which
> mimic the io_uring cmds such as UBLK_CMD_GET_DEV_INFO,
> UBLK_CMD_ADD_DEV, etc. This would be more powerful as the block device
> lifecycle management program could be completely independent of both
> io_uring and the program which handles the block IO. However I'm
> skeptical it's worth it in the long run to create a ioctl -> io_uring
> adapter. (As opposed to languages natively supporting io_uring)
It's really not that difficult to make an equivalent ioctl from an
existing uring_cmd.
I think it would be even easier if the ioctl was exposed on the
/dev/ublkcX device instead of the general purpose ublk-control. This way
you can just use the path of the device you want to query instead of
having to look up its dev_id.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ublk: expose ublk device info in sysfs or support ioctls on ublk-control
2025-02-07 19:50 ublk: expose ublk device info in sysfs or support ioctls on ublk-control Matthew Broomfield
2025-02-07 20:13 ` Keith Busch
@ 2025-02-08 6:03 ` Ming Lei
1 sibling, 0 replies; 3+ messages in thread
From: Ming Lei @ 2025-02-08 6:03 UTC (permalink / raw)
To: Matthew Broomfield; +Cc: linux-block
On Fri, Feb 07, 2025 at 11:50:33AM -0800, Matthew Broomfield wrote:
> Hi all,
>
> It would be great if there was a sysfs file which exposed "struct
> ublksrv_ctrl_dev_info" so programs written in languages without
> io_uring libraries (such as python) could easily read this information
> for management, testing, or record keeping. Ideally if possible this
> could be something like "/sys/block/ublkbX/ublk_info". Is this
> possible?
It is doable, but depends if it is necessary.
The device info can be stored in FS by ublk server, and the file
lifetime can be aligned with the ublk device, then python tool
can read it from FS directly.
>
> Alternatively, the "/dev/ublk-control" file could support ioctls which
> mimic the io_uring cmds such as UBLK_CMD_GET_DEV_INFO,
> UBLK_CMD_ADD_DEV, etc. This would be more powerful as the block device
> lifecycle management program could be completely independent of both
> io_uring and the program which handles the block IO. However I'm
> skeptical it's worth it in the long run to create a ioctl -> io_uring
> adapter. (As opposed to languages natively supporting io_uring)
I'd suggest to not add ioctl, uring_cmd is async, which can help to
setup ublk device in completely async way, and I remember that someone
has asked if lots of ublk device can be created in single pthread
context.
Thanks,
Ming
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-08 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 19:50 ublk: expose ublk device info in sysfs or support ioctls on ublk-control Matthew Broomfield
2025-02-07 20:13 ` Keith Busch
2025-02-08 6:03 ` Ming Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).