Commit 7090f2b5 authored by Jiri Pirko's avatar Jiri Pirko Committed by Michael S. Tsirkin

virtio_pci_modern: pass cmd as an identification token

In preparation to asynchronous admin queue processing, pass cmd pointer
as a data arg to virtqueue_add_sgs().
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Message-Id: <20240716113552.80599-12-jiri@resnulli.us>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent b00c4150
...@@ -58,7 +58,7 @@ static int virtqueue_exec_admin_cmd(struct virtio_pci_admin_vq *admin_vq, ...@@ -58,7 +58,7 @@ static int virtqueue_exec_admin_cmd(struct virtio_pci_admin_vq *admin_vq,
struct scatterlist **sgs, struct scatterlist **sgs,
unsigned int out_num, unsigned int out_num,
unsigned int in_num, unsigned int in_num,
void *data) struct virtio_admin_cmd *cmd)
{ {
struct virtqueue *vq; struct virtqueue *vq;
int ret, len; int ret, len;
...@@ -72,7 +72,7 @@ static int virtqueue_exec_admin_cmd(struct virtio_pci_admin_vq *admin_vq, ...@@ -72,7 +72,7 @@ static int virtqueue_exec_admin_cmd(struct virtio_pci_admin_vq *admin_vq,
!((1ULL << opcode) & admin_vq->supported_cmds)) !((1ULL << opcode) & admin_vq->supported_cmds))
return -EOPNOTSUPP; return -EOPNOTSUPP;
ret = virtqueue_add_sgs(vq, sgs, out_num, in_num, data, GFP_KERNEL); ret = virtqueue_add_sgs(vq, sgs, out_num, in_num, cmd, GFP_KERNEL);
if (ret < 0) if (ret < 0)
return -EIO; return -EIO;
...@@ -140,7 +140,7 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev, ...@@ -140,7 +140,7 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev,
mutex_lock(&vp_dev->admin_vq.cmd_lock); 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, sgs); sgs, out_num, in_num, cmd);
mutex_unlock(&vp_dev->admin_vq.cmd_lock); mutex_unlock(&vp_dev->admin_vq.cmd_lock);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment