Commit 812494d9 authored by chas williams's avatar chas williams Committed by David S. Miller

xen-netfront: always set num queues if possible

If netfront connects with two (or more) queues and then reconnects with
only one queue it fails to delete or rewrite the multi-queue-num-queues
key and netback will try to use the wrong number of queues.

Always write the num-queues field if the backend has multi-queue support.
Signed-off-by: default avatarChas Williams <3chas3@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47bbbb30
...@@ -1819,19 +1819,22 @@ static int talk_to_netback(struct xenbus_device *dev, ...@@ -1819,19 +1819,22 @@ static int talk_to_netback(struct xenbus_device *dev,
goto destroy_ring; goto destroy_ring;
} }
if (num_queues == 1) { if (xenbus_exists(XBT_NIL,
err = write_queue_xenstore_keys(&info->queues[0], &xbt, 0); /* flat */ info->xbdev->otherend, "multi-queue-max-queues")) {
if (err)
goto abort_transaction_no_dev_fatal;
} else {
/* Write the number of queues */ /* Write the number of queues */
err = xenbus_printf(xbt, dev->nodename, "multi-queue-num-queues", err = xenbus_printf(xbt, dev->nodename,
"%u", num_queues); "multi-queue-num-queues", "%u", num_queues);
if (err) { if (err) {
message = "writing multi-queue-num-queues"; message = "writing multi-queue-num-queues";
goto abort_transaction_no_dev_fatal; goto abort_transaction_no_dev_fatal;
} }
}
if (num_queues == 1) {
err = write_queue_xenstore_keys(&info->queues[0], &xbt, 0); /* flat */
if (err)
goto abort_transaction_no_dev_fatal;
} else {
/* Write the keys for each queue */ /* Write the keys for each queue */
for (i = 0; i < num_queues; ++i) { for (i = 0; i < num_queues; ++i) {
queue = &info->queues[i]; queue = &info->queues[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment