From: Christoph Hellwig <[email protected]>
To: Kanchan Joshi <[email protected]>
Cc: Jens Axboe <[email protected]>, Kanchan Joshi <[email protected]>,
Christoph Hellwig <[email protected]>, Keith Busch <[email protected]>,
Chaitanya Kulkarni <[email protected]>,
[email protected], [email protected],
[email protected], Javier Gonzalez <[email protected]>,
Nitesh Shetty <[email protected]>,
Selvakumar S <[email protected]>
Subject: Re: [RFC PATCH v3 1/3] io_uring: add helper for uring_cmd completion in submitter-task
Date: Thu, 18 Mar 2021 06:48:07 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+1E3r+Mt7KKeFeYf7WY3CoKwnkXT-jE2EgJSTE6zaAfJX0dzQ@mail.gmail.com>
On Thu, Mar 18, 2021 at 10:55:55AM +0530, Kanchan Joshi wrote:
> I started with that, but the problem was implementing the driver callback .
> The callbacks receive only one argument which is "struct callback_head
> *", and the driver needs to extract "io_uring_cmd *" out of it.
> This part -
> +static void uring_cmd_work(struct callback_head *cb)
> +{
> + struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
> + struct io_uring_cmd *cmd = &req->uring_cmd;
>
> If the callback has to move to the driver (nvme), the driver needs
> visibility to "struct io_kiocb" which is uring-local.
> Do you see a better way to handle this?
Can't you just add a helper in io_uring.c that does something like this:
struct io_uring_cmd *callback_to_io_uring_cmd(struct callback_head *cb)
{
return &container_of(cb, struct io_kiocb, task_work)->uring_cmd;
}
EXPORT_SYMBOL_GPL(callback_to_io_uring_cmd);
next prev parent reply other threads:[~2021-03-18 5:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210316140229epcas5p23d68a4c9694bbf7759b5901115a4309b@epcas5p2.samsung.com>
2021-03-16 14:01 ` [RFC PATCH v3 0/3] Async nvme passthrough over io_uring Kanchan Joshi
[not found] ` <CGME20210316140233epcas5p372405e7cb302c61dba5e1094fa796513@epcas5p3.samsung.com>
2021-03-16 14:01 ` [RFC PATCH v3 1/3] io_uring: add helper for uring_cmd completion in submitter-task Kanchan Joshi
2021-03-16 15:43 ` Stefan Metzmacher
2021-03-18 1:57 ` Jens Axboe
2021-03-18 5:25 ` Kanchan Joshi
2021-03-18 5:48 ` Christoph Hellwig [this message]
2021-03-18 6:14 ` Kanchan Joshi
[not found] ` <CGME20210316140236epcas5p4de087ee51a862402146fbbc621d4d4c6@epcas5p4.samsung.com>
2021-03-16 14:01 ` [RFC PATCH v3 2/3] nvme: keep nvme_command instead of pointer to it Kanchan Joshi
2021-03-16 17:16 ` Keith Busch
2021-03-17 9:38 ` Kanchan Joshi
2021-03-17 14:17 ` Keith Busch
[not found] ` <CGME20210316140240epcas5p3e71bfe2afecd728c5af60056f21cc9b7@epcas5p3.samsung.com>
2021-03-16 14:01 ` [RFC PATCH v3 3/3] nvme: wire up support for async passthrough Kanchan Joshi
2021-03-17 8:52 ` Christoph Hellwig
2021-03-17 16:49 ` Jens Axboe
2021-03-17 16:59 ` Christoph Hellwig
2021-03-17 17:21 ` Jens Axboe
2021-03-17 18:59 ` Jens Axboe
2021-03-18 5:54 ` Kanchan Joshi
2021-03-17 16:45 ` Keith Busch
2021-03-17 17:02 ` Christoph Hellwig
2021-03-16 15:51 ` [RFC PATCH v3 0/3] Async nvme passthrough over io_uring Jens Axboe
2021-03-17 9:31 ` Kanchan Joshi
2021-03-18 1:58 ` Jens Axboe
2021-03-18 7:47 ` Kanchan Joshi
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox