All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH vhost v4 3/6] virtio: find_vqs: pass struct instead of multi parameters
Date: Fri, 22 Mar 2024 22:10:09 +0800	[thread overview]
Message-ID: <202403222227.Sdp23Lcb-lkp@intel.com> (raw)
In-Reply-To: <20240321101532.59272-4-xuanzhuo@linux.alibaba.com>

Hi Xuan,

kernel test robot noticed the following build errors:

[auto build test ERROR on remoteproc/rproc-next]
[also build test ERROR on v6.8]
[cannot apply to s390/features linus/master uml/next uml/fixes next-20240322]
[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/Xuan-Zhuo/virtio_balloon-remove-the-dependence-where-names-is-null/20240321-182217
base:   git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git rproc-next
patch link:    https://lore.kernel.org/r/20240321101532.59272-4-xuanzhuo%40linux.alibaba.com
patch subject: [PATCH vhost v4 3/6] virtio: find_vqs: pass struct instead of multi parameters
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240322/202403222227.Sdp23Lcb-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240322/202403222227.Sdp23Lcb-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/202403222227.Sdp23Lcb-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/virtio/virtio_vdpa.c: In function 'virtio_vdpa_setup_vq':
>> drivers/virtio/virtio_vdpa.c:216:41: error: 'struct virtio_vq_config' has no member named 'cfg_idx'
     216 |         cb.callback = cfg->callbacks[cfg->cfg_idx] ? virtio_vdpa_virtqueue_cb : NULL;
         |                                         ^~


vim +216 drivers/virtio/virtio_vdpa.c

   142	
   143	static struct virtqueue *
   144	virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,
   145			     struct virtio_vq_config *cfg)
   146	{
   147		struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev);
   148		struct vdpa_device *vdpa = vd_get_vdpa(vdev);
   149		struct device *dma_dev;
   150		const struct vdpa_config_ops *ops = vdpa->config;
   151		struct virtio_vdpa_vq_info *info;
   152		bool (*notify)(struct virtqueue *vq) = virtio_vdpa_notify;
   153		struct vdpa_callback cb;
   154		struct virtqueue *vq;
   155		u64 desc_addr, driver_addr, device_addr;
   156		/* Assume split virtqueue, switch to packed if necessary */
   157		struct vdpa_vq_state state = {0};
   158		unsigned long flags;
   159		u32 align, max_num, min_num = 1;
   160		bool may_reduce_num = true;
   161		int err;
   162	
   163		if (index >= vdpa->nvqs)
   164			return ERR_PTR(-ENOENT);
   165	
   166		/* We cannot accept VIRTIO_F_NOTIFICATION_DATA without kick_vq_with_data */
   167		if (__virtio_test_bit(vdev, VIRTIO_F_NOTIFICATION_DATA)) {
   168			if (ops->kick_vq_with_data)
   169				notify = virtio_vdpa_notify_with_data;
   170			else
   171				__virtio_clear_bit(vdev, VIRTIO_F_NOTIFICATION_DATA);
   172		}
   173	
   174		/* Queue shouldn't already be set up. */
   175		if (ops->get_vq_ready(vdpa, index))
   176			return ERR_PTR(-ENOENT);
   177	
   178		/* Allocate and fill out our active queue description */
   179		info = kmalloc(sizeof(*info), GFP_KERNEL);
   180		if (!info)
   181			return ERR_PTR(-ENOMEM);
   182	
   183		max_num = ops->get_vq_num_max(vdpa);
   184		if (max_num == 0) {
   185			err = -ENOENT;
   186			goto error_new_virtqueue;
   187		}
   188	
   189		if (ops->get_vq_num_min)
   190			min_num = ops->get_vq_num_min(vdpa);
   191	
   192		may_reduce_num = (max_num == min_num) ? false : true;
   193	
   194		/* Create the vring */
   195		align = ops->get_vq_align(vdpa);
   196	
   197		if (ops->get_vq_dma_dev)
   198			dma_dev = ops->get_vq_dma_dev(vdpa, index);
   199		else
   200			dma_dev = vdpa_get_dma_dev(vdpa);
   201		vq = vring_create_virtqueue_dma(index, max_num, align, vdev,
   202						true, may_reduce_num,
   203						cfg->ctx ? cfg->ctx[index] : false,
   204						notify,
   205						cfg->callbacks[index],
   206						cfg->names[index],
   207						dma_dev);
   208		if (!vq) {
   209			err = -ENOMEM;
   210			goto error_new_virtqueue;
   211		}
   212	
   213		vq->num_max = max_num;
   214	
   215		/* Setup virtqueue callback */
 > 216		cb.callback = cfg->callbacks[cfg->cfg_idx] ? virtio_vdpa_virtqueue_cb : NULL;
   217		cb.private = info;
   218		cb.trigger = NULL;
   219		ops->set_vq_cb(vdpa, index, &cb);
   220		ops->set_vq_num(vdpa, index, virtqueue_get_vring_size(vq));
   221	
   222		desc_addr = virtqueue_get_desc_addr(vq);
   223		driver_addr = virtqueue_get_avail_addr(vq);
   224		device_addr = virtqueue_get_used_addr(vq);
   225	
   226		if (ops->set_vq_address(vdpa, index,
   227					desc_addr, driver_addr,
   228					device_addr)) {
   229			err = -EINVAL;
   230			goto err_vq;
   231		}
   232	
   233		/* reset virtqueue state index */
   234		if (virtio_has_feature(vdev, VIRTIO_F_RING_PACKED)) {
   235			struct vdpa_vq_state_packed *s = &state.packed;
   236	
   237			s->last_avail_counter = 1;
   238			s->last_avail_idx = 0;
   239			s->last_used_counter = 1;
   240			s->last_used_idx = 0;
   241		}
   242		err = ops->set_vq_state(vdpa, index, &state);
   243		if (err)
   244			goto err_vq;
   245	
   246		ops->set_vq_ready(vdpa, index, 1);
   247	
   248		vq->priv = info;
   249		info->vq = vq;
   250	
   251		spin_lock_irqsave(&vd_dev->lock, flags);
   252		list_add(&info->node, &vd_dev->virtqueues);
   253		spin_unlock_irqrestore(&vd_dev->lock, flags);
   254	
   255		return vq;
   256	
   257	err_vq:
   258		vring_del_virtqueue(vq);
   259	error_new_virtqueue:
   260		ops->set_vq_ready(vdpa, index, 0);
   261		/* VDPA driver should make sure vq is stopeed here */
   262		WARN_ON(ops->get_vq_ready(vdpa, index));
   263		kfree(info);
   264		return ERR_PTR(err);
   265	}
   266	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2024-03-22 14:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 10:15 [PATCH vhost v4 0/6] refactor the params of find_vqs() Xuan Zhuo
