1. 04 1月, 2010 1 次提交
    • A
      bonding: allow arp_ip_targets on separate vlans to use arp validation · 1f3c8804
      Andy Gospodarek 提交于
      This allows a bond device to specify an arp_ip_target as a host that is
      not on the same vlan as the base bond device and still use arp
      validation.  A configuration like this, now works:
      
      BONDING_OPTS="mode=active-backup arp_interval=1000 arp_ip_target=10.0.100.1 arp_validate=3"
      
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
          inet6 ::1/128 scope host
             valid_lft forever preferred_lft forever
      2: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
          link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff
      3: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
          link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff
      8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue
          link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff
          inet6 fe80::213:21ff:febe:33e9/64 scope link
             valid_lft forever preferred_lft forever
      9: bond0.100@bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue
          link/ether 00:13:21:be:33:e9 brd ff:ff:ff:ff:ff:ff
          inet 10.0.100.2/24 brd 10.0.100.255 scope global bond0.100
          inet6 fe80::213:21ff:febe:33e9/64 scope link
             valid_lft forever preferred_lft forever
      
      Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
      
      Bonding Mode: fault-tolerance (active-backup)
      Primary Slave: None
      Currently Active Slave: eth1
      MII Status: up
      MII Polling Interval (ms): 0
      Up Delay (ms): 0
      Down Delay (ms): 0
      ARP Polling Interval (ms): 1000
      ARP IP target/s (n.n.n.n form): 10.0.100.1
      
      Slave Interface: eth1
      MII Status: up
      Link Failure Count: 1
      Permanent HW addr: 00:40:05:30:ff:30
      
      Slave Interface: eth0
      MII Status: up
      Link Failure Count: 0
      Permanent HW addr: 00:13:21:be:33:e9
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f3c8804
  2. 24 12月, 2009 1 次提交
  3. 14 12月, 2009 1 次提交
    • E
      net: Fix userspace RTM_NEWLINK notifications. · d90a909e
      Eric W. Biederman 提交于
      I received some bug reports about userspace programs having problems
      because after RTM_NEWLINK was received they could not immediate access
      files under /proc/sys/net/ because they had not been registered yet.
      
      The original problem was trivially fixed by moving the userspace
      notification from rtnetlink_event() to the end of
      register_netdevice().
      
      When testing that change I discovered I was still getting RTM_NEWLINK
      events before I could access proc and I was also getting RTM_NEWLINK
      events after I was seeing RTM_DELLINK.  Things practically guaranteed
      to confuse userspace.
      
      After a little more investigation these extra notifications proved to
      be from the new notifiers NETDEV_POST_INIT and NETDEV_UNREGISTER_BATCH
      hitting the default case in rtnetlink_event, and triggering
      unnecessary RTM_NEWLINK messages.
      
      rtnetlink_event now explicitly handles NETDEV_UNREGISTER_BATCH and
      NETDEV_POST_INIT to avoid sending the incorrect userspace
      notifications.
      Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d90a909e
  4. 12 12月, 2009 1 次提交
    • K
      net: Handle NETREG_UNINITIALIZED devices correctly · e93737b0
      Krishna Kumar 提交于
      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: NKrishna Kumar <krkumar2@in.ibm.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e93737b0
  5. 04 12月, 2009 2 次提交
  6. 02 12月, 2009 2 次提交
  7. 30 11月, 2009 1 次提交
  8. 27 11月, 2009 1 次提交
  9. 26 11月, 2009 1 次提交
  10. 23 11月, 2009 1 次提交
  11. 21 11月, 2009 1 次提交
  12. 18 11月, 2009 4 次提交
    • O
      d9031024
    • E
      linkwatch: linkwatch_forget_dev() to speedup device dismantle · e014debe
      Eric Dumazet 提交于
      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: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e014debe
    • O
      net: introduce NETDEV_UNREGISTER_PERNET · 395264d5
      Octavian Purdila 提交于
      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: NOctavian Purdila <opurdila@ixiacom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      395264d5
    • E
      net: add dev_txq_stats_fold() helper · d83345ad
      Eric Dumazet 提交于
      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: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d83345ad
  13. 16 11月, 2009 3 次提交
  14. 14 11月, 2009 1 次提交
    • P
      net: allow to propagate errors through ->ndo_hard_start_xmit() · 572a9d7b
      Patrick McHardy 提交于
      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: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      572a9d7b
  15. 12 11月, 2009 1 次提交
  16. 04 11月, 2009 1 次提交
  17. 02 11月, 2009 3 次提交
  18. 30 10月, 2009 3 次提交
  19. 29 10月, 2009 1 次提交
  20. 28 10月, 2009 4 次提交
  21. 27 10月, 2009 1 次提交
    • E
      vlan: allow null VLAN ID to be used · 05423b24
      Eric Dumazet 提交于
      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: NGertjan Hofman <gertjan_hofman@yahoo.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05423b24
  22. 24 10月, 2009 1 次提交
  23. 21 10月, 2009 1 次提交
  24. 14 10月, 2009 1 次提交
  25. 08 10月, 2009 1 次提交
  26. 05 10月, 2009 1 次提交