1. 21 10月, 2010 3 次提交
  2. 17 10月, 2010 1 次提交
    • E
      r8169: use 50% less ram for RX ring · 6f0333b8
      Eric Dumazet 提交于
      Using standard skb allocations in r8169 leads to order-3 allocations (if
      PAGE_SIZE=4096), because NIC needs 16383 bytes, and skb overhead makes
      this bigger than 16384 -> 32768 bytes per "skb"
      
      Using kmalloc() permits to reduce memory requirements of one r8169 nic
      by 4Mbytes. (256 frames * 16Kbytes). This is fine since a hardware bug
      requires us to copy incoming frames, so we build real skb when doing
      this copy.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f0333b8
  3. 10 10月, 2010 2 次提交
  4. 16 9月, 2010 1 次提交
  5. 08 9月, 2010 1 次提交
  6. 06 9月, 2010 1 次提交
    • E
      r8169: fix rx checksum offload · adea1ac7
      Eric Dumazet 提交于
      While porting GRO to r8169, I found this driver has a bug in its rx
      path.
      
      All skbs given to network stack had their ip_summed set to
      CHECKSUM_NONE, while hardware said they had correct TCP/UDP checksums.
      
      The reason is driver sets skb->ip_summed on the original skb before the
      copy eventually done by copybreak. The fresh skb gets the ip_summed =
      CHECKSUM_NONE value, forcing network stack to recompute checksum, and
      preventing my GRO patch to work.
      
      Fix is to make the ip_summed setting after skb copy.
      
      Note : rx_copybreak current value is 16383, so all frames are copied...
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: NFrancois Romieu <romieu@fr.zoreil.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      adea1ac7
  7. 03 9月, 2010 1 次提交
  8. 31 7月, 2010 1 次提交
    • A
      PCI: change device runtime PM settings for probe and remove · f3ec4f87
      Alan Stern 提交于
      This patch (as1388) changes the way the PCI core handles runtime PM
      settings when probing or unbinding drivers.  Now the core will make
      sure the device is enabled for runtime PM, with a usage count >= 1,
      when a driver is probed.  It does the same when calling a driver's
      remove method.
      
      If the driver wants to use runtime PM, all it has to do is call
      pm_runtime_pu_noidle() near the end of its probe routine (to cancel
      the core's usage increment) and pm_runtime_get_noresume() near the
      start of its remove routine (to restore the usage count).  It does not
      need to mess around with setting the runtime state to enabled,
      disabled, active, or suspended.
      
      The patch updates e1000e and r8169, the only PCI drivers that already
      use the existing runtime PM interface.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f3ec4f87
  9. 12 7月, 2010 1 次提交
  10. 10 6月, 2010 1 次提交
  11. 07 6月, 2010 1 次提交
    • T
      r8169: fix random mdio_write failures · 024a07ba
      Timo Teräs 提交于
      Some configurations need delay between the "write completed" indication
      and new write to work reliably.
      
      Realtek driver seems to use longer delay when polling the "write complete"
      bit, so it waits long enough between writes with high probability (but
      could probably break too). This patch adds a new udelay to make sure we
      wait unconditionally some time after the write complete indication.
      
      This caused a regression with XID 18000000 boards when the board specific
      phy configuration writing many mdio registers was added in commit
      2e955856 (r8169: phy init for the 8169scd). Some of the configration
      mdio writes would almost always fail, and depending on failure might leave
      the PHY in non-working state.
      Signed-off-by: NTimo Teräs <timo.teras@iki.fi>
      Acked-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      024a07ba
  12. 31 5月, 2010 1 次提交
  13. 01 5月, 2010 1 次提交
  14. 27 4月, 2010 2 次提交
  15. 04 4月, 2010 1 次提交
    • J
      net: convert multicast list to list_head · 22bedad3
      Jiri Pirko 提交于
      Converts the list and the core manipulating with it to be the same as uc_list.
      
      +uses two functions for adding/removing mc address (normal and "global"
       variant) instead of a function parameter.
      +removes dev_mcast.c completely.
      +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
       manipulation with lists on a sandbox (used in bonding and 80211 drivers)
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22bedad3
  16. 02 4月, 2010 2 次提交
  17. 30 3月, 2010 1 次提交
    • N
      r8169: offical fix for CVE-2009-4537 (overlength frame DMAs) · c0cd884a
      Neil Horman 提交于
      Official patch to fix the r8169 frame length check error.
      
      Based on this initial thread:
      http://marc.info/?l=linux-netdev&m=126202972828626&w=1
      This is the official patch to fix the frame length problems in the r8169
      driver.  As noted in the previous thread, while this patch incurs a performance
      hit on the driver, its possible to improve performance dynamically by updating
      the mtu and rx_copybreak values at runtime to return performance to what it was
      for those NICS which are unaffected by the ideosyncracy (if there are any).
      
      Summary:
      
          A while back Eric submitted a patch for r8169 in which the proper
      allocated frame size was written to RXMaxSize to prevent the NIC from dmaing too
      much data.  This was done in commit fdd7b4c3.  A
      long time prior to that however, Francois posted
      126fa4b9, which expiclitly disabled the MaxSize
      setting due to the fact that the hardware behaved in odd ways when overlong
      frames were received on NIC's supported by this driver.  This was mentioned in a
      security conference recently:
      http://events.ccc.de/congress/2009/Fahrplan//events/3596.en.html
      
      It seems that if we can't enable frame size filtering, then, as Eric correctly
      noticed, we can find ourselves DMA-ing too much data to a buffer, causing
      corruption.  As a result is seems that we are forced to allocate a frame which
      is ready to handle a maximally sized receive.
      
      This obviously has performance issues with it, so to mitigate that issue, this
      patch does two things:
      
      1) Raises the copybreak value to the frame allocation size, which should force
      appropriately sized packets to get allocated on rx, rather than a full new 16k
      buffer.
      
      2) This patch only disables frame filtering initially (i.e., during the NIC
      open), changing the MTU results in ring buffer allocation of a size in relation
      to the new mtu (along with a warning indicating that this is dangerous).
      
      Because of item (2), individuals who can't cope with the performance hit (or can
      otherwise filter frames to prevent the bug), or who have hardware they are sure
      is unaffected by this issue, can manually lower the copybreak and reset the mtu
      such that performance is restored easily.
      Signed-off-by: NNeil Horman <nhorman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0cd884a
  18. 28 3月, 2010 1 次提交
    • F
      r8169: fix broken register writes · 78f1cd02
      Francois Romieu 提交于
      This is quite similar to b39fe41f
      though said registers are not even documented as 64-bit registers
      - as opposed to the initial TxDescStartAddress ones - but as single
      bytes which must be combined into 32 bits at the MMIO read/write
      level before being merged into a 64 bit logical entity.
      
      Credits go to Ben Hutchings <ben@decadent.org.uk> for the MAR
      registers (aka "multicast is broken for ages on ARM) and to
      Timo Teräs <timo.teras@iki.fi> for the MAC registers.
      Signed-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      78f1cd02
  19. 27 3月, 2010 1 次提交
  20. 17 3月, 2010 1 次提交
  21. 04 3月, 2010 1 次提交
  22. 26 2月, 2010 1 次提交
  23. 20 2月, 2010 1 次提交
    • R
      r8169: enable 64-bit DMA by default for PCI Express devices (v2) · 35317688
      Robert Hancock 提交于
      Currently use of 64-bit DMA is disabled in r8169 unless the user passes the
      use_dac module option. This is reasonable for conventional PCI devices where
      broken chipsets may not handle dual-address-cycle transfers properly for
      32-bit slots and so this may not be safe. However, PCI Express should not have
      this problem and not using 64-bit DMA results in DMA transfers needlessly using
      the IOMMU or SWIOTLB. Set the use_dac module parameter to a new default value of
      -1 which results in 64-bit DMA being enabled by default for PCI Express devices
      only.
      Signed-off-by: NRobert Hancock <hancockrwd@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35317688
  24. 13 2月, 2010 2 次提交
  25. 08 1月, 2010 1 次提交
  26. 30 12月, 2009 1 次提交
  27. 16 12月, 2009 1 次提交
  28. 04 12月, 2009 1 次提交
  29. 30 11月, 2009 1 次提交
  30. 26 11月, 2009 1 次提交
  31. 14 11月, 2009 1 次提交
    • R
      r8169: Fix receive buffer length when MTU is between 1515 and 1536 · 8812304c
      Raimonds Cicans 提交于
      In r8169 driver MTU is used to calculate receive buffer size.
      Receive buffer size is used to configure hardware incoming packet filter.
      
      For jumbo frames:
      Receive buffer size = Max frame size = MTU + 14 (ethernet header) + 4
      (vlan header) + 4 (ethernet checksum) = MTU + 22
      
      Bug:
      driver for all MTU up to 1536 use receive buffer size 1536
      
      As you can see from formula, this mean all IP packets > 1536 - 22
      (for vlan tagged, 1536 - 18 for not tagged) are dropped by hardware
      filter.
      
      Example:
      
      host_good>  ifconfig eth0 mtu 1536
      host_r8169> ifconfig eth0 mtu 1536
      host_good>  ping host_r8169
      Ok
      host_good>  ping -s 1500 host_r8169
      Fail
      host_good>  ifconfig eth0 mtu 7000
      host_r8169> ifconfig eth0 mtu 7000
      host_good>  ping -s 1500 host_r8169
      Ok
      
      Bonus: got rid of magic number 8
      Signed-off-by: NRaimonds Cicans <ray@apollo.lv>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8812304c
  32. 30 10月, 2009 1 次提交
  33. 24 10月, 2009 1 次提交
    • S
      r8169: fix Ethernet Hangup for RTL8110SC rev d · 05af2142
      Simon Wunderlich 提交于
      The 8110SC rev d chip on our board shows a regression which the 8110SB chip
      did not have. When inbound traffic is overflowing the receive descriptor queue,
      "holes" in the ring buffer may occur which lead to a hangup until the buffer
      is filled again. The packets are than completely processed, but the ring
      remains porous and no packets are processed until the next overflow. Setting
      the interface down and up can fix the problem temporary from userspace.
      
      For some reason we don't know, this behaviour is not occuring if the RxVlan
      bit for hardware VLAN untagging is set. There is another "Work around for
      AMD plateform" in the current code which checks the VLAN status
      word in receive descriptors, but does never come to effect when hardware
      VLAN support is enabled. We assume that this is a bug in the chip.
      
      The following patch fixes the problem. Without the patch we could reproduce
      the hang within minutes (given other devices also generating lots of
      interrupts), without we couldn't reproduce within a few days of long term
      testing.
      
      This version contains minor style adjustments and is sent with mutt which
      will hopefully not destroy the formatting again.
      Signed-off-by: NBernhard Schmidt <bernhard.schmidt@saxnet.de>
      Signed-off-by: NSimon Wunderlich <simon.wunderlich@saxnet.de>
      Acked-by: NFrancois Romieu <romieu@zoreil.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05af2142
  34. 14 10月, 2009 1 次提交