1. 16 Nov, 2010 5 commits
    • Stefan Richter's avatar
      firewire: net: throttle TX queue before running out of tlabels · b2268830
      Stefan Richter authored
      This prevents firewire-net from submitting write requests in fast
      succession until failure due to all 64 transaction labels were used up
      for unfinished split transactions.  The netif_stop/wake_queue API is
      used for this purpose.
      
      Without this stop/wake mechanism, datagrams were simply lost whenever
      the tlabel pool was exhausted.  Plus, tlabel exhaustion by firewire-net
      also prevented other unrelated outbound transactions to be initiated.
      
      The chosen queue depth was checked by me to hit the maximum possible
      throughput with an OS X peer whose receive DMA is good enough to never
      reject requests due to busy inbound request FIFO.  Current Linux peers
      show a mixed picture of -5%...+15% change in bandwidth; their current
      bottleneck are RCODE_BUSY situations (fewer or more, depending on TX
      queue depth) due to too small AR buffer in firewire-ohci.
      
      Maxim Levitsky tested this change with similar watermarks with a Linux
      peer and some pending firewire-ohci improvements that address the
      RCODE_BUSY problem and confirmed that these TX queue limits are good.
      
      Note:  This removes some netif_wake_queue from reception code paths.
      They were apparently copy&paste artefacts from a nonsensical
      netif_wake_queue use in the older eth1394 driver.  This belongs only
      into the transmit path.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Tested-by: default avatarMaxim Levitsky <maximlevitsky@gmail.com>
      b2268830
    • Stefan Richter's avatar
      firewire: net: replace lists by counters · 48553011
      Stefan Richter authored
      The current transmit code does not at all make use of
        - fwnet_device.packet_list
      and only very limited use of
        - fwnet_device.broadcasted_list,
        - fwnet_device.queued_packets.
      Their current function is to track whether the TX soft-IRQ finished
      dealing with an skb when the AT-req tasklet takes over, and to discard
      pending tx datagrams (if there are any) when the local node is removed.
      
      The latter does actually contain a race condition bug with TX soft-IRQ
      and AT-req tasklet.
      
      Instead of these lists and the corresponding link in fwnet_packet_task,
        - a flag in fwnet_packet_task to track whether fwnet_tx is done,
        - a counter of queued datagrams in fwnet_device
      do the job as well.
      
      The above mentioned theoretic race condition is resolved by letting
      fwnet_remove sleep until all datagrams were flushed.  It may sleep
      almost arbitrarily long since fwnet_remove is executed in the context of
      a multithreaded (concurrency managed) workqueue.
      
      The type of max_payload is changed to u16 here to avoid waste in struct
      fwnet_packet_task.  This value cannot exceed 4096 per IEEE 1394:2008
      table 16-18 (or 32678 per specification of packet headers, if there is
      ever going to be something else than beta mode).
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      48553011
    • Stefan Richter's avatar
      firewire: net: fix memory leaks · 7ee11fa8
      Stefan Richter authored
      a) fwnet_transmit_packet_done used to poison ptask->pt_link by list_del.
      If fwnet_send_packet checked later whether it was responsible to clean
      up (in the border case that the TX soft IRQ was outpaced by the AT-req
      tasklet on another CPU), it missed this because ptask->pt_link was no
      longer shown as empty.
      
      b) If fwnet_write_complete got an rcode other than RCODE_COMPLETE, we
      missed to free the skb and ptask entirely.
      
      Also, count stats.tx_dropped and stats.tx_errors when rcode != 0.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      7ee11fa8
    • Stefan Richter's avatar
    • Linus Torvalds's avatar
      Linux 2.6.37-rc2 · e53beacd
      Linus Torvalds authored
      e53beacd
  2. 15 Nov, 2010 33 commits
  3. 14 Nov, 2010 2 commits