net/virtio: fix multiple queue enabling
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 7 Nov 2016 09:25:06 +0000 (17:25 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 7 Nov 2016 14:41:45 +0000 (15:41 +0100)
commit663c76798f197336c41b4929ba374cdbb6f8073c
treea049dd0015194a4c960b9817766b2ba3ce6efaf3
parent60d4a3530332b96aa6808bcdc2687ae4d817250c
net/virtio: fix multiple queue enabling

When queue number shrinks to 1 from X, the following code stops us
sending the multiple queue ctrl message:

        if (nb_queues > 1) {
                if (virtio_set_multiple_queues(dev, nb_queues) != 0)
                        return -EINVAL;
        }

This ends up with still X queues being enabled, which is obviously
wrong. Fix it by replacing the check with a multiple queue enabled
or not check.

Fixes: 823ad647950a ("virtio: support multiple queues")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_ethdev.c