1. 11 Dec, 2009 1 commit
    • Krishna Kumar's avatar
      net: Handle NETREG_UNINITIALIZED devices correctly · e93737b0
      Krishna Kumar authored
      
      
      Fix two problems:
      
      1. If unregister_netdevice_many() is called with both registered
         and unregistered devices, rollback_registered_many() bails out
         when it reaches the first unregistered device. The processing
         of the prior registered devices is unfinished, and the
         remaining devices are skipped, and possible registered netdev's
         are leaked/unregistered.
      
      2. System hangs or panics depending on how the devices are passed,
         since when netdev_run_todo() runs, some devices were not fully
         processed.
      
      Tested by passing intermingled unregistered and registered vlan
      devices to unregister_netdevice_many() as follows:
      	1. dev, fake_dev1, fake_dev2: hangs in run_todo
      	   ("unregister_netdevice: waiting for eth1.100 to become
      	    free. Usage count = 1")
      	2. fake_dev1, dev, fake_dev2: failure during de-registration
      	   and next registration, followed by a vlan driver Oops
      	   during subsequent registration.
      
      Confirmed that the patch fixes both cases.
      Signed-off-by: default avatarKrishna Kumar <krkumar2@in.ibm.com>
      Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e93737b0
  2. 03 Dec, 2009 2 commits
  3. 02 Dec, 2009 2 commits
  4. 30 Nov, 2009 1 commit
  5. 26 Nov, 2009 1 commit
  6. 25 Nov, 2009 1 commit
  7. 23 Nov, 2009 1 commit
  8. 20 Nov, 2009 1 commit
  9. 18 Nov, 2009 4 commits
    • Octavian Purdila's avatar
      d9031024
    • Eric Dumazet's avatar
      linkwatch: linkwatch_forget_dev() to speedup device dismantle · e014debe
      Eric Dumazet authored
      
      
      Herbert Xu a écrit :
      > On Tue, Nov 17, 2009 at 04:26:04AM -0800, David Miller wrote:
      >> Really, the link watch stuff is just due for a redesign.  I don't
      >> think a simple hack is going to cut it this time, sorry Eric :-)
      >
      > I have no objections against any redesigns, but since the only
      > caller of linkwatch_forget_dev runs in process context with the
      > RTNL, it could also legally emit those events.
      
      Thanks guys, here an updated version then, before linkwatch surgery ?
      
      In this version, I force the event to be sent synchronously.
      
      [PATCH net-next-2.6] linkwatch: linkwatch_forget_dev() to speedup device dismantle
      
      time ip link del eth3.103 ; time ip link del eth3.104 ; time ip link del eth3.105
      
      real	0m0.266s
      user	0m0.000s
      sys	0m0.001s
      
      real	0m0.770s
      user	0m0.000s
      sys	0m0.000s
      
      real	0m1.022s
      user	0m0.000s
      sys	0m0.000s
      
      One problem of current schem in vlan dismantle phase is the
      holding of device done by following chain :
      
      vlan_dev_stop() ->
      	netif_carrier_off(dev) ->
      		linkwatch_fire_event(dev) ->
      			dev_hold() ...
      
      And __linkwatch_run_queue() runs up to one second later...
      
      A generic fix to this problem is to add a linkwatch_forget_dev() method
      to unlink the device from the list of watched devices.
      
      dev->link_watch_next becomes dev->link_watch_list (and use a bit more memory),
      to be able to unlink device in O(1).
      
      After patch :
      time ip link del eth3.103 ; time ip link del eth3.104 ; time ip link del eth3.105
      
      real    0m0.024s
      user    0m0.000s
      sys     0m0.000s
      
      real    0m0.032s
      user    0m0.000s
      sys     0m0.001s
      
      real    0m0.033s
      user    0m0.000s
      sys     0m0.000s
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e014debe
    • Octavian Purdila's avatar
      net: introduce NETDEV_UNREGISTER_PERNET · 395264d5
      Octavian Purdila authored
      
      
      This new event is called once for each unique net namespace in batched
      unregister operations (with the argument set to a random device from
      that namespace) and once per device in non-batched unregister
      operations.
      
      It allows us to factorize some device unregister work such as clearing the
      routing cache.
      Signed-off-by: default avatarOctavian Purdila <opurdila@ixiacom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      395264d5
    • Eric Dumazet's avatar
      net: add dev_txq_stats_fold() helper · d83345ad
      Eric Dumazet authored
      
      
      Some drivers ndo_get_stats() method need to perform txqueue stats folding.
      
      Move folding from dev_get_stats() to a new dev_txq_stats_fold() function
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d83345ad
  10. 16 Nov, 2009 3 commits
  11. 13 Nov, 2009 1 commit
    • Patrick McHardy's avatar
      net: allow to propagate errors through ->ndo_hard_start_xmit() · 572a9d7b
      Patrick McHardy authored
      
      
      Currently the ->ndo_hard_start_xmit() callbacks are only permitted to return
      one of the NETDEV_TX codes. This prevents any kind of error propagation for
      virtual devices, like queue congestion of the underlying device in case of
      layered devices, or unreachability in case of tunnels.
      
      This patches changes the NET_XMIT codes to avoid clashes with the NETDEV_TX
      codes and changes the two callers of dev_hard_start_xmit() to expect either
      errno codes, NET_XMIT codes or NETDEV_TX codes as return value.
      
      In case of qdisc_restart(), all non NETDEV_TX codes are mapped to NETDEV_TX_OK
      since no error propagation is possible when using qdiscs. In case of
      dev_queue_xmit(), the error is propagated upwards.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      572a9d7b
  12. 12 Nov, 2009 1 commit
  13. 04 Nov, 2009 1 commit
  14. 02 Nov, 2009 3 commits
  15. 30 Oct, 2009 3 commits
  16. 29 Oct, 2009 1 commit
  17. 28 Oct, 2009 4 commits
  18. 27 Oct, 2009 1 commit
    • Eric Dumazet's avatar
      vlan: allow null VLAN ID to be used · 05423b24
      Eric Dumazet authored
      
      
      We currently use a 16 bit field (vlan_tci) to store VLAN ID/PRIO on a skb.
      
      Null value is used as a special value, meaning vlan tagging not enabled.
      This forbids use of null vlan ID.
      
      As pointed by David, some drivers use the 3 high order bits (PRIO)
      
      As VLAN ID is 12 bits, we can use the remaining bit (CFI) as a flag, and
      allow null VLAN ID.
      
      In case future code really wants to use VLAN_CFI_MASK, we'll have to use
      a bit outside of vlan_tci.
      
      #define VLAN_PRIO_MASK         0xe000 /* Priority Code Point */
      #define VLAN_PRIO_SHIFT        13
      #define VLAN_CFI_MASK          0x1000 /* Canonical Format Indicator */
      #define VLAN_TAG_PRESENT       VLAN_CFI_MASK
      #define VLAN_VID_MASK          0x0fff /* VLAN Identifier */
      Reported-by: default avatarGertjan Hofman <gertjan_hofman@yahoo.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05423b24
  19. 24 Oct, 2009 1 commit
  20. 21 Oct, 2009 1 commit
  21. 13 Oct, 2009 1 commit
  22. 08 Oct, 2009 1 commit
  23. 05 Oct, 2009 1 commit
  24. 30 Sep, 2009 1 commit
    • Eric Dumazet's avatar
      net: restore tx timestamping for accelerated vlans · 81bbb3d4
      Eric Dumazet authored
      Since commit 9b22ea56
      
      
      ( net: fix packet socket delivery in rx irq handler )
      
      We lost rx timestamping of packets received on accelerated vlans.
      
      Effect is that tcpdump on real dev can show strange timings, since it gets rx timestamps
      too late (ie at skb dequeueing time, not at skb queueing time)
      
      14:47:26.986871 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 1
      14:47:26.986786 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 1
      
      14:47:27.986888 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 2
      14:47:27.986781 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 2
      
      14:47:28.986896 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 3
      14:47:28.986780 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 3
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      81bbb3d4
  25. 15 Sep, 2009 1 commit
    • Moni Shoua's avatar
      bonding: remap muticast addresses without using dev_close() and dev_open() · 75c78500
      Moni Shoua authored
      This patch fixes commit e36b9d16
      
      . The approach
      there is to call dev_close()/dev_open() whenever the device type is changed in
      order to remap the device IP multicast addresses to HW multicast addresses.
      This approach suffers from 2 drawbacks:
      
      *. It assumes tha the device is UP when calling dev_close(), or otherwise
         dev_close() has no affect. It is worth to mention that initscripts (Redhat)
         and sysconfig (Suse) doesn't act the same in this matter. 
      *. dev_close() has other side affects, like deleting entries from the routing
         table, which might be unnecessary.
      
      The fix here is to directly remap the IP multicast addresses to HW multicast
      addresses for a bonding device that changes its type, and nothing else.
      Reported-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: default avatarMoni Shoua <monis@voltaire.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75c78500
  26. 11 Sep, 2009 1 commit