1. 13 2月, 2013 2 次提交
    • P
      gianfar: convert u64 status counters to atomic64_t · 212079df
      Paul Gortmaker 提交于
      While looking at some asm dump for an unrelated change, Eric
      noticed in the following stats count increment code:
      
          50b8:       81 3c 01 f8     lwz     r9,504(r28)
          50bc:       81 5c 01 fc     lwz     r10,508(r28)
          50c0:       31 4a 00 01     addic   r10,r10,1
          50c4:       7d 29 01 94     addze   r9,r9
          50c8:       91 3c 01 f8     stw     r9,504(r28)
          50cc:       91 5c 01 fc     stw     r10,508(r28)
      
      that a 64 bit counter was used on ppc-32 without sync
      and hence the "ethtool -S" output was racy.
      
      Here we convert all the values to use atomic64_t so that
      the output will always be consistent.
      Reported-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      212079df
    • P
      gianfar: remove largely unused gfar_stats struct · 68719786
      Paul Gortmaker 提交于
      The gfar_stats struct is only used in copying out data
      via ethtool.  It is declared as the extra stats, followed
      by the rmon stats.  However, the rmon stats are never
      actually ever used in the driver; instead the rmon data
      is a u32 register read that is cast directly into the
      ethtool buf.
      
      It seems the only reason rmon is in the struct at all is
      to give the offset(s) at which it should be exported into
      the ethtool buffer.  But note gfar_stats doesn't contain
      a gfar_extra_stats as a substruct -- instead it contains
      a u64 array of equal element count.  This implicitly means
      we have two independent declarations of what gfar_extra_stats
      really is.  Rather than have this duality, we already have
      defines which give us the offset directly, and hence do not
      need the struct at all.
      
      Further, since we know the extra_stats is unconditionally
      always present, we can write it out to the ethtool buf
      1st, and then optionally write out the rmon data.  There
      is no need for two independent loops, both of which are
      simply copying out the extra_stats to buf offset zero.
      
      This also helps pave the way towards allowing the extra
      stats fields to be converted to atomic64_t values, without
      having their types directly influencing the ethtool stats
      export code (gfar_fill_stats) that expects to deal with u64.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      68719786
  2. 30 1月, 2013 2 次提交
  3. 12 1月, 2013 1 次提交
  4. 07 1月, 2013 1 次提交
  5. 07 10月, 2012 1 次提交
    • E
      net: remove skb recycling · acb600de
      Eric Dumazet 提交于
      Over time, skb recycling infrastructure got litle interest and
      many bugs. Generic rx path skb allocation is now using page
      fragments for efficient GRO / TCP coalescing, and recyling
      a tx skb for rx path is not worth the pain.
      
      Last identified bug is that fat skbs can be recycled
      and it can endup using high order pages after few iterations.
      
      With help from Maxime Bizon, who pointed out that commit
      87151b86 (net: allow pskb_expand_head() to get maximum tailroom)
      introduced this regression for recycled skbs.
      
      Instead of fixing this bug, lets remove skb recycling.
      
      Drivers wanting really hot skbs should use build_skb() anyway,
      to allocate/populate sk_buff right before netif_receive_skb()
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      acb600de
  6. 25 9月, 2012 1 次提交
    • C
      gianfar: Change default HW Tx queue scheduling mode · b98b8bab
      Claudiu Manoil 提交于
      This is primarily to address transmission timeout occurrences, when
      multiple H/W Tx queues are being used concurrently. Because in
      the priority scheduling mode the controller does not service the
      Tx queues equally (but in ascending index order), Tx timeouts are
      being triggered rightaway for a basic test with multiple simultaneous
      connections like:
      iperf -c <server_ip> -n 100M -P 8
      
      resulting in kernel trace:
      NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue <X> timed out
      ------------[ cut here ]------------
      WARNING: at net/sched/sch_generic.c:255
      ...
      and controller reset during intense traffic, and possibly further
      complications.
      
      This patch changes the default H/W Tx scheduling setting (TXSCHED)
      for multi-queue devices, from priority scheduling mode to a weighted
      round robin mode with equal weights for all H/W Tx queues, and
      addresses the issue above.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b98b8bab
  7. 04 4月, 2012 1 次提交
  8. 26 3月, 2012 1 次提交
  9. 16 3月, 2012 1 次提交
  10. 31 1月, 2012 1 次提交
  11. 13 1月, 2012 1 次提交
    • M
      gianfar: Fix invalid TX frames returned on error queue when time stamping · 9c4886e5
      Manfred Rudigier 提交于
      When TX time stamping for PTP messages is enabled on a socket, a time
      stamp is returned on the socket error queue to the user space application
      after the frame was transmitted. The transmitted frame is also returned on
      the error queue so that an application knows to which frame the time stamp
      belongs.
      
      In the current implementation the TxFCB is immediately followed by the
      frame. Since the eTSEC inserts the TX time stamp 8 bytes after the TxFCB,
      parts of the frame have been overwritten and an invalid frame was returned
      on the socket error queue.
      
      This patch fixes the described problem by adding additional 16 padding
      bytes between the TxFCB and the frame for all messages sent from a time
      stamping enabled socket (other sockets are not affected).
      Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c4886e5
  12. 17 11月, 2011 2 次提交
  13. 12 8月, 2011 1 次提交
    • J
      freescale: Move the Freescale drivers · ec21e2ec
      Jeff Kirsher 提交于
      Move the Freescale drivers into drivers/net/ethernet/freescale/ and
      make the necessary Kconfig and Makefile changes.
      
      CC: Sandeep Gopalpet <sandeep.kumar@freescale.com>
      CC: Andy Fleming <afleming@freescale.com>
      CC: Shlomi Gridish <gridish@freescale.com>
      CC: Li Yang <leoli@freescale.com>
      CC: Pantelis Antoniou <pantelis.antoniou@gmail.com>
      CC: Vitaly Bordug <vbordug@ru.mvista.com>
      CC: Dan Malek <dmalek@jlc.net>
      CC: Sylvain Munaut <tnt@246tNt.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ec21e2ec
  14. 22 7月, 2011 1 次提交
  15. 16 7月, 2011 1 次提交
  16. 07 7月, 2011 1 次提交
  17. 21 6月, 2011 1 次提交
    • S
      gianfar v5: implement nfc · 4aa3a715
      Sebastian Poehn 提交于
      This patch adds all missing functionalities for nfc except GRXFH. There is so much code because hardware has not a TCAM.
      Further hardware rule space is very limited. So I had to extensively use
      optimization features. Both reasons lead to the necessity to hold all
      online flows in a linked-list.
      
      Change-log:
      # Some suggestions by Joe Perches applied (thanks!)
      # Shorted some logs
      # Use memcmp() for comparing
      Signed-off-by: NSebastian Poehn <sebastian.poehn@belden.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4aa3a715
  18. 09 6月, 2011 1 次提交
  19. 16 4月, 2011 1 次提交
  20. 12 4月, 2011 1 次提交
  21. 31 3月, 2011 1 次提交
  22. 19 3月, 2011 1 次提交
  23. 14 1月, 2011 1 次提交
    • E
      net: remove dev_txq_stats_fold() · 1ac9ad13
      Eric Dumazet 提交于
      After recent changes, (percpu stats on vlan/tunnels...), we dont need
      anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
      
      Only remaining users are ixgbe, sch_teql, gianfar & macvlan :
      
      1) ixgbe can be converted to use existing tx_ring counters.
      
      2) macvlan incremented txq->tx_dropped, it can use the
      dev->stats.tx_dropped counter.
      
      3) sch_teql : almost revert ab35cd4b (Use net_device internal stats)
          Now we have ndo_get_stats64(), use it, even for "unsigned long"
      fields (No need to bring back a struct net_device_stats)
      
      4) gianfar adds a stats structure per tx queue to hold
      tx_bytes/tx_packets
      
      This removes a lockdep warning (and possible lockup) in rndis gadget,
      calling dev_get_stats() from hard IRQ context.
      
      Ref: http://www.spinics.net/lists/netdev/msg149202.htmlReported-by: NNeil Jones <neiljay@gmail.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      CC: Jarek Poplawski <jarkao2@gmail.com>
      CC: Alexander Duyck <alexander.h.duyck@intel.com>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Sandeep Gopalpet <sandeep.kumar@freescale.com>
      CC: Michal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ac9ad13
  24. 06 8月, 2010 1 次提交
  25. 01 7月, 2010 3 次提交
    • A
      gianfar: Implement workaround for eTSEC-A002 erratum · 511d934f
      Anton Vorontsov 提交于
      MPC8313ECE says:
      
      "If the controller receives a 1- or 2-byte frame (such as an illegal
       runt packet or a packet with RX_ER asserted) before GRS is asserted
       and does not receive any other frames, the controller may fail to set
       GRSC even when the receive logic is completely idle. Any subsequent
       receive frame that is larger than two bytes will reset the state so
       the graceful stop can complete. A MAC receiver (Rx) reset will also
       reset the state."
      
      This patch implements the proposed workaround:
      
      "If IEVENT[GRSC] is still not set after the timeout, read the eTSEC
       register at offset 0xD1C. If bits 7-14 are the same as bits 23-30,
       the eTSEC Rx is assumed to be idle and the Rx can be safely reset.
       If the register fields are not equal, wait for another timeout
       period and check again."
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      511d934f
    • A
      gianfar: Implement workaround for eTSEC76 erratum · deb90eac
      Anton Vorontsov 提交于
      MPC8313ECE says:
      
      "For TOE=1 huge or jumbo frames, the data required to generate the
       checksum may exceed the 2500-byte threshold beyond which the controller
       constrains itself to one memory fetch every 256 eTSEC system clocks.
      
       This throttling threshold is supposed to trigger only when the
       controller has sufficient data to keep transmit active for the duration
       of the memory fetches. The state machine handling this threshold,
       however, fails to take large TOE frames into account. As a result,
       TOE=1 frames larger than 2500 bytes often see excess delays before start
       of transmission."
      
      This patch implements the workaround as suggested by the errata
      document, i.e.:
      
      "Limit TOE=1 frames to less than 2500 bytes to avoid excess delays due to
       memory throttling.
       When using packets larger than 2700 bytes, it is recommended to turn TOE
       off."
      
      To be sure, we limit the TOE frames to 2500 bytes, and do software
      checksumming instead.
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      deb90eac
    • A
      gianfar: Implement workaround for eTSEC74 erratum · 7d350977
      Anton Vorontsov 提交于
      MPC8313ECE says:
      
      "If MACCFG2[Huge Frame]=0 and the Ethernet controller receives frames
       which are larger than MAXFRM, the controller truncates the frames to
       length MAXFRM and marks RxBD[TR]=1 to indicate the error. The controller
       also erroneously marks RxBD[TR]=1 if the received frame length is MAXFRM
       or MAXFRM-1, even though those frames are not truncated.
       No truncation or truncation error occurs if MACCFG2[Huge Frame]=1."
      
      There are two options to workaround the issue:
      
      "1. Set MACCFG2[Huge Frame]=1, so no truncation occurs for invalid large
       frames. Software can determine if a frame is larger than MAXFRM by
       reading RxBD[LG] or RxBD[Data Length].
      
       2. Set MAXFRM to 1538 (0x602) instead of the default 1536 (0x600), so
       normal-length frames are not marked as truncated. Software can examine
       RxBD[Data Length] to determine if the frame was larger than MAXFRM-2."
      
      This patch implements the first workaround option by setting HUGEFRAME
      bit, and gfar_clean_rx_ring() already checks the RxBD[Data Length].
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d350977
  26. 13 4月, 2010 2 次提交
    • M
      gianfar: Add hardware TX timestamping support · f0ee7acf
      Manfred Rudigier 提交于
      If a packet has the skb_shared_tx->hardware flag set the device is
      instructed to generate a TX timestamp and write it back to memory after
      the frame is transmitted. During the clean_tx_ring operation the
      timestamp will be extracted and copied into the skb_shared_hwtstamps
      struct of the skb.
      
      TX timestamping is enabled by setting the tx_type to something else
      than HWTSTAMP_TX_OFF with the SIOCSHWTSTAMP ioctl command. It is only
      supported by eTSEC devices.
      Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0ee7acf
    • M
      gianfar: Add hardware RX timestamping support · cc772ab7
      Manfred Rudigier 提交于
      The device is configured to insert hardware timestamps into all
      received packets. The RX timestamps are extracted from the padding
      alingment bytes during the clean_rx_ring operation and copied into the
      skb_shared_hwtstamps struct of the skb. This extraction only happens if
      the rx_filter was set to something else than HWTSTAMP_FILTER_NONE with
      the SIOCSHWTSTAMP ioctl command.
      
      Hardware timestamping is only supported for eTSEC devices. To indicate
      device support the new FSL_GIANFAR_DEV_HAS_TIMER flag was introduced.
      Signed-off-by: NManfred Rudigier <manfred.rudigier@omicron.at>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc772ab7
  27. 27 3月, 2010 1 次提交
  28. 19 12月, 2009 3 次提交
  29. 08 11月, 2009 1 次提交
    • A
      gianfar: Fix compiler and sparse warnings · 18294ad1
      Anton Vorontsov 提交于
      commit fba4ed03 ("gianfar: Add Multiple
      Queue Support") introduced the following warnings:
      
        CHECK   gianfar.c
      gianfar.c:333:8: warning: incorrect type in assignment (different address spaces)
      gianfar.c:333:8:    expected unsigned int [usertype] *baddr
      gianfar.c:333:8:    got unsigned int [noderef] <asn:2>*<noident>
      [... 67 lines skipped ...]
      gianfar.c:2565:3: warning: incorrect type in argument 1 (different type sizes)
      gianfar.c:2565:3:    expected unsigned long const *addr
      gianfar.c:2565:3:    got unsigned int *<noident>
        CC      gianfar.o
      gianfar.c: In function 'gfar_probe':
      gianfar.c:985: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:985: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:993: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:993: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c: In function 'gfar_configure_coalescing':
      gianfar.c:1680: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:1680: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:1688: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:1688: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c: In function 'gfar_poll':
      gianfar.c:2565: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:2565: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
      gianfar.c:2566: warning: passing argument 2 of 'test_bit' from incompatible pointer type
      gianfar.c:2585: warning: passing argument 2 of 'set_bit' from incompatible pointer type
      
      Following warnings left unfixed (looks like sparse doesn't like
      locks in loops, so __acquires/__releases() doesn't help):
      
      gianfar.c:441:40: warning: context imbalance in 'lock_rx_qs': wrong count at exit
      gianfar.c:441:40:    context '<noident>': wanted 0, got 1
      gianfar.c:449:40: warning: context imbalance in 'lock_tx_qs': wrong count at exit
      gianfar.c:449:40:    context '<noident>': wanted 0, got 1
      gianfar.c:458:3: warning: context imbalance in 'unlock_rx_qs': __context__ statement expected different context
      gianfar.c:458:3:    context '<noident>': wanted >= 0, got -1
      gianfar.c:466:3: warning: context imbalance in 'unlock_tx_qs': __context__ statement expected different context
      gianfar.c:466:3:    context '<noident>': wanted >= 0, got -1
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18294ad1
  30. 03 11月, 2009 3 次提交