Skip to content

Commit

Permalink
virtio_net: zero is an invald queue_pairs number
Browse files Browse the repository at this point in the history
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: Amos Kong <akong@redhat.com>
Acked-by:  Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Amos Kong authored and David S. Miller committed Apr 22, 2014
1 parent 235a251 commit c18e9cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ static int virtnet_set_channels(struct net_device *dev,
if (channels->rx_count || channels->tx_count || channels->other_count)
return -EINVAL;

if (queue_pairs > vi->max_queue_pairs)
if (queue_pairs > vi->max_queue_pairs || queue_pairs == 0)
return -EINVAL;

get_online_cpus();
Expand Down

0 comments on commit c18e9cd

Please sign in to comment.