提交 c18e9cd6 编写于 作者: A Amos Kong 提交者: David S. Miller

virtio_net: zero is an invald queue_pairs number

Execute "ethtool -L eth0 combined 0" in guest, if multiqueue
is enabled, virtnet_send_command() will return -EINVAL error,
there is a validation in QEMU.

But if multiqueue is disabled, virtnet_set_queues() will just
return zero (success). We should return error for this situation.
Signed-off-by: NAmos Kong <akong@redhat.com>
Acked-by: NJason Wang <jasowang@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 235a251a
...@@ -1285,7 +1285,7 @@ static int virtnet_set_channels(struct net_device *dev, ...@@ -1285,7 +1285,7 @@ static int virtnet_set_channels(struct net_device *dev,
if (channels->rx_count || channels->tx_count || channels->other_count) if (channels->rx_count || channels->tx_count || channels->other_count)
return -EINVAL; return -EINVAL;
if (queue_pairs > vi->max_queue_pairs) if (queue_pairs > vi->max_queue_pairs || queue_pairs == 0)
return -EINVAL; return -EINVAL;
get_online_cpus(); get_online_cpus();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册