<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/bonding.h, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-09-28T01:15:21Z</updated>
<entry>
<title>bonding: quit messing with IOCTL</title>
<updated>2016-09-28T01:15:21Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2016-09-03T23:37:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ad41c1e2616a64c9e789d7069b1cb3402d2af3a'/>
<id>urn:sha1:4ad41c1e2616a64c9e789d7069b1cb3402d2af3a</id>
<content type='text'>
The only remaining users are issuing SIOCGMIIPHY and SIOCGMIIREG,
neither of which deals with userland pointers.  Simply calling
-&gt;ndo_do_ioctl() is fine; no messing with set_fs() is needed.
It used to mess with SIOCETHTOOL, which would've needed set_fs(),
but that has been killed in "[NET] ethtool ops are the only way"
9 years ago...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>bonding: prevent out of bound accesses</title>
<updated>2016-07-01T10:06:09Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2016-06-30T14:13:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f87fda00b6ed232a817c655b8d179b48bde8fdbe'/>
<id>urn:sha1:f87fda00b6ed232a817c655b8d179b48bde8fdbe</id>
<content type='text'>
ether_addr_equal_64bits() requires some care about its arguments,
namely that 8 bytes might be read, even if last 2 byte values are not
used.

KASan detected a violation with null_mac_addr and lacpdu_mcast_addr
in bond_3ad.c

Same problem with mac_bcast[] and mac_v6_allmcast[] in bond_alb.c :
Although the 8-byte alignment was there, KASan would detect out
of bound accesses.

Fixes: 815117adaf5b ("bonding: use ether_addr_equal_unaligned for bond addr compare")
Fixes: bb54e58929f3 ("bonding: Verify RX LACPDU has proper dest mac-addr")
Fixes: 885a136c52a8 ("bonding: use compare_ether_addr_64bits() in ALB")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Acked-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bonding: fix bond_get_stats()</title>
<updated>2016-03-19T03:14:15Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2016-03-18T00:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe30937b65354c7fec244caebbdaae68e28ca797'/>
<id>urn:sha1:fe30937b65354c7fec244caebbdaae68e28ca797</id>
<content type='text'>
bond_get_stats() can be called from rtnetlink (with RTNL held)
or from /proc/net/dev seq handler (with RCU held)

