diff options
author | chas williams <3chas3@gmail.com> | 2015-09-16 16:28:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-21 00:39:21 -0400 |
commit | 812494d9a0cacf77e0a538be18183c7b471812aa (patch) | |
tree | 03c55647d64b259b499bacec9c63922526f82d7a /drivers/net/xen-netfront.c | |
parent | 47bbbb30b4331ec58a74a66a044341f0114b02b3 (diff) |
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: Chas Williams <3chas3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r-- | drivers/net/xen-netfront.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index f821a97d7827..9bf63c27a9b7 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1819,19 +1819,22 @@ again: | |||
1819 | goto destroy_ring; | 1819 | goto destroy_ring; |
1820 | } | 1820 | } |
1821 | 1821 | ||
1822 | if (num_queues == 1) { | 1822 | if (xenbus_exists(XBT_NIL, |
1823 | err = write_queue_xenstore_keys(&info->queues[0], &xbt, 0); /* flat */ | 1823 | info->xbdev->otherend, "multi-queue-max-queues")) { |
1824 | if (err) | ||
1825 | goto abort_transaction_no_dev_fatal; | ||
1826 | } else { | ||
1827 | /* Write the number of queues */ | 1824 | /* Write the number of queues */ |
1828 | err = xenbus_printf(xbt, dev->nodename, "multi-queue-num-queues", | 1825 | err = xenbus_printf(xbt, dev->nodename, |
1829 | "%u", num_queues); | 1826 | "multi-queue-num-queues", "%u", num_queues); |
1830 | if (err) { | 1827 | if (err) { |
1831 | message = "writing multi-queue-num-queues"; | 1828 | message = "writing multi-queue-num-queues"; |
1832 | goto abort_transaction_no_dev_fatal; | 1829 | goto abort_transaction_no_dev_fatal; |
1833 | } | 1830 | } |
1831 | } | ||
1834 | 1832 | ||
1833 | if (num_queues == 1) { | ||
1834 | err = write_queue_xenstore_keys(&info->queues[0], &xbt, 0); /* flat */ | ||
1835 | if (err) | ||
1836 | goto abort_transaction_no_dev_fatal; | ||
1837 | } else { | ||
1835 | /* Write the keys for each queue */ | 1838 | /* Write the keys for each queue */ |
1836 | for (i = 0; i < num_queues; ++i) { | 1839 | for (i = 0; i < num_queues; ++i) { |
1837 | queue = &info->queues[i]; | 1840 | queue = &info->queues[i]; |