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
parent reply other threads:[~2025-05-28 15:05 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20250528064234.12228-20-jasowang@redhat.com>]
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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox