Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2014 21:43:17 +0000 (14:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2014 21:43:17 +0000 (14:43 -0700)
Pull virtio updates from Rusty Russell:
 "Nothing exciting: virtio-blk users might see a bit of a boost from the
  doubling of the default queue length though"

* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  virtio-blk: base queue-depth on virtqueue ringsize or module param
  Revert a02bbb1ccfe8: MAINTAINERS: add virtio-dev ML for virtio
  virtio: fail adding buffer on broken queues.
  virtio-rng: don't crash if virtqueue is broken.
  virtio_balloon: don't crash if virtqueue is broken.
  virtio_blk: don't crash, report error if virtqueue is broken.
  virtio_net: don't crash if virtqueue is broken.
  virtio_balloon: don't softlockup on huge balloon changes.
  virtio: Use pci_enable_msix_exact() instead of pci_enable_msix()
  MAINTAINERS: virtio-dev is subscribers only
  tools/virtio: add a missing )
  tools/virtio: fix missing kmemleak_ignore symbol
  tools/virtio: update internal copies of headers

1  2 
MAINTAINERS
drivers/block/virtio_blk.c
drivers/net/virtio_net.c

diff --combined MAINTAINERS
@@@ -242,8 -242,8 +242,8 @@@ S: Maintaine
  F:    drivers/platform/x86/acer-wmi.c
  
  ACPI
 -M:    Len Brown <lenb@kernel.org>
  M:    Rafael J. Wysocki <rjw@rjwysocki.net>
 +M:    Len Brown <lenb@kernel.org>
  L:    linux-acpi@vger.kernel.org
  W:    https://01.org/linux-acpi
  Q:    https://patchwork.kernel.org/project/linux-acpi/list/
@@@ -911,11 -911,11 +911,11 @@@ F:      arch/arm/include/asm/hardware/dec212
  F:    arch/arm/mach-footbridge/
  
  ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
 -M:    Shawn Guo <shawn.guo@linaro.org>
 +M:    Shawn Guo <shawn.guo@freescale.com>
  M:    Sascha Hauer <kernel@pengutronix.de>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 -T:    git git://git.linaro.org/people/shawnguo/linux-2.6.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git
  F:    arch/arm/mach-imx/
  F:    arch/arm/boot/dts/imx*
  F:    arch/arm/configs/imx*_defconfig
@@@ -1320,7 -1320,6 +1320,7 @@@ M:      Linus Walleij <linus.walleij@linaro.
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Supported
  F:    arch/arm/mach-u300/
 +F:    drivers/clocksource/timer-u300.c
  F:    drivers/i2c/busses/i2c-stu300.c
  F:    drivers/rtc/rtc-coh901331.c
  F:    drivers/watchdog/coh901327_wdt.c
@@@ -1833,8 -1832,8 +1833,8 @@@ F:      net/bluetooth
  F:    include/net/bluetooth/
  
  BONDING DRIVER
 -M:    Jay Vosburgh <fubar@us.ibm.com>
 -M:    Veaceslav Falico <vfalico@redhat.com>
 +M:    Jay Vosburgh <j.vosburgh@gmail.com>
 +M:    Veaceslav Falico <vfalico@gmail.com>
  M:    Andy Gospodarek <andy@greyhouse.net>
  L:    netdev@vger.kernel.org
  W:    http://sourceforge.net/projects/bonding/
@@@ -1921,8 -1920,8 +1921,8 @@@ F:      drivers/bcma
  F:    include/linux/bcma/
  
  BROCADE BFA FC SCSI DRIVER
 -M:    Anil Gurumurthy <agurumur@brocade.com>
 -M:    Vijaya Mohan Guvva <vmohan@brocade.com>
 +M:    Anil Gurumurthy <anil.gurumurthy@qlogic.com>
 +M:    Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  F:    drivers/scsi/bfa/
