Previously, control vq only allowed a single request to be sent,
so using virtnet_info as a global token was fine. To support
concurrent requests, the driver needs to use a command-level token
to distinguish between requests that have been sent.

Signed-off-by: Heng Qi <hen...@linux.alibaba.com>
---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 823a9dca51c1..e59e12bb7601 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2721,7 +2721,8 @@ static bool virtnet_send_command_reply(struct 
virtnet_info *vi,
                sgs[out_num + in_num++] = in;
 
        BUG_ON(out_num + in_num > ARRAY_SIZE(sgs));
-       ret = virtqueue_add_sgs(vi->cvq, sgs, out_num, in_num, vi, GFP_ATOMIC);
+       ret = virtqueue_add_sgs(vi->cvq, sgs, out_num, in_num,
+                               &ctrl->completion, GFP_ATOMIC);
        if (ret < 0) {
                dev_warn(&vi->vdev->dev,
                         "Failed to add sgs for command vq: %d\n.", ret);
-- 
2.32.0.3.g01195cf9f


Reply via email to