Skip to content

Commit

Permalink
xen-netfront: always set num queues if possible
Browse files Browse the repository at this point in the history
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: Chas Williams <3chas3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
chas williams authored and David S. Miller committed Sep 21, 2015
1 parent 47bbbb3 commit 812494d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,19 +1819,22 @@ static int talk_to_netback(struct xenbus_device *dev,
goto destroy_ring;
}

if (num_queues == 1) {
err = write_queue_xenstore_keys(&info->queues[0], &xbt, 0); /* flat */
if (err)
goto abort_transaction_no_dev_fatal;
} else {
if (xenbus_exists(XBT_NIL,
info->xbdev->otherend, "multi-queue-max-queues")) {
/* Write the number of queues */
err = xenbus_printf(xbt, dev->nodename, "multi-queue-num-queues",
"%u", num_queues);
err = xenbus_printf(xbt, dev->nodename,
"multi-queue-num-queues", "%u", num_queues);
if (err) {
message = "writing multi-queue-num-queues";
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 */
for (i = 0; i < num_queues; ++i) {
queue = &info->queues[i];
Expand Down

0 comments on commit 812494d

Please sign in to comment.