1. 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
  2. 25 10月, 2007 2 次提交
  3. 24 10月, 2007 5 次提交
  4. 17 10月, 2007 1 次提交
  5. 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
  6. 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
  7. 14 8月, 2007 1 次提交
  8. 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
  9. 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
  10. 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
  11. 09 5月, 2007 1 次提交
  12. 29 4月, 2007 1 次提交
  13. 26 4月, 2007 3 次提交
  14. 06 3月, 2007 3 次提交
    • J
      bonding: Improve IGMP join processing · a816c7c7
      Jay Vosburgh 提交于
      	In active-backup mode, the current bonding code duplicates IGMP
      traffic to all slaves, so that switches are up to date in case of a
      failover from an active to a backup interface.  If bonding then fails
      back to the original active interface, it is likely that the "active
      slave" switch's IGMP forwarding for the port will be out of date until
      some event occurs to refresh the switch (e.g., a membership query).
      
      	This patch alters the behavior of bonding to no longer flood
      IGMP to all ports, and to issue IGMP JOINs to the newly active port at
      the time of a failover.  This insures that switches are kept up to date
      for all cases.
      
      	"GOELLESCH Niels" <niels.goellesch@eurocontrol.int> originally
      reported this problem, and included a patch.  His original patch was
      modified by Jay Vosburgh to additionally remove the existing IGMP flood
      behavior, use RCU, streamline code paths, fix trailing white space, and
      adjust for style.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a816c7c7
    • J
      bonding: only receive ARPs for us · e245cb71
      Jay Vosburgh 提交于
      	The ARP validation code only needs ARPs for the bonding device.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e245cb71
    • J
      bonding: fix double dev_add_pack · c4f283b1
      Jay Vosburgh 提交于
      	Bonding can erroneously register the same packet_type to receive
      ARPs (for use by ARP validation): once at device open time, and once via
      sysfs.  Since sysfs can change the validate setting (and thus register
      or unregister) at any time, a flag is needed to synchronize with device
      open in order to avoid double registrations, and the simplest place is
      within the packet_type structure itself.  Double unregister is not an
      issue.
      
      	Bug reported by Ulrich Oelmann <ulrich.oelmann@web.de>.
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c4f283b1
  15. 03 3月, 2007 1 次提交
  16. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  17. 13 2月, 2007 1 次提交