1. 13 3月, 2013 3 次提交
  2. 21 1月, 2013 2 次提交
  3. 03 12月, 2012 2 次提交
  4. 23 2月, 2012 2 次提交
    • S
      firewire: net: use dev_printk API · 8408dc1c
      Stefan Richter 提交于
      Change the log line prefix from "firewire_net: " to "net firewire0: "
      etc. for the case that several RFC 2734 interfaces are being used in the
      same machine.
      
      Note, the netdev_printk API is not very useful to firewire-net.
      netdev_notice(net, "abc\n") would result in irritating messages like
      "firewire_ohci 0000:0a:00.0: firewire0: abc".  Nor would a dev_printk on
      the fw_unit.device to which firewire-net is being bound be useful,
      because there are generally multiple ones of those per interface (from
      all RFC 2734 peers on the bus, the local node being only one of them).
      
      In the initialization message of each interface, log the PCI device
      name of the card which is parent of the netdevice instead of the GUID
      of the peer which was semi-randomly used to establish the netdevice.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      8408dc1c
    • S
      firewire: net: identify to driver core as "firewire_net", not "net" · 59759ff6
      Stefan Richter 提交于
      On second thought, there is little reason to have driver name differ
      from module name.  Therefore, change
          /sys/bus/firewire/drivers/net
          /sys/bus/firewire/devices/fw0.0/driver -> [...]/net
          /sys/module/firewire_net/drivers/firewire:net
      to
          /sys/bus/firewire/drivers/firewire_net
          /sys/bus/firewire/devices/fw0.0/driver -> [...]/firewire_net
          /sys/module/firewire_net/drivers/firewire:firewire_net
      It is redundant but consistent with firewire-sbp2's recently changed
      driver name.
      
      I don't see this anywhere used, so it should not matter either way.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      59759ff6
  5. 09 10月, 2011 2 次提交
    • S
      firewire: net: Use posted writes · a74477db
      Stephan Gatzka 提交于
      Change memory region to ohci "middle address space". This effectively
      reduces the number of packets by 50%.
      
      [Stefan R.:]  This eliminates 1394 ack packets and improved throughput
      by a few percent in some tests with an S400a connection with and without
      gap count optimization.  Since firewire-net taxes the AR-req DMA unit of
      a FireWire controller much more than firewire-sbp2 (which uses the
      middle address space with PCI posted writes too), this commit also
      changes a related error printk into a ratelimited one as a precaution.
      
      Side note:  The IPv4-over-1394 drivers of Mac OS X 10.4, Windows XP SP3,
      and the Thesycon 1394 bus driver for Windows all use the middle address
      space too.
      Signed-off-by: NStephan Gatzka <stephan@gatzka.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a74477db
    • S
      firewire: use clamp and min3 macros · 4ec4a67a
      Stefan Richter 提交于
      Use kernel.h's convenience macros.  Also omit a printk that should never
      happen and won't matter much if it ever happened.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4ec4a67a
  6. 13 7月, 2011 1 次提交
  7. 02 6月, 2011 1 次提交
  8. 11 5月, 2011 1 次提交
    • C
      firewire: optimize iso queueing by setting wake only after the last packet · 13882a82
      Clemens Ladisch 提交于
      When queueing iso packets, the run time is dominated by the two
      MMIO accesses that set the DMA context's wake bit.  Because most
      drivers submit packets in batches, we can save much time by
      removing all but the last wakeup.
      
      The internal kernel API is changed to require a call to
      fw_iso_context_queue_flush() after a batch of queued packets.
      The user space API does not change, so one call to
      FW_CDEV_IOC_QUEUE_ISO must specify multiple packets to take
      advantage of this optimization.
      
      In my measurements, this patch reduces the time needed to queue
      fifty skip packets from userspace to one sixth on a 2.5 GHz CPU,
      or to one third at 800 MHz.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      13882a82
  9. 31 3月, 2011 1 次提交
  10. 21 1月, 2011 1 次提交
  11. 19 12月, 2010 2 次提交
    • S
      firewire: net: set carrier state at ifup · c1671470
      Stefan Richter 提交于
      At ifup, carrier status would be shown on even if it actually was off.
      Also add an include for ethtool_ops rather than to rely on the one from
      netdevice.h.
      
      Note, we can alas not use fwnet_device_mutex to serialize access to
      dev->peer_count (as I originally wanted).  This would cause a lock
      inversion:
        - fwnet_probe | takes fwnet_device_mutex
            + register_netdev | takes rtnl_mutex
        - devinet_ioctl | takes rtnl_mutex
            + fwnet_open | ...must not take fwnet_device_mutex
      
      Hence use the dev->lock spinlock for serialization.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      c1671470
    • M
      firewire: net: add carrier detection · 18bb36f9
      Maxim Levitsky 提交于
      To make userland, e.g. NetworkManager work with firewire, we need to
      detect whether cable is plugged or not.  Simple and correct way of doing
      that is just counting number of peers.  No peers - no link and vice
      versa.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      18bb36f9
  12. 14 12月, 2010 1 次提交
  13. 17 11月, 2010 4 次提交
    • S
      firewire: net: throttle TX queue before running out of tlabels · b2268830
      Stefan Richter 提交于
      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: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Tested-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      b2268830
    • S
      firewire: net: replace lists by counters · 48553011
      Stefan Richter 提交于
      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: NStefan Richter <stefanr@s5r6.in-berlin.de>
      48553011
    • S
      firewire: net: fix memory leaks · 7ee11fa8
      Stefan Richter 提交于
      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: NStefan Richter <stefanr@s5r6.in-berlin.de>
      7ee11fa8
    • S
  14. 20 8月, 2010 1 次提交
    • S
      firewire: net: fix unicast reception RCODE in failure paths · 1bf145fe
      Stefan Richter 提交于
      The incoming request hander fwnet_receive_packet() expects subsequent
      datagram handling code to return non-zero on errors.  However, almost
      none of the failure paths did so.  Fix them all.
      
      (This error reporting is used to send and RCODE_CONFLICT_ERROR to the
      sender node in such failure cases.  Two modes of failure exist:  Out of
      memory, or firewire-net is unaware of any peer node to which a fragment
      or an ARP packet belongs.  However, it is unclear whether a sender can
      actually make use of such information.  A Linux peer apparently can't.
      Maybe it should all be simplified to void functions.)
      Reported-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      1bf145fe
  15. 17 8月, 2010 1 次提交
  16. 21 6月, 2010 1 次提交
    • S
      firewire: remove an unused function argument · 33e553fe
      Stefan Richter 提交于
      void (*fw_address_callback_t)(..., int speed, ...) is the speed that a
      remote node chose to transmit a request to us.  In case of split
      transactions, firewire-core will transmit the response at that speed.
      
      Upper layer drivers on the other hand (firewire-net, -sbp2, firedtv, and
      userspace drivers) cannot do anything useful with that speed datum,
      except log it for debug purposes.  But data that is merely potentially
      (not even actually) used for debug purposes does not belong into the API.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      33e553fe
  17. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  18. 02 2月, 2010 1 次提交
    • S
      firewire: net: fix panic in fwnet_write_complete · 110f82d7
      Stefan Richter 提交于
      In the transmit path of firewire-net (IPv4 over 1394), the following
      race condition may occur:
        - The networking soft IRQ inserts a datagram into the 1394 async
          request transmit DMA.
        - The 1394 async transmit completion tasklet runs to finish cleaning
          up (unlink datagram from list of pending ones, release skb and
          outbound 1394 transaction object) --- before the networking soft IRQ
          had a chance to proceed and add the datagram to the list of pending
          datagrams.
      
      This caused a panic in the 1394 async transmit completion tasklet when
      it dereferenced unitialized list heads:
      http://bugzilla.kernel.org/show_bug.cgi?id=15077
      
      The fix is to add checks in the tx soft IRQ and in the tasklet to
      determine which of these two is the last referrer to the transaction
      object.  Then handle the cleanup of the object by the last referrer
      rather than assuming that the tasklet is always the last one.
      
      There is another similar race:  Between said tasklet and fwnet_close,
      i.e. at ifdown.  However, that race is much less likely to occur in
      practice and shall be fixed in a separate update.
      Reported-by: NИлья Басин <basinilya@gmail.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      110f82d7
  19. 03 9月, 2009 1 次提交
  20. 02 9月, 2009 1 次提交
  21. 01 9月, 2009 1 次提交
  22. 17 6月, 2009 2 次提交
    • S
      firewire: net: better FIFO address range check and rcodes · 00635b8e
      Stefan Richter 提交于
      The AR req handler should not check the generation; higher level code
      is the better place to handle bus generation changes.  The target node
      ID just needs to be checked for not being the "all nodes" address; in
      this case don't handle the request and don't respond.
      
      Use Address_Error and Type_Error rcodes as appropriate.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      00635b8e
    • S
      firewire: net: fix card driver reloading · b01b4bab
      Stefan Richter 提交于
      Fix some problems from "firewire: net: allow for unordered unit
      discovery":
        - fwnet_remove was missing a list_del, causing fwnet_probe to crash if
          called after fwnet_remove, e.g. if firewire-ohci was unloaded and
          reloaded.
        - fwnet_probe should set its new_netdev flag only if it actually
          allocated a net_device.
        - Use dev_set_drvdata and dev_get_drvdata instead of deprecated direct
          access to device.driver_data.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      b01b4bab
  23. 14 6月, 2009 6 次提交
    • S
      firewire: net: adjust net_device ops · 1337f853
      Stefan Richter 提交于
      The .ndo_tx_timeout callback is currently without function; delete it.
      Give .watchdog_timeo a proper time value; lower it to 2 seconds.
      
      Decrease the .tx_queue_len from 1000 (as in Ethernet card drivers) to 10
      because we have only 64 transaction labels available, and responders
      might have further limits of their AR req contexts.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      1337f853
    • S
      firewire: net: remove unused code · 156ce867
      Stefan Richter 提交于
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      156ce867
    • S
      firewire: net: allow for unordered unit discovery · 5a124d38
      Stefan Richter 提交于
      Decouple the creation and destruction of the net_device from the order
      of discovery and removal of nodes with RFC 2734 unit directories since
      there is no reliable order.  The net_device is now created when the
      first RFC 2734 unit on a card is discovered, and destroyed when the last
      RFC 2734 unit on a card went away.  This includes all remote units as
      well as the local unit, which is therefore tracked as a peer now too.
      
      Also, locking around the list of peers is slightly extended to guard
      against peer removal.  As a side effect, fwnet_peer.pdg_lock has become
      superfluous and is deleted.
      
      Peer data (max_rec, speed, node ID, generation) are updated more
      carefully.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      5a124d38
    • S
      firewire: net: style changes · f91e3bd8
      Stefan Richter 提交于
      Change names of types, variables, functions.
      Omit debug code.
      Use get_unaligned*, put_unaligned*.
      Annotate big endian data.
      Handle errors in __init.
      Change whitespace.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      f91e3bd8
    • S
      firewire: net: add Kconfig item, rename driver · b9530fd6
      Stefan Richter 提交于
      The driver is now called firewire-net.  It might implement the transport
      of other networking protocols in the future, notably IPv6 per RFC 3146.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      b9530fd6
    • J
      firewire: add IPv4 support · c76acec6
      Jay Fenlason 提交于
      Implement IPv4 over IEEE 1394 as per RFC 2734 for the newer firewire
      stack.  This feature has only been present in the older ieee1394 stack
      via the eth1394 driver.
      
      Still to do:
        - fix ipv4_priv and ipv4_node lifetime logic
        - fix determination of speeds and max payloads
        - fix bus reset handling
        - fix unaligned memory accesses
        - fix coding style
        - further testing/ improvement of fragment reassembly
        - perhaps multicast support
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (rebased, copyright note, changelog)
      c76acec6