1

virtio_pci_modern: remove admin queue serialization lock

The admin queue operations are protected by newly introduced
spin lock. To make it possible to issue parallel commands, remove the
admin queue serialization lock.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20240716113552.80599-14-jiri@resnulli.us>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Jiri Pirko 2024-07-16 13:35:52 +02:00 committed by Michael S. Tsirkin
parent 4c3b54af90
commit 6d834691da
2 changed files with 0 additions and 7 deletions

View File

@ -45,8 +45,6 @@ struct virtio_pci_vq_info {
struct virtio_pci_admin_vq { struct virtio_pci_admin_vq {
/* Virtqueue info associated with this admin queue. */ /* Virtqueue info associated with this admin queue. */
struct virtio_pci_vq_info *info; struct virtio_pci_vq_info *info;
/* serializing admin commands execution. */
struct mutex cmd_lock;
/* Protects virtqueue access. */ /* Protects virtqueue access. */
spinlock_t lock; spinlock_t lock;
u64 supported_cmds; u64 supported_cmds;

View File

@ -167,12 +167,9 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev,
in_num++; in_num++;
} }
mutex_lock(&vp_dev->admin_vq.cmd_lock);
ret = virtqueue_exec_admin_cmd(&vp_dev->admin_vq, ret = virtqueue_exec_admin_cmd(&vp_dev->admin_vq,
le16_to_cpu(cmd->opcode), le16_to_cpu(cmd->opcode),
sgs, out_num, in_num, cmd); sgs, out_num, in_num, cmd);
mutex_unlock(&vp_dev->admin_vq.cmd_lock);
if (ret) { if (ret) {
dev_err(&vdev->dev, dev_err(&vdev->dev,
"Failed to execute command on admin vq: %d\n.", ret); "Failed to execute command on admin vq: %d\n.", ret);
@ -837,7 +834,6 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
vp_dev->vdev.id = mdev->id; vp_dev->vdev.id = mdev->id;
spin_lock_init(&vp_dev->admin_vq.lock); spin_lock_init(&vp_dev->admin_vq.lock);
mutex_init(&vp_dev->admin_vq.cmd_lock);
return 0; return 0;
} }
@ -845,6 +841,5 @@ void virtio_pci_modern_remove(struct virtio_pci_device *vp_dev)
{ {
struct virtio_pci_modern_device *mdev = &vp_dev->mdev; struct virtio_pci_modern_device *mdev = &vp_dev->mdev;
mutex_destroy(&vp_dev->admin_vq.cmd_lock);
vp_modern_remove(mdev); vp_modern_remove(mdev);
} }