Skip to content

Commit

Permalink
virtio_pci_modern: pass cmd as an identification token
Browse files Browse the repository at this point in the history
In preparation to asynchronous admin queue processing, pass cmd pointer
as a data arg to virtqueue_add_sgs().

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20240716113552.80599-12-jiri@resnulli.us>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Jiri Pirko authored and mstsirkin committed Jul 17, 2024
1 parent b00c415 commit 7090f2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/virtio/virtio_pci_modern.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int virtqueue_exec_admin_cmd(struct virtio_pci_admin_vq *admin_vq,
struct scatterlist **sgs,
unsigned int out_num,
unsigned int in_num,
void *data)
struct virtio_admin_cmd *cmd)
{
struct virtqueue *vq;
int ret, len;
Expand All @@ -72,7 +72,7 @@ static int virtqueue_exec_admin_cmd(struct virtio_pci_admin_vq *admin_vq,
!((1ULL << opcode) & admin_vq->supported_cmds))
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)
return -EIO;

Expand Down Expand Up @@ -140,7 +140,7 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev,
mutex_lock(&vp_dev->admin_vq.cmd_lock);
ret = virtqueue_exec_admin_cmd(&vp_dev->admin_vq,
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);

if (ret) {
Expand Down

0 comments on commit 7090f2b

Please sign in to comment.