From: kernel test robot <lkp@intel.com>
To: Jason Wang <jasowang@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH V2 19/19] virtio_ring: add in order support
Date: Wed, 28 May 2025 23:04:41 +0800 [thread overview]
Message-ID: <202505282256.MVII3mpu-lkp@intel.com> (raw)
In-Reply-To: <20250528064234.12228-20-jasowang@redhat.com>
Hi Jason,
kernel test robot noticed the following build warnings:
[auto build test WARNING on mst-vhost/linux-next]
[also build test WARNING on linus/master v6.15 next-20250528]
[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/Jason-Wang/virtio_ring-rename-virtqueue_reinit_xxx-to-virtqueue_reset_xxx/20250528-144806
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
patch link: https://lore.kernel.org/r/20250528064234.12228-20-jasowang%40redhat.com
patch subject: [PATCH V2 19/19] virtio_ring: add in order support
config: arm-randconfig-002-20250528 (https://download.01.org/0day-ci/archive/20250528/202505282256.MVII3mpu-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250528/202505282256.MVII3mpu-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505282256.MVII3mpu-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/virtio/virtio_ring.c:2109:40: warning: variable 'id' is uninitialized when used here [-Wuninitialized]
2109 | BAD_RING(vq, "id %u out of range\n", id);
| ^~
drivers/virtio/virtio_ring.c:60:32: note: expanded from macro 'BAD_RING'
60 | "%s:"fmt, (_vq)->vq.name, ##args); \
| ^~~~
include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err'
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/virtio/virtio_ring.c:2075:19: note: initialize the variable 'id' to silence this warning
2075 | u16 last_used, id, last_used_idx;
| ^
| = 0
1 warning generated.
vim +/id +2109 drivers/virtio/virtio_ring.c
2069
2070 static void *virtqueue_get_buf_ctx_packed_in_order(struct vring_virtqueue *vq,
2071 unsigned int *len,
2072 void **ctx)
2073 {
2074 unsigned int num = vq->packed.vring.num;
2075 u16 last_used, id, last_used_idx;
2076 bool used_wrap_counter;
2077 void *ret;
2078
2079 START_USE(vq);
2080
2081 if (unlikely(vq->broken)) {
2082 END_USE(vq);
2083 return NULL;
2084 }
2085
2086 last_used_idx = vq->last_used_idx;
2087 used_wrap_counter = packed_used_wrap_counter(last_used_idx);
2088 last_used = packed_last_used(last_used_idx);
2089
2090 if (vq->batch_head == num) {
2091 if (!__more_used_packed(vq)) {
2092 pr_debug("No more buffers in queue\n");
2093 END_USE(vq);
2094 return NULL;
2095 }
2096 /* Only get used elements after they have been exposed by host. */
2097 virtio_rmb(vq->weak_barriers);
2098 vq->batch_head = le16_to_cpu(vq->packed.vring.desc[last_used].id);
2099 vq->batch_len = le32_to_cpu(vq->packed.vring.desc[last_used].len);
2100 }
2101
2102 if (vq->batch_head == last_used) {
2103 vq->batch_head = num;
2104 *len = vq->batch_len;
2105 } else
2106 *len = vq->packed.desc_state[last_used].total_len;
2107
2108 if (unlikely(last_used >= num)) {
> 2109 BAD_RING(vq, "id %u out of range\n", id);
2110 return NULL;
2111 }
2112 if (unlikely(!vq->packed.desc_state[last_used].data)) {
2113 BAD_RING(vq, "id %u is not a head!\n", id);
2114 return NULL;
2115 }
2116
2117 /* detach_buf_packed clears data, so grab it now. */
2118 ret = vq->packed.desc_state[last_used].data;
2119 detach_buf_packed_in_order(vq, last_used, ctx);
2120
2121 update_last_used_idx_packed(vq, last_used, last_used,
2122 used_wrap_counter);
2123
2124 LAST_ADD_TIME_INVALID(vq);
2125
2126 END_USE(vq);
2127 return ret;
2128 }
2129
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-05-28 15:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 6:42 [PATCH V2 00/19] virtio_ring in order support Jason Wang
2025-05-28 6:42 ` [PATCH V2 01/19] virtio_ring: rename virtqueue_reinit_xxx to virtqueue_reset_xxx() Jason Wang
2025-05-28 6:42 ` [PATCH V2 02/19] virtio_ring: switch to use vring_virtqueue in virtqueue_poll variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 03/19] virtio_ring: unify logic of virtqueue_poll() and more_used() Jason Wang
2025-05-28 6:42 ` [PATCH V2 04/19] virtio_ring: switch to use vring_virtqueue for virtqueue resize variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 05/19] virtio_ring: switch to use vring_virtqueue for virtqueue_kick_prepare variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 06/19] virtio_ring: switch to use vring_virtqueue for virtqueue_add variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 07/19] virtio: " Jason Wang
2025-05-28 6:42 ` [PATCH V2 08/19] virtio_ring: switch to use vring_virtqueue for enable_cb_prepare variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 09/19] virtio_ring: use vring_virtqueue for enable_cb_delayed variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 10/19] virtio_ring: switch to use vring_virtqueue for disable_cb variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 11/19] virtio_ring: switch to use vring_virtqueue for detach_unused_buf variants Jason Wang
2025-05-28 6:42 ` [PATCH V2 12/19] virtio_ring: use u16 for last_used_idx in virtqueue_poll_split() Jason Wang
2025-05-28 6:42 ` [PATCH V2 13/19] virtio_ring: introduce virtqueue ops Jason Wang
2025-05-28 6:42 ` [PATCH V2 14/19] virtio_ring: determine descriptor flags at one time Jason Wang
2025-05-28 6:42 ` [PATCH V2 15/19] virtio_ring: factor out core logic of buffer detaching Jason Wang
2025-05-28 6:42 ` [PATCH V2 16/19] virtio_ring: factor out core logic for updating last_used_idx Jason Wang
2025-05-28 6:42 ` [PATCH V2 17/19] virtio_ring: factor out split indirect detaching logic Jason Wang
2025-05-28 6:42 ` [PATCH V2 18/19] virtio_ring: factor out split " Jason Wang
2025-05-28 6:42 ` [PATCH V2 19/19] virtio_ring: add in order support Jason Wang
2025-05-28 15:04 ` kernel test robot [this message]
2025-05-28 7:10 ` [PATCH V2 00/19] virtio_ring " Eugenio Perez Martin
2025-05-28 12:50 ` Michael S. Tsirkin
2025-05-29 2:23 ` Jason Wang
-- strict thread matches above, loose matches on Subject: below --
2025-05-29 2:36 [PATCH V2 19/19] virtio_ring: add " kernel test robot
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=202505282256.MVII3mpu-lkp@intel.com \
--to=lkp@intel.com \
--cc=jasowang@redhat.com \
--cc=llvm@lists.linux.dev \
--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.