1. 28 5月, 2017 1 次提交
    • V
      bonding: Prevent duplicate userspace notification · 7a7e96e0
      Vlad Yasevich 提交于
      Whenever a user changes bonding options, a NETDEV_CHANGEINFODATA
      notificatin is generated which results in a rtnelink message to
      be sent.  While runnig 'ip monitor', we can actually see 2 messages,
      one a result of the event, and the other a result of state change
      that is generated bo netdev_state_change().  However, this is not
      always the case. If bonding changes were done via sysfs or ifenslave
      (old ioctl interface), then only 1 message is seen.
      
      This patch removes duplicate messages in the case of using netlink
      to configure bonding.  It introduceds a separte function that
      triggers a netdev event and uses that function in the syfs and ioctl
      cases.
      
      This was discovered while auditing all the different envents and
      continues the effort of cleaning up duplicated netlink messages.
      
      CC: David Ahern <dsa@cumulusnetworks.com>
      CC: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NVladislav Yasevich <vyasevic@redhat.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a7e96e0
  2. 02 3月, 2017 1 次提交
  3. 11 2月, 2016 1 次提交
  4. 09 2月, 2016 1 次提交
  5. 31 8月, 2015 1 次提交
  6. 27 7月, 2015 1 次提交
  7. 18 5月, 2015 1 次提交
    • N
      rtnl/bond: don't send rtnl msg for unregistered iface · ed2a80ab
      Nicolas Dichtel 提交于
      Before the patch, the command 'ip link add bond2 type bond mode 802.3ad'
      causes the kernel to send a rtnl message for the bond2 interface, with an
      ifindex 0.
      
      'ip monitor' shows:
      0: bond2: <BROADCAST,MULTICAST,MASTER> mtu 1500 state DOWN group default
          link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
      9: bond2@NONE: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default
          link/ether ea:3e:1f:53:92:7b brd ff:ff:ff:ff:ff:ff
      [snip]
      
      The patch fixes the spotted bug by checking in bond driver if the interface
      is registered before calling the notifier chain.
      It also adds a check in rtmsg_ifinfo() to prevent this kind of bug in the
      future.
      
      Fixes: d4261e56 ("bonding: create netlink event when bonding option is changed")
      CC: Jiri Pirko <jiri@resnulli.us>
      Reported-by: NJulien Meunier <julien.meunier@6wind.com>
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed2a80ab
  8. 11 5月, 2015 4 次提交
  9. 28 1月, 2015 1 次提交
  10. 13 1月, 2015 1 次提交
    • J
      bonding: cleanup bond_opts array · 7bfa0145
      Jonathan Toppins 提交于
      Remove the empty array element initializer and size the array with
      BOND_OPT_LAST so the compiler will complain if more elements are in
      there than should be.
      
      An interesting unwanted side effect of this initializer is that if one
      inserts new options into the middle of the array then this initializer
      will zero out the option that equals BOND_OPT_TLB_DYNAMIC_LB+1.
      
      Example:
      Extend the OPTS enum:
      enum {
         ...
         BOND_OPT_TLB_DYNAMIC_LB,
         BOND_OPT_LACP_NEW1,
         BOND_OPT_LAST
      };
      
      Now insert into bond_opts array:
      static const struct bond_option bond_opts[] = {
            ...
            [BOND_OPT_LACP_RATE] = { .... unchanged stuff .... },
            [BOND_OPT_LACP_NEW1] = { ... new stuff ... },
            ...
            [BOND_OPT_TLB_DYNAMIC_LB] = { .... unchanged stuff ....},
            { } // MARK A
      };
      
      Since BOND_OPT_LACP_NEW1 = BOND_OPT_TLB_DYNAMIC_LB+1, the last
      initializer (MARK A) will overwrite the contents of BOND_OPT_LACP_NEW1
      and can be easily viewed with the crash utility.
      Signed-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
      Cc: Nikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NAndy Gospodarek <gospo@cumulusnetworks.com>
      Acked-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7bfa0145
  11. 11 11月, 2014 1 次提交
  12. 14 9月, 2014 1 次提交
    • N
      bonding: clean curr_slave_lock use · 1c72cfdc
      Nikolay Aleksandrov 提交于
      Mostly all users of curr_slave_lock already have RTNL as we've discussed
      previously so there's no point in using it, the one case where the lock
      must stay is the 3ad code, in fact it's the only one.
      It's okay to remove it from bond_do_fail_over_mac() as it's called with
      RTNL and drops the curr_slave_lock anyway.
      bond_change_active_slave() is one of the main places where
      curr_slave_lock was used, it's okay to remove it as all callers use RTNL
      these days before calling it, that's why we move the ASSERT_RTNL() in
      the beginning to catch any potential offenders to this rule.
      The RTNL argument actually applies to all of the places where
      curr_slave_lock has been removed from in this patch.
      Also remove the unnecessary bond_deref_active_protected() macro and use
      rtnl_dereference() instead.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c72cfdc
  13. 10 9月, 2014 2 次提交
  14. 23 8月, 2014 1 次提交
  15. 16 7月, 2014 5 次提交
  16. 17 5月, 2014 4 次提交
  17. 16 5月, 2014 1 次提交
  18. 10 5月, 2014 1 次提交
    • N
      bonding: make a generic sysfs option store and fix comments · dc3e5d18
      Nikolay Aleksandrov 提交于
      Introduce a generic option store function for sysfs and remove the
      specific ones. The attribute name is used to match against the option
      which is to be set.
      Also adjust the "name" of tlb_dynamic_lb option to match the sysfs
      entry and fix the comments and comment style in bond_sysfs.c
      The comments which showed obvious behaviour (i.e. behaviour that's seen
      in the option's entry) are removed, the ones that explained important
      points about the setting function have been moved above the respective
      set function in bond_options.c
      
      There's only 1 exception: num_unsol_na/num_grat_arp since it has 2 names
      
      CC: Jay Vosburgh <j.vosburgh@gmail.com>
      CC: Veaceslav Falico <vfalico@gmail.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      CC: David S. Miller <davem@davemloft.net>
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc3e5d18
  19. 25 4月, 2014 2 次提交
    • M
      bonding: Add tlb_dynamic_lb parameter for tlb mode · e9f0fb88
      Mahesh Bandewar 提交于
      The aggresive load balancing causes packet re-ordering as active
      flows are moved from a slave to another within the group. Sometime
      this aggresive lb is not necessary if the preference is for less
      re-ordering. This parameter if used with value "0" disables
      this dynamic flow shuffling minimizing packet re-ordering. Of course
      the side effect is that it has to live with the static load balancing
      that the hashing distribution provides. This impact is less severe if
      the correct xmit-hashing-policy is used for the tlb setup.
      
      The default value of the parameter is set to "1" mimicing the earlier
      behavior.
      
      Ran the netperf test with 200 stream for 1 min between two hosts with
      4x1G trunk (xmit-lb mode with xmit-policy L3+4) before and after these
      changes. Following was the command used for those 200 instances -
      
          netperf -t TCP_RR -l 60 -s 5 -H <host> -- -r81920,81920
      
      Transactions per second:
          Before change: 1,367.11
          After  change: 1,470.65
      
      Change-Id: Ie3f75c77282cf602e83a6e833c6eb164e72a0990
      Signed-off-by: NMahesh Bandewar <maheshb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9f0fb88
    • M
      bonding: Added bond_tlb_xmit() for tlb mode. · f05b42ea
      Mahesh Bandewar 提交于
      Re-organized the xmit function for the lb mode separating tlb xmit
      from the alb mode. This will enable use of the hashing policies
      like 802.3ad mode. Also extended use of xmit-hash-policy to tlb mode.
      
      Now the tlb-mode defaults to BOND_XMIT_POLICY_LAYER2 if the xmit policy
      module parameter is not set (just like 802.3ad, or Xor mode).
      
      Change-Id: I140257403d272df75f477b380207338d0f04963e
      Signed-off-by: NMahesh Bandewar <maheshb@google.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f05b42ea
  20. 27 3月, 2014 1 次提交
  21. 07 3月, 2014 3 次提交
  22. 19 2月, 2014 3 次提交
  23. 17 2月, 2014 1 次提交
  24. 15 2月, 2014 1 次提交