1. 01 Nov, 2016 3 commits
  2. 31 Oct, 2016 9 commits
  3. 30 Oct, 2016 16 commits
    • Michael S. Tsirkin's avatar
      virtio_ring: mark vring_dma_dev inline · 75bfa81b
      Michael S. Tsirkin authored
      This inline function is unused on configurations
      where dma_map/unmap are empty macros.
      
      Make the function inline to avoid gcc errors because
      of an unused static function.
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      75bfa81b
    • Michael S. Tsirkin's avatar
      virtio/vhost: add Jason to list of maintainers · 678ff27d
      Michael S. Tsirkin authored
      Jason's been one of the mst active contributors
      to virtio and vhost, it will help to formalize this
      and list him as co-maintainer.
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      678ff27d
    • Markus Elfring's avatar
      virtio_blk: Delete an unnecessary initialisation in init_vq() · 2ff98449
      Markus Elfring authored
      The local variable "err" will be set to an appropriate value
      by a following statement.
      Thus omit the explicit initialisation at the beginning.
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      2ff98449
    • Markus Elfring's avatar
      virtio_blk: Use kmalloc_array() in init_vq() · 668866b6
      Markus Elfring authored
      Multiplications for the size determination of memory allocations
      indicated that array data structures should be processed.
      Thus use the corresponding function "kmalloc_array".
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      668866b6
    • Juergen Gross's avatar
      virtio: remove config.c · 3dae2c61
      Juergen Gross authored
      Remove unused file config.c
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      3dae2c61
    • Matt Redfearn's avatar
      virtio: console: Unlock vqs while freeing buffers · 34563769
      Matt Redfearn authored
      Commit c6017e79 ("virtio: console: add locks around buffer removal
      in port unplug path") added locking around the freeing of buffers in the
      vq. However, when free_buf() is called with can_sleep = true and rproc
      is enabled, it calls dma_free_coherent() directly, requiring interrupts
      to be enabled. Currently a WARNING is triggered due to the spin locking
      around free_buf, with a call stack like this:
      
      WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
      free_buf+0x1a8/0x288
      Call Trace:
      [<8040c538>] show_stack+0x74/0xc0
      [<80757240>] dump_stack+0xd0/0x110
      [<80430d98>] __warn+0xfc/0x130
      [<80430ee0>] warn_slowpath_null+0x2c/0x3c
      [<807e7c6c>] free_buf+0x1a8/0x288
      [<807ea590>] remove_port_data+0x50/0xac
      [<807ea6a0>] unplug_port+0xb4/0x1bc
      [<807ea858>] virtcons_remove+0xb0/0xfc
      [<807b6734>] virtio_dev_remove+0x58/0xc0
      [<807f918c>] __device_release_driver+0xac/0x134
      [<807f924c>] device_release_driver+0x38/0x50
      [<807f7edc>] bus_remove_device+0xfc/0x130
      [<807f4b74>] device_del+0x17c/0x21c
      [<807f4c38>] device_unregister+0x24/0x38
      [<807b6b50>] unregister_virtio_device+0x28/0x44
      
      Fix this by restructuring the loops to allow the locks to only be taken
      where it is necessary to protect the vqs, and release it while the
      buffer is being freed.
      
      Fixes: c6017e79 ("virtio: console: add locks around buffer removal in port unplug path")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMatt Redfearn <matt.redfearn@imgtec.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      34563769
    • Paolo Bonzini's avatar
      ringtest: poll for new buffers once before updating event index · 948a8ac2
      Paolo Bonzini authored
      Updating the event index has a memory barrier and causes more work
      on the other side to actually signal the event.  It is unnecessary
      if a new buffer has already appeared on the ring, so poll once before
      doing the update.
      
      The effect of this on the 0.9 ring implementation is pretty much
      invisible, but on the new-style ring it provides a consistent 3%
      performance improvement.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      948a8ac2
    • Paolo Bonzini's avatar
      ringtest: commonize implementation of poll_avail/poll_used · d3c3589b
      Paolo Bonzini authored
      Provide new primitives used_empty/avail_empty and
      build poll_avail/poll_used on top of it.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      d3c3589b
    • Paolo Bonzini's avatar
      ringtest: use link-time optimization · 44d65ea1
      Paolo Bonzini authored
      By using -flto and -fwhole-program, all functions from the ring implementation
      can be treated as static and possibly inlined.  Force this to happen through
      the GCC flatten attribute.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      44d65ea1
    • Konstantin Neumoin's avatar
      virtio: update balloon size in balloon "probe" · 8424af53
      Konstantin Neumoin authored
      The following commit 'fad7b7b2 (virtio_balloon: Use a workqueue
      instead of "vballoon" kthread)' has added a regression. Original code with
      kthread starts the thread inside probe and checks the necessity to update
      balloon inside the thread immediately.
      
      Nowadays the code behaves differently. Work is queued only on the first
      command from the host after the negotiation. Thus there is a window
      especially at the guest startup or the module reloading when the balloon
      size is not updated until the notification from the host.
      
      This patch adds balloon size check at the end of the probe to match
      original behaviour.
      Signed-off-by: default avatarKonstantin Neumoin <kneumoin@virtuozzo.com>
      Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      8424af53
    • Ladi Prosek's avatar
      virtio_ring: Make interrupt suppression spec compliant · 0ea1e4a6
      Ladi Prosek authored
      According to the spec, if the VIRTIO_RING_F_EVENT_IDX feature bit is
      negotiated the driver MUST set flags to 0. Not dirtying the available
      ring in virtqueue_disable_cb also has a minor positive performance
      impact, improving L1 dcache load missed by ~0.5% in vring_bench.
      
      Writes to the used event field (vring_used_event) are still unconditional.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: <stable@vger.kernel.org> # f277ec42 virtio_ring: shadow available
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarLadi Prosek <lprosek@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      0ea1e4a6
    • Will Deacon's avatar
      virtio_pci: Limit DMA mask to 44 bits for legacy virtio devices · a0be1db4
      Will Deacon authored
      Legacy virtio defines the virtqueue base using a 32-bit PFN field, with
      a read-only register indicating a fixed page size of 4k.
      
      This can cause problems for DMA allocators that allocate top down from
      the DMA mask, which is set to 64 bits. In this case, the addresses are
      silently truncated to 44-bit, leading to IOMMU faults, failure to read
      from the queue or data corruption.
      
      This patch restricts the coherent DMA mask for legacy PCI virtio devices
      to 44 bits, which matches the specification.
      
      Cc: stable@vger.kernel.org
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Benjamin Serebrin <serebrin@google.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      a0be1db4
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 2a26d99b
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Lots of fixes, mostly drivers as is usually the case.
      
         1) Don't treat zero DMA address as invalid in vmxnet3, from Alexey
            Khoroshilov.
      
         2) Fix element timeouts in netfilter's nft_dynset, from Anders K.
            Pedersen.
      
         3) Don't put aead_req crypto struct on the stack in mac80211, from
            Ard Biesheuvel.
      
         4) Several uninitialized variable warning fixes from Arnd Bergmann.
      
         5) Fix memory leak in cxgb4, from Colin Ian King.
      
         6) Fix bpf handling of VLAN header push/pop, from Daniel Borkmann.
      
         7) Several VRF semantic fixes from David Ahern.
      
         8) Set skb->protocol properly in ip6_tnl_xmit(), from Eli Cooper.
      
         9) Socket needs to be locked in udp_disconnect(), from Eric Dumazet.
      
        10) Div-by-zero on 32-bit fix in mlx4 driver, from Eugenia Emantayev.
      
        11) Fix stale link state during failover in NCSCI driver, from Gavin
            Shan.
      
        12) Fix netdev lower adjacency list traversal, from Ido Schimmel.
      
        13) Propvide proper handle when emitting notifications of filter
            deletes, from Jamal Hadi Salim.
      
        14) Memory leaks and big-endian issues in rtl8xxxu, from Jes Sorensen.
      
        15) Fix DESYNC_FACTOR handling in ipv6, from Jiri Bohac.
      
        16) Several routing offload fixes in mlxsw driver, from Jiri Pirko.
      
        17) Fix broadcast sync problem in TIPC, from Jon Paul Maloy.
      
        18) Validate chunk len before using it in SCTP, from Marcelo Ricardo
            Leitner.
      
        19) Revert a netns locking change that causes regressions, from Paul
            Moore.
      
        20) Add recursion limit to GRO handling, from Sabrina Dubroca.
      
        21) GFP_KERNEL in irq context fix in ibmvnic, from Thomas Falcon.
      
        22) Avoid accessing stale vxlan/geneve socket in data path, from
            Pravin Shelar"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (189 commits)
        geneve: avoid using stale geneve socket.
        vxlan: avoid using stale vxlan socket.
        qede: Fix out-of-bound fastpath memory access
        net: phy: dp83848: add dp83822 PHY support
        enic: fix rq disable
        tipc: fix broadcast link synchronization problem
        ibmvnic: Fix missing brackets in init_sub_crq_irqs
        ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context
        Revert "ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context"
        arch/powerpc: Update parameters for csum_tcpudp_magic & csum_tcpudp_nofold
        net/mlx4_en: Save slave ethtool stats command
        net/mlx4_en: Fix potential deadlock in port statistics flow
        net/mlx4: Fix firmware command timeout during interrupt test
        net/mlx4_core: Do not access comm channel if it has not yet been initialized
        net/mlx4_en: Fix panic during reboot
        net/mlx4_en: Process all completions in RX rings after port goes up
        net/mlx4_en: Resolve dividing by zero in 32-bit system
        net/mlx4_core: Change the default value of enable_qos
        net/mlx4_core: Avoid setting ports to auto when only one port type is supported
        net/mlx4_core: Fix the resource-type enum in res tracker to conform to FW spec
        ...
      2a26d99b
    • pravin shelar's avatar
      geneve: avoid using stale geneve socket. · fceb9c3e
      pravin shelar authored
      This patch is similar to earlier vxlan patch.
      Geneve device close operation frees geneve socket. This
      operation can race with geneve-xmit function which
      dereferences geneve socket. Following patch uses RCU
      mechanism to avoid this situation.
      Signed-off-by: default avatarPravin B Shelar <pshelar@ovn.org>
      Acked-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fceb9c3e
    • pravin shelar's avatar
      vxlan: avoid using stale vxlan socket. · c6fcc4fc
      pravin shelar authored
      When vxlan device is closed vxlan socket is freed. This
      operation can race with vxlan-xmit function which
      dereferences vxlan socket. Following patch uses RCU
      mechanism to avoid this situation.
      Signed-off-by: default avatarPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c6fcc4fc
    • Mintz, Yuval's avatar
      qede: Fix out-of-bound fastpath memory access · 087892d2
      Mintz, Yuval authored
      Driver allocates a shadow array for transmitted SKBs with X entries;
      That means valid indices are {0,...,X - 1}. [X == 8191]
      Problem is the driver also uses X as a mask for a
      producer/consumer in order to choose the right entry in the
      array which allows access to entry X which is out of bounds.
      
      To fix this, simply allocate X + 1 entries in the shadow array.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      087892d2
  4. 29 Oct, 2016 12 commits