2024-03-21 10:15 ` [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null Xuan Zhuo
2024-03-22 11:56   ` David Hildenbrand
2024-03-25  6:03     ` Xuan Zhuo
2024-03-22 19:16   ` Daniel Verkamp
2024-03-22 21:02     ` David Hildenbrand
2024-03-25  6:08       ` Xuan Zhuo
2024-03-25  9:11         ` David Hildenbrand
2024-03-26 20:23           ` Daniel Verkamp
2024-03-25  9:44         ` Cornelia Huck
2024-03-26  4:11           ` Jason Wang
2024-03-26  4:25             ` Jason Wang
2024-03-21 10:15 ` [PATCH vhost v4 2/6] virtio: remove support for names array entries being null Xuan Zhuo
2024-03-21 10:15 ` [PATCH vhost v4 3/6] virtio: find_vqs: pass struct instead of multi parameters Xuan Zhuo
2024-03-22 14:10   ` kernel test robot [this message]
2024-03-23  0:29   ` kernel test robot
2024-03-21 10:15 ` [PATCH vhost v4 4/6] virtio: vring_create_virtqueue: " Xuan Zhuo
2024-03-21 10:15 ` [PATCH vhost v4 5/6] virtio: vring_new_virtqueue(): " Xuan Zhuo
2024-03-21 10:15 ` [PATCH vhost v4 6/6] virtio_ring: simplify the parameters of the funcs related to vring_create/new_virtqueue() Xuan Zhuo

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=202403222227.Sdp23Lcb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /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.