1. 30 3月, 2015 2 次提交
  2. 25 1月, 2015 1 次提交
  3. 29 10月, 2014 1 次提交
  4. 24 9月, 2014 1 次提交
  5. 03 8月, 2014 1 次提交
  6. 30 7月, 2014 2 次提交
  7. 28 3月, 2014 1 次提交
    • O
      usbnet: include wait queue head in device structure · 14a0d635
      Oliver Neukum 提交于
      This fixes a race which happens by freeing an object on the stack.
      Quoting Julius:
      > The issue is
      > that it calls usbnet_terminate_urbs() before that, which temporarily
      > installs a waitqueue in dev->wait in order to be able to wait on the
      > tasklet to run and finish up some queues. The waiting itself looks
      > okay, but the access to 'dev->wait' is totally unprotected and can
      > race arbitrarily. I think in this case usbnet_bh() managed to succeed
      > it's dev->wait check just before usbnet_terminate_urbs() sets it back
      > to NULL. The latter then finishes and the waitqueue_t structure on its
      > stack gets overwritten by other functions halfway through the
      > wake_up() call in usbnet_bh().
      
      The fix is to just not allocate the data structure on the stack.
      As dev->wait is abused as a flag it also takes a runtime PM change
      to fix this bug.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Reported-by: NGrant Grundler <grundler@google.com>
      Tested-by: NGrant Grundler <grundler@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      14a0d635
  8. 18 2月, 2014 1 次提交
    • E
      usbnet: remove generic hard_header_len check · eb85569f
      Emil Goode 提交于
      This patch removes a generic hard_header_len check from the usbnet
      module that is causing dropped packages under certain circumstances
      for devices that send rx packets that cross urb boundaries.
      
      One example is the AX88772B which occasionally send rx packets that
      cross urb boundaries where the remaining partial packet is sent with
      no hardware header. When the buffer with a partial packet is of less
      number of octets than the value of hard_header_len the buffer is
      discarded by the usbnet module.
      
      With AX88772B this can be reproduced by using ping with a packet
      size between 1965-1976.
      
      The bug has been reported here:
      
      https://bugzilla.kernel.org/show_bug.cgi?id=29082
      
      This patch introduces the following changes:
      - Removes the generic hard_header_len check in the rx_complete
        function in the usbnet module.
      - Introduces a ETH_HLEN check for skbs that are not cloned from
        within a rx_fixup callback.
      - For safety a hard_header_len check is added to each rx_fixup
        callback function that could be affected by this change.
        These extra checks could possibly be removed by someone
        who has the hardware to test.
      - Removes a call to dev_kfree_skb_any() and instead utilizes the
        dev->done list to queue skbs for cleanup.
      
      The changes place full responsibility on the rx_fixup callback
      functions that clone skbs to only pass valid skbs to the
      usbnet_skb_return function.
      Signed-off-by: NEmil Goode <emilgoode@gmail.com>
      Reported-by: NIgor Gnatenko <i.gnatenko.brain@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb85569f
  9. 14 1月, 2014 1 次提交
  10. 07 12月, 2013 1 次提交
  11. 14 11月, 2013 1 次提交
  12. 18 10月, 2013 1 次提交
  13. 29 9月, 2013 1 次提交
  14. 06 9月, 2013 1 次提交
  15. 13 8月, 2013 1 次提交
  16. 28 7月, 2013 2 次提交
    • M
      USBNET: increase max rx/tx qlen for improving USB3 thoughtput · 452c447a
      Ming Lei 提交于
      The default RX_QLEN()/TX_QLEN() didn't consider super speed
      USB device, so only max 4 URBs are scheduled at the same time
      for tx/rx, then USB3 NIC can't perform very well.
      
      With this patch, both rx and tx thoughput are increased more than
      100Mbps when doing iperf test on ax88179_178a USB 3.0 NIC.
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      452c447a
    • M
      USBNET: centralize computing of max rx/tx qlen · a88c32ae
      Ming Lei 提交于
      This patch centralizes computing of max rx/tx qlen, because:
      
      - RX_QLEN()/TX_QLEN() is called in hot path
      - computing depends on device's usb speed, now we have ls/fs, hs, ss,
      so more checks need to be involved
      - in fact, max rx/tx qlen should not only depend on device USB
      speed, but also depend on ethernet link speed, so we need to
      consider that in future.
      - if SG support is done, max tx qlen may need change too
      
      Generally, hard_mtu and rx_urb_size are changed in bind(), reset()
      and link_reset() callback, and change mtu network operation, this
      patches introduces the API of usbnet_update_max_qlen(), and calls
      it in above path.
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a88c32ae
  17. 16 5月, 2013 1 次提交
  18. 09 5月, 2013 1 次提交
    • D
      usbnet: allow status interrupt URB to always be active · 6eecdc5f
      Dan Williams 提交于
      Some drivers (sierra_net) need the status interrupt URB
      active even when the device is closed, because they receive
      custom indications from firmware.  Add functions to refcount
      the status interrupt URB submit/kill operation so that
      sub-drivers and the generic driver don't fight over whether
      the status interrupt URB is active or not.
      
      A sub-driver can call usbnet_status_start() at any time, but
      the URB is only submitted the first time the function is
      called.  Likewise, when the sub-driver is done with the URB,
      it calls usbnet_status_stop() but the URB is only killed when
      all users have stopped it.  The URB is still killed and
      re-submitted for suspend/resume, as before, with the same
      refcount it had at suspend.
      Signed-off-by: NDan Williams <dcbw@redhat.com>
      Acked-by: NOliver Neukum <oliver@neukum.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6eecdc5f
  19. 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
  20. 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
  21. 31 1月, 2013 1 次提交
  22. 22 1月, 2013 1 次提交
  23. 20 12月, 2012 2 次提交
  24. 10 11月, 2012 1 次提交
  25. 07 11月, 2012 2 次提交
  26. 26 10月, 2012 2 次提交
  27. 12 10月, 2012 1 次提交
  28. 06 9月, 2012 1 次提交
  29. 05 9月, 2012 1 次提交
  30. 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
  31. 01 9月, 2012 1 次提交