1. 12 4月, 2013 3 次提交
    • M
      usbnet: handle link change · 4b49f58f
      Ming Lei 提交于
      The link change is detected via the interrupt pipe, and bulk
      pipes are responsible for transfering packets, so it is reasonable
      to stop bulk transfer after link is reported as off.
      
      Two adavantages may be obtained with stopping bulk transfer
      after link becomes off:
      
      - USB bus bandwidth is saved(USB bus is shared bus except for
      USB3.0), for example, lots of 'IN' token packets and 'NYET'
      handshake packets is transfered on 2.0 bus.
      
      - probabaly power might be saved for usb host controller since
      cancelling bulk transfer may disable the asynchronous schedule of
      host controller.
      
      With this patch, when link becomes off, about ~10% performance
      boost can be found on bulk transfer of anther usb device which
      is attached to same bus with the usbnet device, see below
      test on next-20130410:
      
      - read from usb mass storage(Sandisk Extreme USB 3.0) on pandaboard
      with below command after unplugging ethernet cable:
      
      	dd if=/dev/sda iflag=direct of=/dev/null bs=1M count=800
      
      - without the patch
      1, 838860800 bytes (839 MB) copied, 36.2216 s, 23.2 MB/s
      2, 838860800 bytes (839 MB) copied, 35.8368 s, 23.4 MB/s
      3, 838860800 bytes (839 MB) copied, 35.823 s, 23.4 MB/s
      4, 838860800 bytes (839 MB) copied, 35.937 s, 23.3 MB/s
      5, 838860800 bytes (839 MB) copied, 35.7365 s, 23.5 MB/s
      average: 23.6MB/s
      
      - with the patch
      1, 838860800 bytes (839 MB) copied, 32.3817 s, 25.9 MB/s
      2, 838860800 bytes (839 MB) copied, 31.7389 s, 26.4 MB/s
      3, 838860800 bytes (839 MB) copied, 32.438 s, 25.9 MB/s
      4, 838860800 bytes (839 MB) copied, 32.5492 s, 25.8 MB/s
      5, 838860800 bytes (839 MB) copied, 31.6178 s, 26.5 MB/s
      average: 26.1MB/s
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b49f58f
    • M
      usbnet: apply usbnet_link_change · 0162c554
      Ming Lei 提交于
      Use usbnet_link_change to handle link change centrally.
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0162c554
    • M
      usbnet: introduce usbnet_link_change API · ac64995d
      Ming Lei 提交于
      This patch introduces the API of usbnet_link_change, so that
      usbnet can handle link change centrally, which may help to
      implement killing traffic URBs for saving USB bus bandwidth
      and host controller power.
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac64995d
  2. 05 2月, 2013 2 次提交
    • J
      drivers: net: usb: Remove unnecessary alloc/OOM messages · 38673c82
      Joe Perches 提交于
      alloc failures already get standardized OOM
      messages and a dump_stack.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38673c82
    • B
      net: usbnet: fix tx_dropped statistics · bf414b36
      Bjørn Mork 提交于
      It is normal for minidrivers accumulating frames to return NULL
      from their tx_fixup function. We do not want to count this as a
      drop, or log any debug messages.  A different exit path is
      therefore chosen for such drivers, skipping the debug message
      and the tx_dropped increment.
      
      The test for accumulating drivers was however completely bogus,
      making the exit path selection depend on whether the user had
      enabled tx_err logging or not. This would arbitrarily mess up
      accounting for both accumulating and non-accumulating minidrivers,
      and would result in unwanted debug messages for the accumulating
      drivers.
      
      Fix by testing for FLAG_MULTI_PACKET instead, which probably was
      the intention from the beginning.  This usage match the documented
      behaviour of this flag:
      
       Indicates to usbnet, that USB driver accumulates multiple IP packets.
       Affects statistic (counters) and short packet handling.
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf414b36
  3. 31 1月, 2013 1 次提交
  4. 22 1月, 2013 1 次提交
  5. 20 12月, 2012 2 次提交
  6. 10 11月, 2012 1 次提交
  7. 07 11月, 2012 2 次提交
  8. 26 10月, 2012 2 次提交
  9. 12 10月, 2012 1 次提交
  10. 06 9月, 2012 1 次提交
  11. 05 9月, 2012 1 次提交
  12. 04 9月, 2012 1 次提交
    • B
      net: usbnet: fix softirq storm on suspend · 85e87870
      Bjørn Mork 提交于
      Suspending an open usbnet device results in constant
      rescheduling of usbnet_bh.
      
      commit 65841fd5 "usbnet: handle remote wakeup asap"
      refactored the usbnet_bh code to allow sharing the
      urb allocate and submit code with usbnet_resume. In
      this process, a test for, and immediate return on,
      ENOLINK from rx_submit was unintentionally dropped.
      
      The rx queue will not grow if rx_submit fails,
      making usbnet_bh reschedule itself.  This results
      in a softirq storm if the error is persistent.
      rx_submit translates the usb_submit_urb error
      EHOSTUNREACH into ENOLINK, so this is an expected
      and persistent error for a suspended device. The
      old code tested for this condition and avoided
      rescheduling.  Putting this test back.
      
      Cc: <stable@vger.kernel.org> # v3.5
      Cc: Ming Lei <ming.lei@canonical.com>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85e87870
  13. 01 9月, 2012 1 次提交
  14. 17 7月, 2012 1 次提交
  15. 23 6月, 2012 3 次提交
  16. 18 6月, 2012 1 次提交
  17. 13 6月, 2012 3 次提交
  18. 16 5月, 2012 1 次提交
    • M
      usbnet: fix skb traversing races during unlink(v2) · 5b6e9bcd
      Ming Lei 提交于
      Commit 4231d47e(net/usbnet: avoid
      recursive locking in usbnet_stop()) fixes the recursive locking
      problem by releasing the skb queue lock before unlink, but may
      cause skb traversing races:
      	- after URB is unlinked and the queue lock is released,
      	the refered skb and skb->next may be moved to done queue,
      	even be released
      	- in skb_queue_walk_safe, the next skb is still obtained
      	by next pointer of the last skb
      	- so maybe trigger oops or other problems
      
      This patch extends the usage of entry->state to describe 'start_unlink'
      state, so always holding the queue(rx/tx) lock to change the state if
      the referd skb is in rx or tx queue because we need to know if the
      refered urb has been started unlinking in unlink_urbs.
      
      The other part of this patch is based on Huajun's patch:
      always traverse from head of the tx/rx queue to get skb which is
      to be unlinked but not been started unlinking.
      Signed-off-by: NHuajun Li <huajun.li.lee@gmail.com>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: Oliver Neukum <oneukum@suse.de>
      Cc: stable@kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b6e9bcd
  19. 03 5月, 2012 2 次提交
  20. 04 4月, 2012 1 次提交
  21. 23 3月, 2012 3 次提交
  22. 17 3月, 2012 1 次提交
  23. 16 3月, 2012 1 次提交
  24. 08 3月, 2012 1 次提交
    • S
      net/usbnet: avoid recursive locking in usbnet_stop() · 4231d47e
      Sebastian Siewior 提交于
      |kernel BUG at kernel/rtmutex.c:724!
      |[<c029599c>] (rt_spin_lock_slowlock+0x108/0x2bc) from [<c01c2330>] (defer_bh+0x1c/0xb4)
      |[<c01c2330>] (defer_bh+0x1c/0xb4) from [<c01c3afc>] (rx_complete+0x14c/0x194)
      |[<c01c3afc>] (rx_complete+0x14c/0x194) from [<c01cac88>] (usb_hcd_giveback_urb+0xa0/0xf0)
      |[<c01cac88>] (usb_hcd_giveback_urb+0xa0/0xf0) from [<c01e1ff4>] (musb_giveback+0x34/0x40)
      |[<c01e1ff4>] (musb_giveback+0x34/0x40) from [<c01e2b1c>] (musb_advance_schedule+0xb4/0x1c0)
      |[<c01e2b1c>] (musb_advance_schedule+0xb4/0x1c0) from [<c01e2ca8>] (musb_cleanup_urb.isra.9+0x80/0x8c)
      |[<c01e2ca8>] (musb_cleanup_urb.isra.9+0x80/0x8c) from [<c01e2ed0>] (musb_urb_dequeue+0xec/0x108)
      |[<c01e2ed0>] (musb_urb_dequeue+0xec/0x108) from [<c01cbb90>] (unlink1+0xbc/0xcc)
      |[<c01cbb90>] (unlink1+0xbc/0xcc) from [<c01cc2ec>] (usb_hcd_unlink_urb+0x54/0xa8)
      |[<c01cc2ec>] (usb_hcd_unlink_urb+0x54/0xa8) from [<c01c2a84>] (unlink_urbs.isra.17+0x2c/0x58)
      |[<c01c2a84>] (unlink_urbs.isra.17+0x2c/0x58) from [<c01c2b44>] (usbnet_terminate_urbs+0x94/0x10c)
      |[<c01c2b44>] (usbnet_terminate_urbs+0x94/0x10c) from [<c01c2d68>] (usbnet_stop+0x100/0x15c)
      |[<c01c2d68>] (usbnet_stop+0x100/0x15c) from [<c020f718>] (__dev_close_many+0x94/0xc8)
      
      defer_bh() takes the lock which is hold during unlink_urbs(). The safe
      walk suggest that the skb will be removed from the list and this is done
      by defer_bh() so it seems to be okay to drop the lock here.
      
      Cc: stable@kernel.org
      Reported-by: NAníbal Almeida Pinto <anibal.pinto@efacec.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: NOliver Neukum <oliver@neukum.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4231d47e
  25. 01 2月, 2012 1 次提交
  26. 08 11月, 2011 1 次提交
  27. 30 9月, 2011 1 次提交