@@@ -2204,13 -2203,6 +2204,13 @@@ L:    alsa-devel@alsa-project.org (moderat
  S:    Odd Fixes
  F:    sound/soc/codecs/cs4270*
  
 +CIRRUS LOGIC AUDIO CODEC DRIVERS
 +M:    Brian Austin <brian.austin@cirrus.com>
 +M:    Paul Handrigan <Paul.Handrigan@cirrus.com>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    sound/soc/codecs/cs*
 +
  CLEANCACHE API
  M:    Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  L:    linux-kernel@vger.kernel.org
@@@ -2809,9 -2801,9 +2809,9 @@@ S:      Supporte
  F:    drivers/acpi/dock.c
  
  DOCUMENTATION
 -M:    Rob Landley <rob@landley.net>
 +M:    Randy Dunlap <rdunlap@infradead.org>
  L:    linux-doc@vger.kernel.org
 -T:    TBD
 +T:    quilt http://www.infradead.org/~rdunlap/Doc/patches/
  S:    Maintained
  F:    Documentation/
  
@@@ -3665,8 -3657,8 +3665,8 @@@ S:      Maintaine
  F:    fs/freevxfs/
  
  FREEZER
 -M:    Pavel Machek <pavel@ucw.cz>
  M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
 +M:    Pavel Machek <pavel@ucw.cz>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    Documentation/power/freezing-of-tasks.txt
@@@ -4030,8 -4022,8 +4030,8 @@@ S:      Maintaine
  F:    drivers/video/hgafb.c
  
  HIBERNATION (aka Software Suspend, aka swsusp)
 -M:    Pavel Machek <pavel@ucw.cz>
  M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
 +M:    Pavel Machek <pavel@ucw.cz>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    arch/x86/power/
@@@ -4553,7 -4545,6 +4553,7 @@@ M:      Greg Rose <gregory.v.rose@intel.com
  M:    Alex Duyck <alexander.h.duyck@intel.com>
  M:    John Ronciak <john.ronciak@intel.com>
  M:    Mitch Williams <mitch.a.williams@intel.com>
 +M:    Linux NICS <linux.nics@intel.com>
  L:    e1000-devel@lists.sourceforge.net
  W:    http://www.intel.com/support/feedback.htm
  W:    http://e1000.sourceforge.net/
@@@ -5254,10 -5245,11 +5254,10 @@@ F:   arch/powerpc/platforms/512x
  F:    arch/powerpc/platforms/52xx/
  
  LINUX FOR POWERPC EMBEDDED PPC4XX
 -M:    Josh Boyer <jwboyer@gmail.com>
 +M:  Alistair Popple <alistair@popple.id.au>
  M:    Matt Porter <mporter@kernel.crashing.org>
  W:    http://www.penguinppc.org/
  L:    linuxppc-dev@lists.ozlabs.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git
  S:    Maintained
  F:    arch/powerpc/platforms/40x/
  F:    arch/powerpc/platforms/44x/
@@@ -5695,12 -5687,6 +5695,12 @@@ L:    linux-watchdog@vger.kernel.or
  S:    Supported
  F:    drivers/watchdog/mena21_wdt.c
  
 +MEN CHAMELEON BUS (mcb)
 +M:    Johannes Thumshirn <johannes.thumshirn@men.de>
 +S:    Supported
 +F:    drivers/mcb/
 +F:    include/linux/mcb.h
 +
  METAG ARCHITECTURE
  M:    James Hogan <james.hogan@imgtec.com>
  L:    linux-metag@vger.kernel.org
@@@ -6017,9 -6003,6 +6017,9 @@@ F:      include/linux/netdevice.
  F:    include/uapi/linux/in.h
  F:    include/uapi/linux/net.h
  F:    include/uapi/linux/netdevice.h
 +F:    tools/net/
 +F:    tools/testing/selftests/net/
 +F:    lib/random32.c
  
  NETWORKING [IPv4/IPv6]
  M:    "David S. Miller" <davem@davemloft.net>
@@@ -7418,26 -7401,10 +7418,26 @@@ W:   http://www.ibm.com/developerworks/li
  S:    Supported
  F:    arch/s390/
  F:    drivers/s390/
 -F:    block/partitions/ibm.c
  F:    Documentation/s390/
  F:    Documentation/DocBook/s390*
  
 +S390 COMMON I/O LAYER
 +M:    Sebastian Ott <sebott@linux.vnet.ibm.com>
 +M:    Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
 +L:    linux-s390@vger.kernel.org
 +W:    http://www.ibm.com/developerworks/linux/linux390/
 +S:    Supported
 +F:    drivers/s390/cio/
 +
 +S390 DASD DRIVER
 +M:    Stefan Weinhuber <wein@de.ibm.com>
 +M:    Stefan Haberland <stefan.haberland@de.ibm.com>
 +L:    linux-s390@vger.kernel.org
 +W:    http://www.ibm.com/developerworks/linux/linux390/
 +S:    Supported
 +F:    drivers/s390/block/dasd*
 +F:    block/partitions/ibm.c
 +
  S390 NETWORK DRIVERS
  M:    Ursula Braun <ursula.braun@de.ibm.com>
  M:    Frank Blaschka <blaschka@linux.vnet.ibm.com>
@@@ -7447,15 -7414,6 +7447,15 @@@ W:    http://www.ibm.com/developerworks/li
  S:    Supported
  F:    drivers/s390/net/
  
 +S390 PCI SUBSYSTEM
 +M:    Sebastian Ott <sebott@linux.vnet.ibm.com>
 +M:    Gerald Schaefer <gerald.schaefer@de.ibm.com>
 +L:    linux-s390@vger.kernel.org
 +W:    http://www.ibm.com/developerworks/linux/linux390/
 +S:    Supported
 +F:    arch/s390/pci/
 +F:    drivers/pci/hotplug/s390_pci_hpc.c
 +
  S390 ZCRYPT DRIVER
  M:    Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
  M:    linux390@de.ibm.com
@@@ -7839,6 -7797,13 +7839,6 @@@ F:     Documentation/ia64/serial.tx
  F:    drivers/tty/serial/ioc?_serial.c
  F:    include/linux/ioc?.h
  
 -SGI VISUAL WORKSTATION 320 AND 540
 -M:    Andrey Panin <pazke@donpac.ru>
 -L:    linux-visws-devel@lists.sf.net
 -W:    http://linux-visws.sf.net
 -S:    Maintained for 2.6.
 -F:    Documentation/sgi-visws.txt
 -
  SGI XP/XPC/XPNET DRIVER
  M:    Cliff Whickman <cpw@sgi.com>
  M:    Robin Holt <robinmholt@gmail.com>
@@@ -8386,12 -8351,6 +8386,12 @@@ M:    Teddy Wang <teddy.wang@siliconmotion
  S:    Odd Fixes
  F:    drivers/staging/sm7xxfb/
  
 +STAGING - SLICOSS
 +M:    Lior Dotan <liodot@gmail.com>
 +M:    Christopher Harrer <charrer@alacritech.com>
 +S:    Odd Fixes
 +F:    drivers/staging/slicoss/
 +
  STAGING - SOFTLOGIC 6x10 MPEG CODEC
  M:    Ismael Luceno <ismael.luceno@corp.bluecherry.net>
  S:    Supported
@@@ -8464,9 -8423,9 +8464,9 @@@ F:      arch/sh
  F:    drivers/sh/
  
  SUSPEND TO RAM
 +M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  M:    Len Brown <len.brown@intel.com>
  M:    Pavel Machek <pavel@ucw.cz>
 -M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    Documentation/power/
@@@ -9077,13 -9036,6 +9077,13 @@@ F:    drivers/cdrom/cdrom.
  F:    include/linux/cdrom.h
  F:    include/uapi/linux/cdrom.h
  
 +UNISYS S-PAR DRIVERS
 +M:     Benjamin Romer <benjamin.romer@unisys.com>
 +M:     David Kershner <david.kershner@unisys.com>
 +L:     sparmaintainer@unisys.com (Unisys internal)
 +S:     Supported
 +F:     drivers/staging/unisys/
 +
  UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
  M:    Vinayak Holikatti <vinholikatti@gmail.com>
  M:    Santosh Y <santoshsy@gmail.com>
@@@ -9122,7 -9074,8 +9122,7 @@@ S:      Maintaine
  F:    drivers/net/wireless/ath/ar5523/
  
  USB ATTACHED SCSI
 -M:    Matthew Wilcox <willy@linux.intel.com>
 -M:    Sarah Sharp <sarah.a.sharp@linux.intel.com>
 +M:    Hans de Goede <hdegoede@redhat.com>
  M:    Gerd Hoffmann <kraxel@redhat.com>
  L:    linux-usb@vger.kernel.org
  L:    linux-scsi@vger.kernel.org
@@@ -9348,7 -9301,7 +9348,7 @@@ S:      Maintaine
  F:    drivers/net/wireless/rndis_wlan.c
  
  USB XHCI DRIVER
 -M:    Sarah Sharp <sarah.a.sharp@linux.intel.com>
 +M:    Mathias Nyman <mathias.nyman@intel.com>
  L:    linux-usb@vger.kernel.org
  S:    Supported
  F:    drivers/usb/host/xhci*
@@@ -9432,7 -9385,6 +9432,6 @@@ F:      include/media/videobuf2-
  
  VIRTIO CONSOLE DRIVER
  M:    Amit Shah <amit.shah@redhat.com>
- L:    virtio-dev@lists.oasis-open.org
  L:    virtualization@lists.linux-foundation.org
  S:    Maintained
  F:    drivers/char/virtio_console.c
@@@ -9442,7 -9394,6 +9441,6 @@@ F:      include/uapi/linux/virtio_console.
  VIRTIO CORE, NET AND BLOCK DRIVERS
  M:    Rusty Russell <rusty@rustcorp.com.au>
  M:    "Michael S. Tsirkin" <mst@redhat.com>
- L:    virtio-dev@lists.oasis-open.org
  L:    virtualization@lists.linux-foundation.org
  S:    Maintained
  F:    drivers/virtio/
@@@ -9455,7 -9406,6 +9453,6 @@@ F:      include/uapi/linux/virtio_*.
  VIRTIO HOST (VHOST)
  M:    "Michael S. Tsirkin" <mst@redhat.com>
  L:    kvm@vger.kernel.org
- L:    virtio-dev@lists.oasis-open.org
  L:    virtualization@lists.linux-foundation.org
  L:    netdev@vger.kernel.org
  S:    Maintained
@@@ -9826,12 -9776,6 +9823,12 @@@ L:    linux-serial@vger.kernel.or
  S:    Maintained
  F:    drivers/tty/serial/uartlite.c
  
 +XTENSA XTFPGA PLATFORM SUPPORT
 +M:    Max Filippov <jcmvbkbc@gmail.com>
 +L:    linux-xtensa@linux-xtensa.org
 +S:    Maintained
 +F:    drivers/spi/spi-xtensa-xtfpga.c
 +
  YAM DRIVER FOR AX.25
  M:    Jean-Paul Roubelat <jpr@f6fbb.org>
  L:    linux-hams@vger.kernel.org
@@@ -158,6 -158,7 +158,7 @@@ static int virtio_queue_rq(struct blk_m
        unsigned long flags;
        unsigned int num;
        const bool last = (req->cmd_flags & REQ_END) != 0;
+       int err;
  
        BUG_ON(req->nr_phys_segments + 2 > vblk->sg_elems);
  
        }
  
        spin_lock_irqsave(&vblk->vq_lock, flags);
-       if (__virtblk_add_req(vblk->vq, vbr, vbr->sg, num) < 0) {
+       err = __virtblk_add_req(vblk->vq, vbr, vbr->sg, num);
+       if (err) {
                virtqueue_kick(vblk->vq);
                spin_unlock_irqrestore(&vblk->vq_lock, flags);
                blk_mq_stop_hw_queue(hctx);
-               return BLK_MQ_RQ_QUEUE_BUSY;
+               /* Out of mem doesn't actually happen, since we fall back
+                * to direct descriptors */
+               if (err == -ENOMEM || err == -ENOSPC)
+                       return BLK_MQ_RQ_QUEUE_BUSY;
+               return BLK_MQ_RQ_QUEUE_ERROR;
        }
  
        if (last)
@@@ -485,19 -491,19 +491,20 @@@ static struct blk_mq_ops virtio_mq_ops 
  static struct blk_mq_reg virtio_mq_reg = {
        .ops            = &virtio_mq_ops,
        .nr_hw_queues   = 1,
-       .queue_depth    = 64,
+       .queue_depth    = 0, /* Set in virtblk_probe */
        .numa_node      = NUMA_NO_NODE,
        .flags          = BLK_MQ_F_SHOULD_MERGE,
  };
+ module_param_named(queue_depth, virtio_mq_reg.queue_depth, uint, 0444);
  
 -static void virtblk_init_vbr(void *data, struct blk_mq_hw_ctx *hctx,
 +static int virtblk_init_vbr(void *data, struct blk_mq_hw_ctx *hctx,
                             struct request *rq, unsigned int nr)
  {
        struct virtio_blk *vblk = data;
        struct virtblk_req *vbr = rq->special;
  
        sg_init_table(vbr->sg, vblk->sg_elems);
 +      return 0;
  }
  
  static int virtblk_probe(struct virtio_device *vdev)
                goto out_free_vq;
        }
  
+       /* Default queue sizing is to fill the ring. */
+       if (!virtio_mq_reg.queue_depth) {
+               virtio_mq_reg.queue_depth = vblk->vq->num_free;
+               /* ... but without indirect descs, we use 2 descs per req */
+               if (!virtio_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC))
+                       virtio_mq_reg.queue_depth /= 2;
+       }
        virtio_mq_reg.cmd_size =
                sizeof(struct virtblk_req) +
                sizeof(struct scatterlist) * sg_elems;
diff --combined drivers/net/virtio_net.c
@@@ -671,7 -671,8 +671,7 @@@ static bool try_fill_recv(struct receiv
                if (err)
                        break;
        } while (rq->vq->num_free);
 -      if (unlikely(!virtqueue_kick(rq->vq)))
 -              return false;
 +      virtqueue_kick(rq->vq);
        return !oom;
  }
  
@@@ -876,7 -877,7 +876,7 @@@ static netdev_tx_t start_xmit(struct sk
        err = xmit_skb(sq, skb);
  
        /* This should not happen! */
 -      if (unlikely(err) || unlikely(!virtqueue_kick(sq->vq))) {
 +      if (unlikely(err)) {
                dev->stats.tx_fifo_errors++;
                if (net_ratelimit())
                        dev_warn(&dev->dev,
                kfree_skb(skb);
                return NETDEV_TX_OK;
        }
 +      virtqueue_kick(sq->vq);
  
        /* Don't wait up for transmitted skbs to be freed. */
        skb_orphan(skb);
@@@ -938,7 -938,7 +938,7 @@@ static bool virtnet_send_command(struc
        sgs[out_num] = &stat;
  
        BUG_ON(out_num + 1 > ARRAY_SIZE(sgs));
-       BUG_ON(virtqueue_add_sgs(vi->cvq, sgs, out_num, 1, vi, GFP_ATOMIC) < 0);
+       virtqueue_add_sgs(vi->cvq, sgs, out_num, 1, vi, GFP_ATOMIC);
  
        if (unlikely(!virtqueue_kick(vi->cvq)))
                return status == VIRTIO_NET_OK;