* Re: [PATCH V2 19/19] virtio_ring: add in order support
[not found] <20250528064234.12228-20-jasowang@redhat.com>
@ 2025-05-28 15:04 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-28 15:04 UTC (permalink / raw)
To: Jason Wang; +Cc: llvm, oe-kbuild-all
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-28 15:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250528064234.12228-20-jasowang@redhat.com>
2025-05-28 15:04 ` [PATCH V2 19/19] virtio_ring: add in order support kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox