From: kernel test robot <lkp@intel.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH 07/12] io_uring: add IORING_OP_FUSED_CMD
Date: Fri, 3 Mar 2023 03:16:31 +0800 [thread overview]
Message-ID: <202303030332.RoPWPvGY-lkp@intel.com> (raw)
In-Reply-To: <20230301140611.163055-8-ming.lei@redhat.com>
Hi Ming,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on char-misc/char-misc-next char-misc/char-misc-linus linus/master]
[cannot apply to axboe-block/for-next v6.2 next-20230302]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ming-Lei/io_uring-increase-io_kiocb-flags-into-64bit/20230301-221054
patch link: https://lore.kernel.org/r/20230301140611.163055-8-ming.lei%40redhat.com
patch subject: [RFC PATCH 07/12] io_uring: add IORING_OP_FUSED_CMD
config: x86_64-randconfig-a013 (https://download.01.org/0day-ci/archive/20230303/202303030332.RoPWPvGY-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/879ff1424f99ef055e902e95625052b87f17fc08
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Ming-Lei/io_uring-increase-io_kiocb-flags-into-64bit/20230301-221054
git checkout 879ff1424f99ef055e902e95625052b87f17fc08
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303030332.RoPWPvGY-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> io_uring/fused_cmd.c:45:5: warning: no previous prototype for 'io_fused_cmd_prep' [-Wmissing-prototypes]
45 | int io_fused_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
| ^~~~~~~~~~~~~~~~~
>> io_uring/fused_cmd.c:112:5: warning: no previous prototype for 'io_fused_cmd' [-Wmissing-prototypes]
112 | int io_fused_cmd(struct io_kiocb *req, unsigned int issue_flags)
| ^~~~~~~~~~~~
>> io_uring/fused_cmd.c:134:5: warning: no previous prototype for 'io_import_kbuf_for_slave' [-Wmissing-prototypes]
134 | int io_import_kbuf_for_slave(u64 buf, unsigned int len, int rw,
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> io_uring/fused_cmd.c:177:6: warning: no previous prototype for 'io_fused_cmd_return_kbuf' [-Wmissing-prototypes]
177 | void io_fused_cmd_return_kbuf(struct io_kiocb *slave)
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/io_fused_cmd_prep +45 io_uring/fused_cmd.c
44
> 45 int io_fused_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
46 __must_hold(&req->ctx->uring_lock)
47 {
48 struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
49 const struct io_uring_sqe *slave_sqe = sqe + 1;
50 struct io_ring_ctx *ctx = req->ctx;
51 struct io_kiocb *slave;
52 u8 slave_op;
53 int ret;
54
55 if (unlikely(!(ctx->flags & IORING_SETUP_SQE128)))
56 return -EINVAL;
57
58 if (unlikely(sqe->__pad1))
59 return -EINVAL;
60
61 ioucmd->flags = READ_ONCE(sqe->uring_cmd_flags);
62 if (unlikely(ioucmd->flags))
63 return -EINVAL;
64
65 slave_op = READ_ONCE(slave_sqe->opcode);
66 if (unlikely(!io_fused_slave_valid(slave_sqe, slave_op)))
67 return -EINVAL;
68
69 ioucmd->cmd = sqe->cmd;
70 ioucmd->cmd_op = READ_ONCE(sqe->cmd_op);
71 req->fused_cmd_kbuf = NULL;
72
73 /* take one extra reference for the slave request */
74 io_get_task_refs(1);
75
76 ret = -ENOMEM;
77 if (unlikely(!io_alloc_req(ctx, &slave)))
78 goto fail;
79
80 ret = io_init_req(ctx, slave, slave_sqe, true);
81 if (unlikely(ret))
82 goto fail_free_req;
83
84 io_fused_cmd_update_link_flags(req, slave);
85
86 ioucmd->fused.data.__slave = slave;
87 req->flags |= REQ_F_FUSED_MASTER;
88
89 return 0;
90
91 fail_free_req:
92 io_free_req(slave);
93 fail:
94 current->io_uring->cached_refs += 1;
95 return ret;
96 }
97
98 static inline bool io_fused_slave_write_to_buf(u8 op)
99 {
100 switch (op) {
101 case IORING_OP_READ:
102 case IORING_OP_READV:
103 case IORING_OP_READ_FIXED:
104 case IORING_OP_RECVMSG:
105 case IORING_OP_RECV:
106 return 1;
107 default:
108 return 0;
109 }
110 }
111
> 112 int io_fused_cmd(struct io_kiocb *req, unsigned int issue_flags)
113 {
114 struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
115 const struct io_kiocb *slave = ioucmd->fused.data.__slave;
116 int ret = -EINVAL;
117
118 /*
119 * Pass buffer direction for driver to validate if the read/write
120 * is legal
121 */
122 if (io_fused_slave_write_to_buf(slave->opcode))
123 issue_flags |= IO_URING_F_FUSED_WRITE;
124 else
125 issue_flags |= IO_URING_F_FUSED_READ;
126
127 ret = io_uring_cmd(req, issue_flags);
128 if (ret != IOU_ISSUE_SKIP_COMPLETE)
129 io_free_req(ioucmd->fused.data.__slave);
130
131 return ret;
132 }
133
> 134 int io_import_kbuf_for_slave(u64 buf, unsigned int len, int rw,
135 struct iov_iter *iter, struct io_kiocb *slave)
136 {
137 struct io_kiocb *req = slave->fused_master_req;
138 const struct io_mapped_buf *kbuf;
139 unsigned int offset;
140
141 if (unlikely(!(slave->flags & REQ_F_FUSED_SLAVE) || !req))
142 return -EINVAL;
143
144 if (unlikely(!req->fused_cmd_kbuf))
145 return -EINVAL;
146
147 /* req->fused_cmd_kbuf is immutable */
148 kbuf = req->fused_cmd_kbuf;
149 offset = kbuf->offset;
150
151 if (!kbuf->bvec)
152 return -EINVAL;
153
154 /* not inside the mapped region */
155 if (unlikely(buf < kbuf->buf || buf > kbuf->buf_end))
156 return -EFAULT;
157
158 if (unlikely(len > kbuf->buf_end - buf))
159 return -EFAULT;
160
161 /* don't use io_import_fixed which doesn't support multipage bvec */
162 offset += buf - kbuf->buf;
163 iov_iter_bvec(iter, rw, kbuf->bvec, kbuf->nr_bvecs, offset + len);
164
165 if (offset)
166 iov_iter_advance(iter, offset);
167
168 return 0;
169 }
170
171 /*
172 * Called when slave request is completed,
173 *
174 * Return back ownership of the fused_cmd kbuf to master request, and
175 * notify master request.
176 */
> 177 void io_fused_cmd_return_kbuf(struct io_kiocb *slave)
178 {
179 struct io_kiocb *req = slave->fused_master_req;
180 struct io_uring_cmd *ioucmd;
181
182 if (unlikely(!req || !(slave->flags & REQ_F_FUSED_SLAVE)))
183 return;
184
185 /* return back the buffer */
186 slave->fused_master_req = NULL;
187 ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
188 ioucmd->fused.data.__slave = NULL;
189
190 /* If slave OP skips CQE, return the result via master command */
191 if (slave->flags & REQ_F_CQE_SKIP)
192 ioucmd->fused.data.slave_res = slave->cqe.res;
193 else
194 ioucmd->fused.data.slave_res = 0;
195 io_uring_cmd_complete_in_task(ioucmd, ioucmd->task_work_cb);
196 }
197
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-03-02 19:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 14:05 [RFC PATCH 00/12] io_uring: add IORING_OP_FUSED_CMD Ming Lei
2023-03-01 14:06 ` [RFC PATCH 01/12] io_uring: increase io_kiocb->flags into 64bit Ming Lei
2023-03-01 14:06 ` [RFC PATCH 02/12] io_uring: define io_mapped_ubuf->acct_pages as unsigned integer Ming Lei
2023-03-01 14:06 ` [RFC PATCH 03/12] io_uring: extend io_mapped_ubuf to cover external bvec table Ming Lei
2023-03-01 14:06 ` [RFC PATCH 04/12] io_uring: rename io_mapped_ubuf as io_mapped_buf Ming Lei
2023-03-01 14:06 ` [RFC PATCH 05/12] io_uring: export 'struct io_mapped_buf' for fused cmd buffer Ming Lei
2023-03-01 14:06 ` [RFC PATCH 06/12] io_uring: add IO_URING_F_FUSED and prepare for supporting OP_FUSED_CMD Ming Lei
2023-03-01 14:06 ` [RFC PATCH 07/12] io_uring: add IORING_OP_FUSED_CMD Ming Lei
2023-03-02 19:16 ` kernel test robot [this message]
2023-03-02 20:49 ` kernel test robot
2023-03-01 14:06 ` [RFC PATCH 08/12] io_uring: support OP_READ/OP_WRITE for fused slave request Ming Lei
2023-03-01 14:06 ` [RFC PATCH 09/12] io_uring: support OP_SEND_ZC/OP_RECV " Ming Lei
2023-03-01 14:06 ` [RFC PATCH 10/12] block: ublk_drv: mark device as LIVE before adding disk Ming Lei
2023-03-03 2:25 ` Ziyang Zhang
2023-03-01 14:06 ` [RFC PATCH 11/12] block: ublk_drv: add common exit handling Ming Lei
2023-03-03 2:15 ` Ziyang Zhang
2023-03-01 14:06 ` [RFC PATCH 12/12] block: ublk_drv: apply io_uring FUSED_CMD for supporting zero copy Ming Lei
2023-03-03 2:52 ` [RFC PATCH 00/12] io_uring: add IORING_OP_FUSED_CMD Ziyang Zhang
2023-03-03 3:01 ` Ming Lei
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=202303030332.RoPWPvGY-lkp@intel.com \
--to=lkp@intel.com \
--cc=ming.lei@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.