mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 05:26:07 +00:00
virtio_pci_modern: treat vp_dev->admin_vq.info.vq pointer as static
It is guaranteed by the virtio_pci and PCI layers that none of the VFs is probed before setup_vq() is called for admin queue and after del_vq() is called for admin queue. Therefore treat vp_dev->admin_vq.info.vq as static, don't null it and don't take cmd lock during assign. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Message-Id: <20240716113552.80599-7-jiri@resnulli.us> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
06909a4427
commit
4199107e39
@ -45,7 +45,7 @@ struct virtio_pci_vq_info {
|
||||
struct virtio_pci_admin_vq {
|
||||
/* Virtqueue info associated with this admin queue. */
|
||||
struct virtio_pci_vq_info info;
|
||||
/* serializing admin commands execution and virtqueue deletion */
|
||||
/* serializing admin commands execution. */
|
||||
struct mutex cmd_lock;
|
||||
u64 supported_cmds;
|
||||
/* Name of the admin queue: avq.$vq_index. */
|
||||
|
@ -580,11 +580,8 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (is_avq) {
|
||||
mutex_lock(&vp_dev->admin_vq.cmd_lock);
|
||||
if (is_avq)
|
||||
vp_dev->admin_vq.info.vq = vq;
|
||||
mutex_unlock(&vp_dev->admin_vq.cmd_lock);
|
||||
}
|
||||
|
||||
return vq;
|
||||
|
||||
@ -620,12 +617,6 @@ static void del_vq(struct virtio_pci_vq_info *info)
|
||||
struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
|
||||
struct virtio_pci_modern_device *mdev = &vp_dev->mdev;
|
||||
|
||||
if (vp_is_avq(&vp_dev->vdev, vq->index)) {
|
||||
mutex_lock(&vp_dev->admin_vq.cmd_lock);
|
||||
vp_dev->admin_vq.info.vq = NULL;
|
||||
mutex_unlock(&vp_dev->admin_vq.cmd_lock);
|
||||
}
|
||||
|
||||
if (vp_dev->msix_enabled)
|
||||
vp_modern_queue_vector(mdev, vq->index,
|
||||
VIRTIO_MSI_NO_VECTOR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user