The logic added in commit 5f0c5f73e5ef ("bonding: make global bonding
stats more reliable") kind of assumed only one cpu could run there.

If multiple threads are reading /proc/net/dev, stats can be really
messed up after a while.

A second problem is that some fields are 32bit, so we need to properly
handle the wrap around problem.

Given that RTNL is not always held, we need to use
bond_for_each_slave_rcu().

Fixes: 5f0c5f73e5ef ("bonding: make global bonding stats more reliable")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Andy Gospodarek &lt;gospo@cumulusnetworks.com&gt;
Cc: Jay Vosburgh &lt;j.vosburgh@gmail.com&gt;
Cc: Veaceslav Falico &lt;vfalico@gmail.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bonding: implement lower state change propagation</title>
<updated>2015-12-03T16:49:27Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@mellanox.com</email>
</author>
<published>2015-12-03T11:12:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f7c7eb7f7af7f87e0fc150994785fd139576e43a'/>
<id>urn:sha1:f7c7eb7f7af7f87e0fc150994785fd139576e43a</id>
<content type='text'>
Let netdev notifier listeners know about link and slave state change.

Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bonding: allow notifications for bond_set_slave_link_state</title>
<updated>2015-12-03T16:49:27Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@mellanox.com</email>
</author>
<published>2015-12-03T11:12:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d397061ca2081d8a99e4bee5792122faa6aaf86'/>
<id>urn:sha1:5d397061ca2081d8a99e4bee5792122faa6aaf86</id>
<content type='text'>
Similar to state notifications.

We allow caller to indicate if the notification should happen now or later,
depending on if he holds rtnl mutex or not. Introduce bond_slave_link_notify
function (similar to bond_slave_state_notify) which is later on called
with rtnl mutex and goes over slaves and executes delayed notification.

Signed-off-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/bonding: Export bond_option_active_slave_get_rcu</title>
<updated>2015-08-30T22:08:50Z</updated>
<author>
<name>Matan Barak</name>
<email>matanb@mellanox.com</email>
</author>
<published>2015-07-30T15:33:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e999869548b9ab97b7dffa053ba2fee81c31d069'/>
<id>urn:sha1:e999869548b9ab97b7dffa053ba2fee81c31d069</id>
<content type='text'>
Some consumers of the netdev events API would like to know who is the
active slave when a NETDEV_CHANGEUPPER or NETDEV_BONDING_FAILOVER
events occur. For example, when managing RoCE GIDs, GIDs based on the
bond's ips should only be set on the port which corresponds to active
slave netdevice.

Signed-off-by: Matan Barak &lt;matanb@mellanox.com&gt;
Signed-off-by: Doug Ledford &lt;dledford@redhat.com&gt;
</content>
</entry>
<entry>
<title>bonding: Implement user key part of port_key in an AD system.</title>
<updated>2015-05-11T14:59:32Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2015-05-09T07:01:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d22a5fc0c32edcf5c3bb973ee8c9a2606ba500a8'/>
<id>urn:sha1:d22a5fc0c32edcf5c3bb973ee8c9a2606ba500a8</id>
<content type='text'>
The port key has three components - user-key, speed-part, and duplex-part.
The LSBit is for the duplex-part, next 5 bits are for the speed while the
remaining 10 bits are the user defined key bits. Get these 10 bits
from the user-space (through the SysFs interface) and use it to form the
admin port-key. Allowed range for the user-key is 0 - 1023 (10 bits). If
it is not provided then use zero for the user-key-bits (default).

It can set using following example code -

   # modprobe bonding mode=4
   # usr_port_key=$(( RANDOM &amp; 0x3FF ))
   # echo $usr_port_key &gt; /sys/class/net/bond0/bonding/ad_user_port_key
   # echo +eth1 &gt; /sys/class/net/bond0/bonding/slaves
   ...
   # ip link set bond0 up

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;nikolay@redhat.com&gt;
[jt: * fixed up style issues reported by checkpatch
     * fixed up context from change in ad_actor_sys_prio patch]
Signed-off-by: Jonathan Toppins &lt;jtoppins@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bonding: Allow userspace to set actors' macaddr in an AD-system.</title>
<updated>2015-05-11T14:59:32Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2015-05-09T07:01:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74514957552edd4661a4608618121f3c71d4e891'/>
<id>urn:sha1:74514957552edd4661a4608618121f3c71d4e891</id>
<content type='text'>
In an AD system, the communication between actor and partner is the
business between these two entities. In the current setup anyone on the
same L2 can "guess" the LACPDU contents and then possibly send the
spoofed LACPDUs and trick the partner causing connectivity issues for
the AD system. This patch allows to use a random mac-address obscuring
it's identity making it harder for someone in the L2 is do the same thing.

This patch allows user-space to choose the mac-address for the AD-system.
This mac-address can not be NULL or a Multicast. If the mac-address is set
from user-space; kernel will honor it and will not overwrite it. In the
absence (value from user space); the logic will default to using the
masters' mac as the mac-address for the AD-system.

It can be set using example code below -

   # modprobe bonding mode=4
   # sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
                    $(( (RANDOM &amp; 0xFE) | 0x02 )) \
                    $(( RANDOM &amp; 0xFF )) \
                    $(( RANDOM &amp; 0xFF )) \
                    $(( RANDOM &amp; 0xFF )) \
                    $(( RANDOM &amp; 0xFF )) \
                    $(( RANDOM &amp; 0xFF )))
   # echo $sys_mac_addr &gt; /sys/class/net/bond0/bonding/ad_actor_system
   # echo +eth1 &gt; /sys/class/net/bond0/bonding/slaves
   ...
   # ip link set bond0 up

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;nikolay@redhat.com&gt;
[jt: fixed up style issues reported by checkpatch]
Signed-off-by: Jonathan Toppins &lt;jtoppins@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bonding: Allow userspace to set actors' system_priority in AD system</title>
<updated>2015-05-11T14:59:31Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2015-05-09T07:01:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6791e4661c4bd3e9f193a84247f2c389578a4336'/>
<id>urn:sha1:6791e4661c4bd3e9f193a84247f2c389578a4336</id>
<content type='text'>
This patch allows user to randomize the system-priority in an ad-system.
The allowed range is 1 - 0xFFFF while default value is 0xFFFF. If user
does not specify this value, the system defaults to 0xFFFF, which is
what it was before this patch.

Following example code could set the value -
    # modprobe bonding mode=4
    # sys_prio=$(( 1 + RANDOM + RANDOM ))
    # echo $sys_prio &gt; /sys/class/net/bond0/bonding/ad_actor_sys_prio
    # echo +eth1 &gt; /sys/class/net/bond0/bonding/slaves
    ...
    # ip link set bond0 up

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;nikolay@redhat.com&gt;
[jt: * fixed up style issues reported by checkpatch
     * changed how the default value is set in bond_check_params(), this
       makes the default consistent between what gets set for a new bond
       and what the default is claimed to be in the bonding options.]
Signed-off-by: Jonathan Toppins &lt;jtoppins@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/bonding: Make DRV macros private</title>
<updated>2015-04-27T02:59:53Z</updated>
<author>
<name>Matan Barak</name>
<email>matanb@mellanox.com</email>
</author>
<published>2015-04-26T12:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73b5a6f2a7a1cb78ccdec3900afc8657e11bc6bf'/>
<id>urn:sha1:73b5a6f2a7a1cb78ccdec3900afc8657e11bc6bf</id>
<content type='text'>
The bonding modules currently defines four macros with
general names that pollute the global namespace:
DRV_VERSION
DRV_RELDATE
DRV_NAME
DRV_DESCRIPTION

Fixing that by defining a private bonding_priv.h
header files which includes those defines.

Signed-off-by: Matan Barak &lt;matanb@mellanox.com&gt;
Signed-off-by: Or Gerlitz &lt;ogerlitz@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
