1. 29 1月, 2008 1 次提交
  2. 19 1月, 2008 5 次提交
  3. 08 12月, 2007 3 次提交
    • J
      bonding: Fix race at module unload · fdaea7a9
      Jay Vosburgh 提交于
      	Fixes a race condition in module unload.  Without this change,
      workqueue events may fire while bonding data structures are partially
      freed but before bond_close() is invoked by unregister_netdevice().
      
      	Update version to 3.2.3.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fdaea7a9
    • J
      bonding: Add new layer2+3 hash for xor/802.3ad modes · 6f6652be
      Jay Vosburgh 提交于
       	Add new hash for balance-xor and 802.3ad modes.  Originally
       submitted by "Glenn Griffin" <ggriffin.kernel@gmail.com>; modified by
       Jay Vosburgh to move setting of hash policy out of line, tweak the
       documentation update and add version update to 3.2.2.
      
      	Glenn's original comment follows:
      
      Included is a patch for a new xmit_hash_policy for the bonding driver
      that selects slaves based on MAC and IP information.  This is a middle
      ground between what currently exists in the layer2 only policy and the
      layer3+4 policy.  This policy strives to be fully 802.3ad compliant by
      transmitting every packet of any particular flow over the same link.
      As documented the layer3+4 policy is not fully compliant for extreme
      cases such as ip fragmentation, so this policy is a nice compromise
      for environments that require full compliance but desire more than the
      layer2 only policy.
      Signed-off-by: N"Glenn Griffin" <ggriffin.kernel@gmail.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6f6652be
    • D
      bonding: Fix time comparison · b63bb739
      David Sterba 提交于
      From: David Sterba <dsterba@suse.cz>
      
      Use macros for comparing jiffies. Jiffies' wrap caused missed events and hangs.
      Module reinsert was needed to make bonding work again.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b63bb739
  4. 14 11月, 2007 1 次提交
  5. 10 11月, 2007 1 次提交
    • J
      bonding: don't validate address at device open · 3a1521b7
      Jay Vosburgh 提交于
      The standard validate_addr handler refuses to accept the all zeroes address
      as valid.  However, it's common historical practice for the bonding
      master to be configured up prior to having any slaves, at which time the
      master will have a MAC address of all zeroes.
      
      Resolved by setting the dev->validate_addr to NULL.  The master still can't
      end up with an invalid address, as the set_mac_address function tests
      for validity.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3a1521b7
  6. 25 10月, 2007 2 次提交
  7. 24 10月, 2007 5 次提交
  8. 17 10月, 2007 1 次提交
  9. 16 10月, 2007 7 次提交
    • J
      net/bonding: Optionally allow ethernet slaves to keep own MAC · dd957c57
      Jay Vosburgh 提交于
      	Update the "don't change MAC of slaves" functionality added in
      previous changes to be a generic option, rather than something tied to
      IB devices, as it's occasionally useful for regular ethernet devices as
      well.
      
      	Adds "fail_over_mac" option (which is automatically enabled for IB
      slaves), applicable only to active-backup mode.
      
      	Includes documentation update.
      
      	Updates bonding driver version to 3.2.0.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      dd957c57
    • M
      net/bonding: Destroy bonding master when last slave is gone · d90a162a
      Moni Shoua 提交于
      When bonding enslaves non Ethernet devices it takes pointers to functions
      in the module that owns the slaves. In this case it becomes unsafe
      to keep the bonding master registered after last slave was unenslaved
      because we don't know if the pointers are still valid.  Destroying the bond when slave_cnt is zero
      ensures that these functions be used anymore.
      
      Signed-off-by: Moni Shoua <monis at voltaire.com>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d90a162a
    • M
      net/bonding: Delay sending of gratuitous ARP to avoid failure · 1053f62c
      Moni Shoua 提交于
      Delay sending a gratuitous_arp when LINK_STATE_LINKWATCH_PENDING bit
      in dev->state field is on. This improves the chances for the arp packet to
      be transmitted.
      
      Signed-off-by: Moni Shoua <monis at voltaire.com>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1053f62c
    • M
      net/bonding: Handlle wrong assumptions that slave is always an Ethernet device · 3158bf7d
      Moni Shoua 提交于
      bonding sometimes uses Ethernet constants (such as MTU and address length) which
      are not good when it enslaves non Ethernet devices (such as InfiniBand).
      
      Signed-off-by: Moni Shoua <monis at voltaire.com>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3158bf7d
    • M
      net/bonding: Enable IP multicast for bonding IPoIB devices · 6b1bf096
      Moni Shoua 提交于
      Allow to enslave devices when the bonding device is not up. Over the discussion
      held at the previous post this seemed to be the most clean way to go, where it
      is not expected to cause instabilities.
      
      Normally, the bonding driver is UP before any enslavement takes place.
      Once a netdevice is UP, the network stack acts to have it join some multicast groups
      (eg the all-hosts 224.0.0.1). Now, since ether_setup() have set the bonding device
      type to be ARPHRD_ETHER and address len to be ETHER_ALEN, the net core code
      computes a wrong multicast link address. This is b/c ip_eth_mc_map() is called
      where for multicast joins taking place after the enslavement another ip_xxx_mc_map()
      is called (eg ip_ib_mc_map() when the bond type is ARPHRD_INFINIBAND)
      
      Signed-off-by: Moni Shoua <monis at voltaire.com>
      Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6b1bf096
    • M
      net/bonding: Enable bonding to enslave netdevices not supporting set_mac_address() · 2ab82852
      Moni Shoua 提交于
      This patch allows for enslaving netdevices which do not support
      the set_mac_address() function. In that case the bond mac address is the one
      of the active slave, where remote peers are notified on the mac address
      (neighbour) change by Gratuitous ARP sent by bonding when fail-over occurs
      (this is already done by the bonding code).
      
      Signed-off-by: Moni Shoua <monis at voltaire.com>
      Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      2ab82852
    • M
      net/bonding: Enable bonding to enslave non ARPHRD_ETHER · 872254dd
      Moni Shoua 提交于
      This patch changes some of the bond netdevice attributes and functions
      to be that of the active slave for the case of the enslaved device not being
      of ARPHRD_ETHER type. Basically it overrides those setting done by ether_setup(),
      which are netdevice **type** dependent and hence might be not appropriate for
      devices of other types. It also enforces mutual exclusion on bonding slaves
      from dissimilar ether types, as was concluded over the v1 discussion.
      
      IPoIB (see Documentation/infiniband/ipoib.txt) MAC address is made of a 3 bytes
      IB QP (Queue Pair) number and 16 bytes IB port GID (Global ID) of the port this
      IPoIB device is bounded to. The QP is a resource created by the IB HW and the
      GID is an identifier burned into the HCA (i have omitted here some details which
      are not important for the bonding RFC).
      
      Signed-off-by: Moni Shoua <monis at voltaire.com>
      Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
      Acked-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      872254dd
  10. 11 10月, 2007 8 次提交
    • A
      endianness annotations drivers/net/bonding/ · d3bb52b0
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d3bb52b0
    • J
      [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF() · 0795af57
      Joe Perches 提交于
      This is nicer than the MAC_FMT stuff.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0795af57
    • J
      [ETHTOOL] Provide default behaviors for a few ethtool sub-ioctls · 88d3aafd
      Jeff Garzik 提交于
      For the operations
      	get-tx-csum
      	get-sg
      	get-tso
      	get-ufo
      the default ethtool_op_xxx behavior is fine for all drivers, so we
      permit op==NULL to imply the default behavior.
      
      This provides a more uniform behavior across all drivers, eliminating
      ethtool(8) "ioctl not supported" errors on older drivers that had
      not been updated for the latest sub-ioctls.
      
      The ethtool_op_xxx() functions are left exported, in case anyone
      wishes to call them directly from a driver-private implementation --
      a not-uncommon case.  Should an ethtool_op_xxx() helper remain unused
      for a while, except by net/core/ethtool.c, we can un-export it at a
      later date.
      
      [ Resolved conflicts with set/get value ethtool patch... -DaveM ]
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88d3aafd
    • R
      [NET]: Nuke SET_MODULE_OWNER macro. · 10d024c1
      Ralf Baechle 提交于
      It's been a useless no-op for long enough in 2.6 so I figured it's time to
      remove it.  The number of people that could object because they're
      maintaining unified 2.4 and 2.6 drivers is probably rather small.
      
      [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10d024c1
    • E
      [NET]: Make the device list and device lookups per namespace. · 881d966b
      Eric W. Biederman 提交于
      This patch makes most of the generic device layer network
      namespace safe.  This patch makes dev_base_head a
      network namespace variable, and then it picks up
      a few associated variables.  The functions:
      dev_getbyhwaddr
      dev_getfirsthwbytype
      dev_get_by_flags
      dev_get_by_name
      __dev_get_by_name
      dev_get_by_index
      __dev_get_by_index
      dev_ioctl
      dev_ethtool
      dev_load
      wireless_process_ioctl
      
      were modified to take a network namespace argument, and
      deal with it.
      
      vlan_ioctl_set and brioctl_set were modified so their
      hooks will receive a network namespace argument.
      
      So basically anthing in the core of the network stack that was
      affected to by the change of dev_base was modified to handle
      multiple network namespaces.  The rest of the network stack was
      simply modified to explicitly use &init_net the initial network
      namespace.  This can be fixed when those components of the network
      stack are modified to handle multiple network namespaces.
      
      For now the ifindex generator is left global.
      
      Fundametally ifindex numbers are per namespace, or else
      we will have corner case problems with migration when
      we get that far.
      
      At the same time there are assumptions in the network stack
      that the ifindex of a network device won't change.  Making
      the ifindex number global seems a good compromise until
      the network stack can cope with ifindex changes when
      you change namespaces, and the like.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      881d966b
    • E
      [NET]: Make device event notification network namespace safe · e9dc8653
      Eric W. Biederman 提交于
      Every user of the network device notifiers is either a protocol
      stack or a pseudo device.  If a protocol stack that does not have
      support for multiple network namespaces receives an event for a
      device that is not in the initial network namespace it quite possibly
      can get confused and do the wrong thing.
      
      To avoid problems until all of the protocol stacks are converted
      this patch modifies all netdev event handlers to ignore events on
      devices that are not in the initial network namespace.
      
      As the rest of the code is made network namespace aware these
      checks can be removed.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9dc8653
    • E
      [NET]: Make packet reception network namespace safe · e730c155
      Eric W. Biederman 提交于
      This patch modifies every packet receive function
      registered with dev_add_pack() to drop packets if they
      are not from the initial network namespace.
      
      This should ensure that the various network stacks do
      not receive packets in a anything but the initial network
      namespace until the code has been converted and is ready
      for them.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e730c155
    • E
      [NET]: Make /proc/net per network namespace · 457c4cbc
      Eric W. Biederman 提交于
      This patch makes /proc/net per network namespace.  It modifies the global
      variables proc_net and proc_net_stat to be per network namespace.
      The proc_net file helpers are modified to take a network namespace argument,
      and all of their callers are fixed to pass &init_net for that argument.
      This ensures that all of the /proc/net files are only visible and
      usable in the initial network namespace until the code behind them
      has been updated to be handle multiple network namespaces.
      
      Making /proc/net per namespace is necessary as at least some files
      in /proc/net depend upon the set of network devices which is per
      network namespace, and even more files in /proc/net have contents
      that are relevant to a single network namespace.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      457c4cbc
  11. 14 8月, 2007 1 次提交
  12. 01 8月, 2007 1 次提交
    • M
      [NET]: ethtool ops are the only way · 61a44b9c
      Matthew Wilcox 提交于
      During the transition to the ethtool_ops way of doing things, we supported
      calling the device's ->do_ioctl method to allow unconverted drivers to
      continue working.  Those days are long behind us, all in-tree drivers
      use the ethtool_ops way, and so we no longer need to support this.
      
      The bonding driver is the biggest beneficiary of this; it no longer
      needs to call ioctl() as a fallback if ethtool_ops aren't supported.
      
      Also put a proper copyright statement on ethtool.c.
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61a44b9c
  13. 11 7月, 2007 2 次提交
    • A
      bonding/bond_main.c: make 2 functions static · 4ad072c9
      Adrian Bunk 提交于
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Cc: Chad Tindel <ctindel@users.sourceforge.net>
      Cc: Jay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4ad072c9
    • J
      bonding / ipv6: no addrconf for slaves separately from master · c2edacf8
      Jay Vosburgh 提交于
      	At present, when a device is enslaved to bonding, if ipv6 is
      active then addrconf will be initated on the slave (because it is closed
      then opened during the enslavement processing).  This causes DAD and RS
      packets to be sent from the slave.  These packets in turn can confuse
      switches that perform ipv6 snooping, causing them to incorrectly update
      their forwarding tables (if, e.g., the slave being added is an inactve
      backup that won't be used right away) and direct traffic away from the
      active slave to a backup slave (where the incoming packets will be
      dropped).
      
      	This patch alters the behavior so that addrconf will only run on
      the master device itself.  I believe this is logically correct, as it
      prevents slaves from having an IPv6 identity independent from the
      master.  This is consistent with the IPv4 behavior for bonding.
      
      	This is accomplished by (a) having bonding set IFF_SLAVE sooner
      in the enslavement processing than currently occurs (before open, not
      after), and (b) having ipv6 addrconf ignore UP and CHANGE events on
      slave devices.
      
      	The eql driver also uses the IFF_SLAVE flag.  I inspected eql,
      and I believe this change is reasonable for its usage of IFF_SLAVE, but
      I did not test it.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c2edacf8
  14. 21 6月, 2007 1 次提交
    • J
      bonding: Fix use after free in unregister path · 3201e656
      Jay Vosburgh 提交于
      	The following patch (based on a patch from Stephen Hemminger
      <shemminger@linux-foundation.org>) removes use after free conditions in
      the unregister path for the bonding master.  Without this patch, an
      operation of the form "echo -bond0 > /sys/class/net/bonding_masters"
      would trigger a NULL pointer dereference in sysfs.  I was not able to
      induce the failure with the non-sysfs code path, but for consistency I
      updated that code as well.
      
      	I also did some testing of the bonding /proc file being open
      while the bond is being deleted, and didn't see any problems there.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3201e656
  15. 09 5月, 2007 1 次提交