1. 18 6月, 2008 2 次提交
    • J
      bonding: Allow setting max_bonds to zero · b8a9787e
      Jay Vosburgh 提交于
      	Permit bonding to function rationally if max_bonds is set to
      zero.  This will load the module, but create no master devices (which can
      be created via sysfs).
      
      	Requires some change to bond_create_sysfs; currently, the
      netdev sysfs directory is determined from the first bonding device created,
      but this is no longer possible.  Instead, an interface from net/core is
      created to create and destroy files in net_class.
      
      	Based on a patch submitted by Phil Oester <kernel@linuxaces.com>.
      Modified by Jay Vosburgh to fix the sysfs issue mentioned above and to
      update the documentation.
      Signed-off-by: NPhil Oester <kernel@linuxace.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b8a9787e
    • O
      net/core: add NETDEV_BONDING_FAILOVER event · c1da4ac7
      Or Gerlitz 提交于
      Add NETDEV_BONDING_FAILOVER event to be used in a successive patch
      by bonding to announce fail-over for the active-backup mode through the
      netdev events notifier chain mechanism. Such an event can be of use for the
      RDMA CM (communication manager) to let native RDMA ULPs (eg NFS-RDMA, iSER)
      always be aligned with the IP stack, in the sense that they use the same
      ports/links as the stack does. More usages can be done to allow monitoring
      tools based on netlink events being aware to bonding fail-over.
      Signed-off-by: NOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      c1da4ac7
  2. 17 6月, 2008 1 次提交
    • B
      net: Fix test for VLAN TX checksum offload capability · 6de329e2
      Ben Hutchings 提交于
      Selected device feature bits can be propagated to VLAN devices, so we
      can make use of TX checksum offload and TSO on VLAN-tagged packets.
      However, if the physical device does not do VLAN tag insertion or
      generic checksum offload then the test for TX checksum offload in
      dev_queue_xmit() will see a protocol of htons(ETH_P_8021Q) and yield
      false.
      
      This splits the checksum offload test into two functions:
      
      - can_checksum_protocol() tests a given protocol against a feature bitmask
      
      - dev_can_checksum() first tests the skb protocol against the device
        features; if that fails and the protocol is htons(ETH_P_8021Q) then
        it tests the encapsulated protocol against the effective device
        features for VLANs
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6de329e2
  3. 12 6月, 2008 1 次提交
  4. 05 6月, 2008 1 次提交
  5. 04 6月, 2008 3 次提交
  6. 22 5月, 2008 1 次提交
  7. 21 5月, 2008 2 次提交
  8. 20 5月, 2008 1 次提交
  9. 15 5月, 2008 1 次提交
  10. 14 5月, 2008 1 次提交
  11. 13 5月, 2008 1 次提交
  12. 08 5月, 2008 2 次提交
    • B
      net: Added ASSERT_RTNL() to dev_open() and dev_close(). · e46b66bc
      Ben Hutchings 提交于
      dev_open() and dev_close() must be called holding the RTNL, since they
      call device functions and netdevice notifiers that are promised the RTNL.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e46b66bc
    • P
      netns: Fix arbitrary net_device-s corruptions on net_ns stop. · aca51397
      Pavel Emelyanov 提交于
      When a net namespace is destroyed, some devices (those, not killed
      on ns stop explicitly) are moved back to init_net.
      
      The problem, is that this net_ns change has one point of failure -
      the __dev_alloc_name() may be called if a name collision occurs (and
      this is easy to trigger). This allocator performs a likely-to-fail
      GFP_ATOMIC allocation to find a suitable number. Other possible 
      conditions that may cause error (for device being ns local or not
      registered) are always false in this case.
      
      So, when this call fails, the device is unregistered. But this is
      *not* the right thing to do, since after this the device may be
      released (and kfree-ed) improperly. E. g. bridges require more
      actions (sysfs update, timer disarming, etc.), some other devices 
      want to remove their private areas from lists, etc.
      
      I. e. arbitrary use-after-free cases may occur.
      
      The proposed fix is the following: since the only reason for the
      dev_change_net_namespace to fail is the name generation, we may
      give it a unique fall-back name w/o %d-s in it - the dev<ifindex>
      one, since ifindexes are still unique.
      
      So make this change, raise the failure-case printk loglevel to 
      EMERG and replace the unregister_netdevice call with BUG().
      
      [ Use snprintf() -DaveM ]
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aca51397
  13. 04 5月, 2008 1 次提交
  14. 03 5月, 2008 4 次提交
  15. 02 5月, 2008 1 次提交
  16. 29 4月, 2008 1 次提交
  17. 25 4月, 2008 1 次提交
    • M
      ethtool: EEPROM dump no longer works for tg3 and natsemi · c5835df9
      Mandeep Singh Baines 提交于
      In the ethtool user-space application, tg3 and natsemi over-ride the
      default implementation of dump_eeprom(). In both tg3_dump_eeprom() and
      natsemi_dump_eeprom(), there is a magic number check which is not
      present in the default implementation.
      
      Commit b131dd5d ("[ETHTOOL]: Add support for large eeproms") snipped
      the code which copied the ethtool_eeprom structure back to
      user-space. tg3 and natsemi are over-writing the magic number field
      and then checking it in user-space. With the ethtool_eeprom copy
      removed, the check is failing.
      
      The fix is simple. Add the ethtool_eeprom copy back.
      Signed-off-by: NMandeep Singh Baines <msb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5835df9
  18. 24 4月, 2008 1 次提交
    • P
      [RTNETLINK]: Fix bogus ASSERT_RTNL warning · c9c1014b
      Patrick McHardy 提交于
      ASSERT_RTNL uses mutex_trylock to test whether the rtnl_mutex is
      held. This bogus warnings when running in atomic context, which
      f.e. happens when adding secondary unicast addresses through
      macvlan or vlan or when synchronizing multicast addresses from
      wireless devices.
      
      Mid-term we might want to consider moving all address updates
      to process context since the locking seems overly complicated,
      for now just fix the bogus warning by changing ASSERT_RTNL to
      use mutex_is_locked().
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9c1014b
  19. 22 4月, 2008 2 次提交
  20. 21 4月, 2008 1 次提交
  21. 19 4月, 2008 2 次提交
  22. 16 4月, 2008 8 次提交
  23. 15 4月, 2008 1 次提交
    • P
      [NETNS]: The generic per-net pointers. · dec827d1
      Pavel Emelyanov 提交于
      Add the elastic array of void * pointer to the struct net.
      The access rules are simple:
      
       1. register the ops with register_pernet_gen_device to get
          the id of your private pointer
       2. call net_assign_generic() to put the private data on the
          struct net (most preferably this should be done in the
          ->init callback of the ops registered)
       3. do not store any private reference on the net_generic array;
       4. do not change this pointer while the net is alive;
       5. use the net_generic() to get the pointer.
      
      When adding a new pointer, I copy the old array, replace it
      with a new one and schedule the old for kfree after an RCU
      grace period.
      
      Since the net_generic explores the net->gen array inside rcu
      read section and once set the net->gen->ptr[x] pointer never 
      changes, this grants us a safe access to generic pointers.
      
      Quoting Paul: "... RCU is protecting -only- the net_generic 
      structure that net_generic() is traversing, and the [pointer]
      returned by net_generic() is protected by a reference counter 
      in the upper-level struct net."
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dec827d1