]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen-netfront: always set num queues if possible
authorchas williams <3chas3@gmail.com>
Wed, 16 Sep 2015 20:28:25 +0000 (16:28 -0400)
committerJoao Martins <joao.m.martins@oracle.com>
Sun, 27 Mar 2016 01:00:56 +0000 (02:00 +0100)
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>
(cherry picked from commit 812494d9a0cacf77e0a538be18183c7b471812aa)
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
drivers/net/xen-netfront.c

index 6febc053a37febc069d241e6811d904f18890f45..441b158d04f73c0a7d3a1dbe61cc37a4913eec2a 100644 (file)
@@ -1819,19 +1819,22 @@ again:
                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];