From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH v1 3/7] vhost/vsock: support MSG_EOR bit processing
Date: Tue, 27 Jul 2021 08:41:27 +0800 [thread overview]
Message-ID: <202107270800.Fcciaktr-lkp@intel.com> (raw)
In-Reply-To: <20210726163341.2589759-1-arseny.krasnov@kaspersky.com>
[-- Attachment #1: Type: text/plain, Size: 8395 bytes --]
Hi Arseny,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.14-rc3 next-20210726]
[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]
url: https://github.com/0day-ci/linux/commits/Arseny-Krasnov/virtio-vsock-introduce-MSG_EOR-flag-for-SEQPACKET/20210727-010000
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/1897d42ce769068ed6e37e6802f4e78b8786f4d7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Arseny-Krasnov/virtio-vsock-introduce-MSG_EOR-flag-for-SEQPACKET/20210727-010000
git checkout 1897d42ce769068ed6e37e6802f4e78b8786f4d7
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/vhost/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/vhost/vsock.c:193:37: sparse: sparse: restricted __le32 degrades to integer
>> drivers/vhost/vsock.c:193:37: sparse: sparse: cast to restricted __le32
vim +193 drivers/vhost/vsock.c
89
90 static void
91 vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
92 struct vhost_virtqueue *vq)
93 {
94 struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX];
95 int pkts = 0, total_len = 0;
96 bool added = false;
97 bool restart_tx = false;
98
99 mutex_lock(&vq->mutex);
100
101 if (!vhost_vq_get_backend(vq))
102 goto out;
103
104 if (!vq_meta_prefetch(vq))
105 goto out;
106
107 /* Avoid further vmexits, we're already processing the virtqueue */
108 vhost_disable_notify(&vsock->dev, vq);
109
110 do {
111 struct virtio_vsock_pkt *pkt;
112 struct iov_iter iov_iter;
113 unsigned out, in;
114 size_t nbytes;
115 size_t iov_len, payload_len;
116 int head;
117 bool restore_msg_eom_flag = false;
118 bool restore_msg_eor_flag = false;
119
120 spin_lock_bh(&vsock->send_pkt_list_lock);
121 if (list_empty(&vsock->send_pkt_list)) {
122 spin_unlock_bh(&vsock->send_pkt_list_lock);
123 vhost_enable_notify(&vsock->dev, vq);
124 break;
125 }
126
127 pkt = list_first_entry(&vsock->send_pkt_list,
128 struct virtio_vsock_pkt, list);
129 list_del_init(&pkt->list);
130 spin_unlock_bh(&vsock->send_pkt_list_lock);
131
132 head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov),
133 &out, &in, NULL, NULL);
134 if (head < 0) {
135 spin_lock_bh(&vsock->send_pkt_list_lock);
136 list_add(&pkt->list, &vsock->send_pkt_list);
137 spin_unlock_bh(&vsock->send_pkt_list_lock);
138 break;
139 }
140
141 if (head == vq->num) {
142 spin_lock_bh(&vsock->send_pkt_list_lock);
143 list_add(&pkt->list, &vsock->send_pkt_list);
144 spin_unlock_bh(&vsock->send_pkt_list_lock);
145
146 /* We cannot finish yet if more buffers snuck in while
147 * re-enabling notify.
148 */
149 if (unlikely(vhost_enable_notify(&vsock->dev, vq))) {
150 vhost_disable_notify(&vsock->dev, vq);
151 continue;
152 }
153 break;
154 }
155
156 if (out) {
157 virtio_transport_free_pkt(pkt);
158 vq_err(vq, "Expected 0 output buffers, got %u\n", out);
159 break;
160 }
161
162 iov_len = iov_length(&vq->iov[out], in);
163 if (iov_len < sizeof(pkt->hdr)) {
164 virtio_transport_free_pkt(pkt);
165 vq_err(vq, "Buffer len [%zu] too small\n", iov_len);
166 break;
167 }
168
169 iov_iter_init(&iov_iter, READ, &vq->iov[out], in, iov_len);
170 payload_len = pkt->len - pkt->off;
171
172 /* If the packet is greater than the space available in the
173 * buffer, we split it using multiple buffers.
174 */
175 if (payload_len > iov_len - sizeof(pkt->hdr)) {
176 payload_len = iov_len - sizeof(pkt->hdr);
177
178 /* As we are copying pieces of large packet's buffer to
179 * small rx buffers, headers of packets in rx queue are
180 * created dynamically and are initialized with header
181 * of current packet(except length). But in case of
182 * SOCK_SEQPACKET, we also must clear message delimeter
183 * bit(VIRTIO_VSOCK_SEQ_EOM). Otherwise, instead of one
184 * packet with delimeter(which marks end of message),
185 * there will be sequence of packets with delimeter
186 * bit set. After initialized header will be copied to
187 * rx buffer, this bit will be restored.
188 */
189 if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOM) {
190 pkt->hdr.flags &= ~cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM);
191 restore_msg_eom_flag = true;
192
> 193 if (le32_to_cpu(pkt->hdr.flags & VIRTIO_VSOCK_SEQ_EOR)) {
194 pkt->hdr.flags &= ~cpu_to_le32(VIRTIO_VSOCK_SEQ_EOR);
195 restore_msg_eor_flag = true;
196 }
197 }
198 }
199
200 /* Set the correct length in the header */
201 pkt->hdr.len = cpu_to_le32(payload_len);
202
203 nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter);
204 if (nbytes != sizeof(pkt->hdr)) {
205 virtio_transport_free_pkt(pkt);
206 vq_err(vq, "Faulted on copying pkt hdr\n");
207 break;
208 }
209
210 nbytes = copy_to_iter(pkt->buf + pkt->off, payload_len,
211 &iov_iter);
212 if (nbytes != payload_len) {
213 virtio_transport_free_pkt(pkt);
214 vq_err(vq, "Faulted on copying pkt buf\n");
215 break;
216 }
217
218 /* Deliver to monitoring devices all packets that we
219 * will transmit.
220 */
221 virtio_transport_deliver_tap_pkt(pkt);
222
223 vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len);
224 added = true;
225
226 pkt->off += payload_len;
227 total_len += payload_len;
228
229 /* If we didn't send all the payload we can requeue the packet
230 * to send it with the next available buffer.
231 */
232 if (pkt->off < pkt->len) {
233 if (restore_msg_eom_flag) {
234 pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM);
235
236 if (restore_msg_eor_flag)
237 pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOR);
238 }
239
240 /* We are queueing the same virtio_vsock_pkt to handle
241 * the remaining bytes, and we want to deliver it
242 * to monitoring devices in the next iteration.
243 */
244 pkt->tap_delivered = false;
245
246 spin_lock_bh(&vsock->send_pkt_list_lock);
247 list_add(&pkt->list, &vsock->send_pkt_list);
248 spin_unlock_bh(&vsock->send_pkt_list_lock);
249 } else {
250 if (pkt->reply) {
251 int val;
252
253 val = atomic_dec_return(&vsock->queued_replies);
254
255 /* Do we have resources to resume tx
256 * processing?
257 */
258 if (val + 1 == tx_vq->num)
259 restart_tx = true;
260 }
261
262 virtio_transport_free_pkt(pkt);
263 }
264 } while(likely(!vhost_exceeds_weight(vq, ++pkts, total_len)));
265 if (added)
266 vhost_signal(&vsock->dev, vq);
267
268 out:
269 mutex_unlock(&vq->mutex);
270
271 if (restart_tx)
272 vhost_poll_queue(&tx_vq->poll);
273 }
274
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 42053 bytes --]
next prev parent reply other threads:[~2021-07-27 0:41 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 16:31 [RFC PATCH v1 0/7] virtio/vsock: introduce MSG_EOR flag for SEQPACKET Arseny Krasnov
2021-07-26 16:33 ` [RFC PATCH v1 1/7] virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOM' bit Arseny Krasnov
2021-08-06 7:18 ` Stefano Garzarella
2021-08-06 7:18 ` Stefano Garzarella
2021-07-26 16:33 ` [RFC PATCH v1 2/7] vsock: rename implementation from 'record' to 'message' Arseny Krasnov
2021-08-06 7:20 ` Stefano Garzarella
2021-08-06 7:20 ` Stefano Garzarella
2021-07-26 16:33 ` [RFC PATCH v1 3/7] vhost/vsock: support MSG_EOR bit processing Arseny Krasnov
2021-07-27 0:41 ` kernel test robot [this message]
2021-08-06 7:28 ` Stefano Garzarella
2021-08-06 7:28 ` Stefano Garzarella
2021-08-06 8:40 ` Arseny Krasnov
2021-08-06 8:47 ` Stefano Garzarella
2021-08-06 8:47 ` Stefano Garzarella
2021-07-26 16:33 ` [RFC PATCH v1 4/7] virito/vsock: " Arseny Krasnov
2021-07-26 16:34 ` [RFC PATCH v1 5/7] af_vsock: rename variables in receive loop Arseny Krasnov
2021-07-26 16:34 ` [RFC PATCH v1 6/7] vsock_test: update message bounds test for MSG_EOR Arseny Krasnov
2021-07-26 16:34 ` [RFC PATCH v1 7/7] vsock_test: 'SO_RCVTIMEO' test for SEQPACKET Arseny Krasnov
2021-07-27 7:59 ` [RFC PATCH v1 0/7] virtio/vsock: introduce MSG_EOR flag " Stefano Garzarella
2021-07-27 7:59 ` Stefano Garzarella
2021-07-27 9:34 ` [MASSMAIL KLMS] " Arseny Krasnov
2021-07-27 9:58 ` Stefano Garzarella
2021-07-27 9:58 ` Stefano Garzarella
2021-07-27 12:35 ` [MASSMAIL KLMS] " Arseny Krasnov
2021-08-04 12:57 ` Stefano Garzarella
2021-08-04 12:57 ` Stefano Garzarella
2021-08-05 8:33 ` Arseny Krasnov
2021-08-05 9:06 ` Stefano Garzarella
2021-08-05 9:06 ` Stefano Garzarella
2021-08-05 9:21 ` [!!Mass Mail KSE][MASSMAIL KLMS] " Arseny Krasnov
2021-08-06 7:16 ` Stefano Garzarella
2021-08-06 7:16 ` Stefano Garzarella
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=202107270800.Fcciaktr-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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.