1. 26 10月, 2014 1 次提交
  2. 06 10月, 2014 1 次提交
  3. 26 8月, 2014 1 次提交
    • W
      xen-netback: move netif_napi_add before binding interrupt · e24f8191
      Wei Liu 提交于
      Interrupt is enabled when bind_interdomain_evtchn_to_irqhandler returns.
      If there's interrupt pending interrupt handler is invoked.
      
      NAPI needs to be initialised before binding interrupt otherwise the
      interrupt handler will try to scheduling a NAPI instance that is not
      initialised yet, resulting in kernel OOPS.
      
      This fixes a regression introduced in ea2c5e13 ("xen-netback: move NAPI
      add/remove calls").
      
      Ideally function calls to create kthreads should also be moved before
      binding but I intent to fix this regression with minimal changes and
      refactor the code with another patch.
      Reported-by: NThomas Leonard <talex5@gmail.com>
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e24f8191
  4. 14 8月, 2014 5 次提交
  5. 12 8月, 2014 1 次提交
  6. 08 8月, 2014 1 次提交
  7. 06 8月, 2014 2 次提交
    • Z
      xen-netback: Turn off the carrier if the guest is not able to receive · f34a4cf9
      Zoltan Kiss 提交于
      Currently when the guest is not able to receive more packets, qdisc layer starts
      a timer, and when it goes off, qdisc is started again to deliver a packet again.
      This is a very slow way to drain the queues, consumes unnecessary resources and
      slows down other guests shutdown.
      This patch change the behaviour by turning the carrier off when that timer
      fires, so all the packets are freed up which were stucked waiting for that vif.
      Instead of the rx_queue_purge bool it uses the VIF_STATUS_RX_PURGE_EVENT bit to
      signal the thread that either the timeout happened or an RX interrupt arrived,
      so the thread can check what it should do. It also disables NAPI, so the guest
      can't transmit, but leaves the interrupts on, so it can resurrect.
      Only the queues which brought down the interface can enable it again, the bit
      QUEUE_STATUS_RX_STALLED makes sure of that.
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: xen-devel@lists.xenproject.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f34a4cf9
    • Z
      xen-netback: Using a new state bit instead of carrier · 3d1af1df
      Zoltan Kiss 提交于
      This patch introduces a new state bit VIF_STATUS_CONNECTED to track whether the
      vif is in a connected state. Using carrier will not work with the next patch
      in this series, which aims to turn the carrier temporarily off if the guest
      doesn't seem to be able to receive packets.
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: xen-devel@lists.xenproject.org
      
      v2:
      - rename the bitshift type to "enum state_bit_shift" here, not in the next patch
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d1af1df
  8. 21 7月, 2014 4 次提交
  9. 16 7月, 2014 1 次提交
    • T
      net: set name_assign_type in alloc_netdev() · c835a677
      Tom Gundersen 提交于
      Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
      all users to pass NET_NAME_UNKNOWN.
      
      Coccinelle patch:
      
      @@
      expression sizeof_priv, name, setup, txqs, rxqs, count;
      @@
      
      (
      -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
      +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
      |
      -alloc_netdev_mq(sizeof_priv, name, setup, count)
      +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
      |
      -alloc_netdev(sizeof_priv, name, setup)
      +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
      )
      
      v9: move comments here from the wrong commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c835a677
  10. 09 7月, 2014 1 次提交
    • Z
      xen-netback: Adding debugfs "io_ring_qX" files · f51de243
      Zoltan Kiss 提交于
      This patch adds debugfs capabilities to netback. There used to be a similar
      patch floating around for classic kernel, but it used procfs. It is based on a
      very similar blkback patch.
      It creates xen-netback/[vifname]/io_ring_q[queueno] files, reading them output
      various ring variables etc. Writing "kick" into it imitates an interrupt
      happened, it can be useful to check whether the ring is just stalled due to a
      missed interrupt.
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: xen-devel@lists.xenproject.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f51de243
  11. 26 6月, 2014 1 次提交
    • W
      xen-netback: bookkeep number of active queues in our own module · f7b50c4e
      Wei Liu 提交于
      The original code uses netdev->real_num_tx_queues to bookkeep number of
      queues and invokes netif_set_real_num_tx_queues to set the number of
      queues. However, netif_set_real_num_tx_queues doesn't allow
      real_num_tx_queues to be smaller than 1, which means setting the number
      to 0 will not work and real_num_tx_queues is untouched.
      
      This is bogus when xenvif_free is invoked before any number of queues is
      allocated. That function needs to iterate through all queues to free
      resources. Using the wrong number of queues results in NULL pointer
      dereference.
      
      So we bookkeep the number of queues in xen-netback to solve this
      problem. This fixes a regression introduced by multiqueue patchset in
      3.16-rc1.
      
      There's another bug in original code that the real number of RX queues
      is never set. In current Xen multiqueue design, the number of TX queues
      and RX queues are in fact the same. We need to set the numbers of TX and
      RX queues to the same value.
      
      Also remove xenvif_select_queue and leave queue selection to core
      driver, as suggested by David Miller.
      Reported-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      CC: Ian Campbell <ian.campbell@citrix.com>
      CC: Paul Durrant <paul.durrant@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7b50c4e
  12. 12 6月, 2014 1 次提交
    • A
      net: xen-netback: include linux/vmalloc.h again · e7b599d7
      Arnd Bergmann 提交于
      commit e9ce7cb6 ("xen-netback: Factor queue-specific data into
      queue struct") added a use of vzalloc/vfree to interface.c, but
      removed the #include <linux/vmalloc.h> statement at the same time,
      which causes this build error:
      
      drivers/net/xen-netback/interface.c: In function 'xenvif_free':
      drivers/net/xen-netback/interface.c:754:2: error: implicit declaration of function 'vfree' [-Werror=implicit-function-declaration]
        vfree(vif->queues);
        ^
      cc1: some warnings being treated as errors
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Andrew J. Bennieston <andrew.bennieston@citrix.com>
      Acked-by: NWei Liu <wei.liu2@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7b599d7
  13. 06 6月, 2014 1 次提交
    • Z
      xen-netback: Fix handling of skbs requiring too many slots · 59ae9fc6
      Zoltan Kiss 提交于
      A recent commit (a02eb4 "xen-netback: worse-case estimate in xenvif_rx_action is
      underestimating") capped the slot estimation to MAX_SKB_FRAGS, but that triggers
      the next BUG_ON a few lines down, as the packet consumes more slots than
      estimated.
      This patch introduces full_coalesce on the skb callback buffer, which is used in
      start_new_rx_buffer() to decide whether netback needs coalescing more
      aggresively. By doing that, no packet should need more than
      (XEN_NETIF_MAX_TX_SIZE + 1) / PAGE_SIZE data slots (excluding the optional GSO
      slot, it doesn't carry data, therefore irrelevant in this case), as the provided
      buffers are fully utilized.
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Cc: Paul Durrant <paul.durrant@citrix.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Reviewed-by: NPaul Durrant <paul.durrant@gmail.com>
      Acked-by: NWei Liu <wei.liu2@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59ae9fc6
  14. 05 6月, 2014 3 次提交
  15. 17 5月, 2014 1 次提交
  16. 16 5月, 2014 1 次提交
    • Z
      xen-netback: Fix grant ref resolution in RX path · 58375744
      Zoltan Kiss 提交于
      The original series for reintroducing grant mapping for netback had a patch [1]
      to handle receiving of packets from an another VIF. Grant copy on the receiving
      side needs the grant ref of the page to set up the op.
      The original patch assumed (wrongly) that the frags array haven't changed. In
      the case reported by Sander, the sending guest sent a packet where the linear
      buffer and the first frag were under PKT_PROT_LEN (=128) bytes.
      xenvif_tx_submit() then pulled up the linear area to 128 bytes, and ditched the
      first frag. The receiving side had an off-by-one problem when gathered the grant
      refs.
      This patch fixes that by checking whether the actual frag's page pointer is the
      same as the page in the original frag list. It can handle any kind of changes on
      the original frags array, like:
      - removing granted frags from the array at any point
      - adding local pages to the frags list anywhere
      - reordering the frags
      It's optimized to the most common case, when there is 1:1 relation between the
      frags and the list, plus works optimal when frags are removed from the end or
      the beginning.
      
      [1]: 3e2234: xen-netback: Handle foreign mapped pages on the guest RX path
      Reported-by: NSander Eikelenboom <linux@eikelenboom.it>
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58375744
  17. 14 5月, 2014 1 次提交
  18. 04 4月, 2014 3 次提交
  19. 02 4月, 2014 1 次提交
    • W
      xen-netback: disable rogue vif in kthread context · e9d8b2c2
      Wei Liu 提交于
      When netback discovers frontend is sending malformed packet it will
      disables the interface which serves that frontend.
      
      However disabling a network interface involving taking a mutex which
      cannot be done in softirq context, so we need to defer this process to
      kthread context.
      
      This patch does the following:
      1. introduce a flag to indicate the interface is disabled.
      2. check that flag in TX path, don't do any work if it's true.
      3. check that flag in RX path, turn off that interface if it's true.
      
      The reason to disable it in RX path is because RX uses kthread. After
      this change the behavior of netback is still consistent -- it won't do
      any TX work for a rogue frontend, and the interface will be eventually
      turned off.
      
      Also change a "continue" to "break" after xenvif_fatal_tx_err, as it
      doesn't make sense to continue processing packets if frontend is rogue.
      
      This is a fix for XSA-90.
      Reported-by: NTörök Edwin <edwin@etorok.net>
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9d8b2c2
  20. 30 3月, 2014 3 次提交
  21. 27 3月, 2014 3 次提交
  22. 26 3月, 2014 2 次提交
  23. 13 3月, 2014 1 次提交