<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/net/bonding/bond_main.c, branch v4.3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>flow_dissector: Add flags argument to skb_flow_dissector functions</title>
<updated>2015-09-01T22:06:22+00:00</updated>
<author>
<name>Tom Herbert</name>
<email>tom@herbertland.com</email>
</author>
<published>2015-09-01T16:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cd79a2382aa5dcefa6e21a7c59bb1bb19e53b74d'/>
<id>cd79a2382aa5dcefa6e21a7c59bb1bb19e53b74d</id>
<content type='text'>
The flags argument will allow control of the dissection process (for
instance whether to parse beyond L3).

Signed-off-by: Tom Herbert &lt;tom@herbertland.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The flags argument will allow control of the dissection process (for
instance whether to parse beyond L3).

Signed-off-by: Tom Herbert &lt;tom@herbertland.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-08-31T04:45:01+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-08-31T04:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=06fb4e701b17e93366542e4cc57047e411136af7'/>
<id>06fb4e701b17e93366542e4cc57047e411136af7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bonding: fix bond_poll_controller bh_enable warning</title>
<updated>2015-08-29T05:25:43+00:00</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>nikolay@cumulusnetworks.com</email>
</author>
<published>2015-08-28T22:05:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b0d4943eec9a42c7ba2065f6cfa949894204dd4a'/>
<id>b0d4943eec9a42c7ba2065f6cfa949894204dd4a</id>
<content type='text'>
The problem is rcu_read_unlock_bh() which triggers a warning when irqs are
disabled. ndo_poll_controller should run with irqs disabled always so we
can drop the rcu_read_lock_bh.

[   98.502922] bond0: making interface eth1 the new active one
[   98.503039] ------------[ cut here ]------------
[   98.503039] WARNING: CPU: 0 PID: 1744 at kernel/softirq.c:150 __local_bh_enable_ip+0x96/0xc0()
[   98.503039] Modules linked in: bonding(OE) rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache netconsole ppdev joydev parport_pc serio_raw parport i2c_piix4 video acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc virtio_net e1000 ata_generic pcnet32 mii virtio_pci virtio_ring virtio pata_acpi
[   98.503039] CPU: 0 PID: 1744 Comm: ifenslave Tainted: G           OE   4.2.0-rc7+ #56
[   98.503039] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[   98.503039]  0000000000000000 00000000e96ba230 ffff880020c236b8 ffffffff8183f105
[   98.503039]  0000000000000000 0000000000000000 ffff880020c236f8 ffffffff810a9496
[   98.503039]  ffff88002ea99e08 0000000000000200 ffffffffa02a8e06 ffff88002ea99e08
[   98.503039] Call Trace:
[   98.503039]  [&lt;ffffffff8183f105&gt;] dump_stack+0x4c/0x65
[   98.503039]  [&lt;ffffffff810a9496&gt;] warn_slowpath_common+0x86/0xc0
[   98.503039]  [&lt;ffffffffa02a8e06&gt;] ? bond_poll_controller+0x146/0x250 [bonding]
[   98.503039]  [&lt;ffffffff810a95ca&gt;] warn_slowpath_null+0x1a/0x20
[   98.503039]  [&lt;ffffffff810ae376&gt;] __local_bh_enable_ip+0x96/0xc0
[   98.503039]  [&lt;ffffffffa02a8e2f&gt;] bond_poll_controller+0x16f/0x250 [bonding]
[   98.503039]  [&lt;ffffffffa02a8cf3&gt;] ? bond_poll_controller+0x33/0x250 [bonding]
[   98.503039]  [&lt;ffffffff810feaed&gt;] ? trace_hardirqs_off+0xd/0x10
[   98.503039]  [&lt;ffffffff81848afb&gt;] ? _raw_spin_unlock_irqrestore+0x5b/0x60
[   98.503039]  [&lt;ffffffff816ec48e&gt;] netpoll_poll_dev+0x6e/0x350
[   98.503039]  [&lt;ffffffff816eb977&gt;] ? netpoll_start_xmit+0x137/0x1d0
[   98.503039]  [&lt;ffffffff816b2e8b&gt;] ? __alloc_skb+0x5b/0x210
[   98.503039]  [&lt;ffffffff816ec89d&gt;] netpoll_send_skb_on_dev+0x12d/0x2a0
[   98.503039]  [&lt;ffffffff816eccde&gt;] netpoll_send_udp+0x2ce/0x430
[   98.503039]  [&lt;ffffffffa0190850&gt;] write_msg+0xb0/0xf0 [netconsole]
[   98.503039]  [&lt;ffffffff81116b63&gt;] call_console_drivers.constprop.25+0x133/0x260
[   98.503039]  [&lt;ffffffff81117934&gt;] console_unlock+0x2f4/0x580
[   98.503039]  [&lt;ffffffff81117ea5&gt;] ? vprintk_emit+0x2e5/0x630
[   98.503039]  [&lt;ffffffff81117ee5&gt;] vprintk_emit+0x325/0x630
[   98.503039]  [&lt;ffffffff81118379&gt;] vprintk_default+0x29/0x40
[   98.503039]  [&lt;ffffffff8183de4f&gt;] printk+0x55/0x6b
[   98.503039]  [&lt;ffffffff816c754c&gt;] __netdev_printk+0x16c/0x260
[   98.503039]  [&lt;ffffffff816c7a12&gt;] netdev_info+0x62/0x80
[   98.503039]  [&lt;ffffffffa02ab464&gt;] bond_change_active_slave+0x134/0x6a0 [bonding]
[   98.503039]  [&lt;ffffffffa02aba95&gt;] bond_select_active_slave+0xc5/0x310 [bonding]
[   98.503039]  [&lt;ffffffffa02aeb78&gt;] bond_enslave+0x1088/0x10c0 [bonding]
[   98.503039]  [&lt;ffffffffa02af46b&gt;] bond_do_ioctl+0x37b/0x400 [bonding]
[   98.503039]  [&lt;ffffffff81101d8d&gt;] ? trace_hardirqs_on+0xd/0x10
[   98.503039]  [&lt;ffffffff816dc437&gt;] ? rtnl_lock+0x17/0x20
[   98.503039]  [&lt;ffffffff816e5fd1&gt;] dev_ifsioc+0x331/0x3e0
[   98.503039]  [&lt;ffffffff816e62dc&gt;] dev_ioctl+0xec/0x6c0
[   98.503039]  [&lt;ffffffff816a6c6a&gt;] sock_do_ioctl+0x4a/0x60
[   98.503039]  [&lt;ffffffff816a7300&gt;] sock_ioctl+0x1c0/0x250
[   98.503039]  [&lt;ffffffff81271bfe&gt;] do_vfs_ioctl+0x2ee/0x540
[   98.503039]  [&lt;ffffffff810fd943&gt;] ? up_read+0x23/0x40
[   98.503039]  [&lt;ffffffff81070993&gt;] ? __do_page_fault+0x1d3/0x420
[   98.503039]  [&lt;ffffffff8127e246&gt;] ? __fget_light+0x66/0x90
[   98.503039]  [&lt;ffffffff81271ec9&gt;] SyS_ioctl+0x79/0x90
[   98.503039]  [&lt;ffffffff8184936e&gt;] entry_SYSCALL_64_fastpath+0x12/0x76
[   98.503039] ---[ end trace 00cfa804b0670051 ]---

Fixes: 616f45416ca0 ("bonding: implement bond_poll_controller()")
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem is rcu_read_unlock_bh() which triggers a warning when irqs are
disabled. ndo_poll_controller should run with irqs disabled always so we
can drop the rcu_read_lock_bh.

[   98.502922] bond0: making interface eth1 the new active one
[   98.503039] ------------[ cut here ]------------
[   98.503039] WARNING: CPU: 0 PID: 1744 at kernel/softirq.c:150 __local_bh_enable_ip+0x96/0xc0()
[   98.503039] Modules linked in: bonding(OE) rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache netconsole ppdev joydev parport_pc serio_raw parport i2c_piix4 video acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc virtio_net e1000 ata_generic pcnet32 mii virtio_pci virtio_ring virtio pata_acpi
[   98.503039] CPU: 0 PID: 1744 Comm: ifenslave Tainted: G           OE   4.2.0-rc7+ #56
[   98.503039] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[   98.503039]  0000000000000000 00000000e96ba230 ffff880020c236b8 ffffffff8183f105
[   98.503039]  0000000000000000 0000000000000000 ffff880020c236f8 ffffffff810a9496
[   98.503039]  ffff88002ea99e08 0000000000000200 ffffffffa02a8e06 ffff88002ea99e08
[   98.503039] Call Trace:
[   98.503039]  [&lt;ffffffff8183f105&gt;] dump_stack+0x4c/0x65
[   98.503039]  [&lt;ffffffff810a9496&gt;] warn_slowpath_common+0x86/0xc0
[   98.503039]  [&lt;ffffffffa02a8e06&gt;] ? bond_poll_controller+0x146/0x250 [bonding]
[   98.503039]  [&lt;ffffffff810a95ca&gt;] warn_slowpath_null+0x1a/0x20
[   98.503039]  [&lt;ffffffff810ae376&gt;] __local_bh_enable_ip+0x96/0xc0
[   98.503039]  [&lt;ffffffffa02a8e2f&gt;] bond_poll_controller+0x16f/0x250 [bonding]
[   98.503039]  [&lt;ffffffffa02a8cf3&gt;] ? bond_poll_controller+0x33/0x250 [bonding]
[   98.503039]  [&lt;ffffffff810feaed&gt;] ? trace_hardirqs_off+0xd/0x10
[   98.503039]  [&lt;ffffffff81848afb&gt;] ? _raw_spin_unlock_irqrestore+0x5b/0x60
[   98.503039]  [&lt;ffffffff816ec48e&gt;] netpoll_poll_dev+0x6e/0x350
[   98.503039]  [&lt;ffffffff816eb977&gt;] ? netpoll_start_xmit+0x137/0x1d0
[   98.503039]  [&lt;ffffffff816b2e8b&gt;] ? __alloc_skb+0x5b/0x210
[   98.503039]  [&lt;ffffffff816ec89d&gt;] netpoll_send_skb_on_dev+0x12d/0x2a0
[   98.503039]  [&lt;ffffffff816eccde&gt;] netpoll_send_udp+0x2ce/0x430
[   98.503039]  [&lt;ffffffffa0190850&gt;] write_msg+0xb0/0xf0 [netconsole]
[   98.503039]  [&lt;ffffffff81116b63&gt;] call_console_drivers.constprop.25+0x133/0x260
[   98.503039]  [&lt;ffffffff81117934&gt;] console_unlock+0x2f4/0x580
[   98.503039]  [&lt;ffffffff81117ea5&gt;] ? vprintk_emit+0x2e5/0x630
[   98.503039]  [&lt;ffffffff81117ee5&gt;] vprintk_emit+0x325/0x630
[   98.503039]  [&lt;ffffffff81118379&gt;] vprintk_default+0x29/0x40
[   98.503039]  [&lt;ffffffff8183de4f&gt;] printk+0x55/0x6b
[   98.503039]  [&lt;ffffffff816c754c&gt;] __netdev_printk+0x16c/0x260
[   98.503039]  [&lt;ffffffff816c7a12&gt;] netdev_info+0x62/0x80
[   98.503039]  [&lt;ffffffffa02ab464&gt;] bond_change_active_slave+0x134/0x6a0 [bonding]
[   98.503039]  [&lt;ffffffffa02aba95&gt;] bond_select_active_slave+0xc5/0x310 [bonding]
[   98.503039]  [&lt;ffffffffa02aeb78&gt;] bond_enslave+0x1088/0x10c0 [bonding]
[   98.503039]  [&lt;ffffffffa02af46b&gt;] bond_do_ioctl+0x37b/0x400 [bonding]
[   98.503039]  [&lt;ffffffff81101d8d&gt;] ? trace_hardirqs_on+0xd/0x10
[   98.503039]  [&lt;ffffffff816dc437&gt;] ? rtnl_lock+0x17/0x20
[   98.503039]  [&lt;ffffffff816e5fd1&gt;] dev_ifsioc+0x331/0x3e0
[   98.503039]  [&lt;ffffffff816e62dc&gt;] dev_ioctl+0xec/0x6c0
[   98.503039]  [&lt;ffffffff816a6c6a&gt;] sock_do_ioctl+0x4a/0x60
[   98.503039]  [&lt;ffffffff816a7300&gt;] sock_ioctl+0x1c0/0x250
[   98.503039]  [&lt;ffffffff81271bfe&gt;] do_vfs_ioctl+0x2ee/0x540
[   98.503039]  [&lt;ffffffff810fd943&gt;] ? up_read+0x23/0x40
[   98.503039]  [&lt;ffffffff81070993&gt;] ? __do_page_fault+0x1d3/0x420
[   98.503039]  [&lt;ffffffff8127e246&gt;] ? __fget_light+0x66/0x90
[   98.503039]  [&lt;ffffffff81271ec9&gt;] SyS_ioctl+0x79/0x90
[   98.503039]  [&lt;ffffffff8184936e&gt;] entry_SYSCALL_64_fastpath+0x12/0x76
[   98.503039] ---[ end trace 00cfa804b0670051 ]---

Fixes: 616f45416ca0 ("bonding: implement bond_poll_controller()")
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: bonding: convert to using IFF_NO_QUEUE</title>
<updated>2015-08-18T18:55:06+00:00</updated>
<author>
<name>Phil Sutter</name>
<email>phil@nwl.cc</email>
</author>
<published>2015-08-18T08:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1e6f20ca6c90d06d8d7654009aa99f0eec76ea65'/>
<id>1e6f20ca6c90d06d8d7654009aa99f0eec76ea65</id>
<content type='text'>
Signed-off-by: Phil Sutter &lt;phil@nwl.cc&gt;
Cc: Jay Vosburgh &lt;j.vosburgh@gmail.com&gt;
Cc: Veaceslav Falico &lt;vfalico@gmail.com&gt;
Cc: Andy Gospodarek &lt;gospo@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Phil Sutter &lt;phil@nwl.cc&gt;
Cc: Jay Vosburgh &lt;j.vosburgh@gmail.com&gt;
Cc: Veaceslav Falico &lt;vfalico@gmail.com&gt;
Cc: Andy Gospodarek &lt;gospo@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-08-13T23:23:11+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-08-13T23:23:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=182ad468e70fc7e8ff2e5d64344c690beaa00ddd'/>
<id>182ad468e70fc7e8ff2e5d64344c690beaa00ddd</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/cavium/Kconfig

The cavium conflict was overlapping dependency
changes.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/ethernet/cavium/Kconfig

The cavium conflict was overlapping dependency
changes.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bonding: Gratuitous ARP gets dropped when first slave added</title>
<updated>2015-08-12T21:37:33+00:00</updated>
<author>
<name>Venkat Venkatsubra</name>
<email>venkat.x.venkatsubra@oracle.com</email>
</author>
<published>2015-08-11T14:57:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b02e3e948de6c11fded1821d89012e24d953da12'/>
<id>b02e3e948de6c11fded1821d89012e24d953da12</id>
<content type='text'>
When the first slave is added (such as during bootup) the first
gratuitous ARP gets dropped. We don't see this drop during a failover.
The packet gets dropped in qdisc (noop_enqueue).

The fix is to delay the sending of gratuitous ARPs till the bond dev's
carrier is present.

It can also be worked around by setting num_grat_arp to more than 1.

Signed-off-by: Venkat Venkatsubra &lt;venkat.x.venkatsubra@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the first slave is added (such as during bootup) the first
gratuitous ARP gets dropped. We don't see this drop during a failover.
The packet gets dropped in qdisc (noop_enqueue).

The fix is to delay the sending of gratuitous ARPs till the bond dev's
carrier is present.

It can also be worked around by setting num_grat_arp to more than 1.

Signed-off-by: Venkat Venkatsubra &lt;venkat.x.venkatsubra@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-07-23T07:41:16+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-07-23T07:41:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c5e40ee287db61a79af1746954ee03ebbf1ff8a3'/>
<id>c5e40ee287db61a79af1746954ee03ebbf1ff8a3</id>
<content type='text'>
Conflicts:
	net/bridge/br_mdb.c

br_mdb.c conflict was a function call being removed to fix a bug in
'net' but whose signature was changed in 'net-next'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	net/bridge/br_mdb.c

br_mdb.c conflict was a function call being removed to fix a bug in
'net' but whose signature was changed in 'net-next'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bonding: correct the MAC address for "follow" fail_over_mac policy</title>
<updated>2015-07-21T03:29:40+00:00</updated>
<author>
<name>dingtianhong</name>
<email>dingtianhong@huawei.com</email>
</author>
<published>2015-07-16T08:30:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a951bc1e6ba58f11df5ed5ddc41311e10f5fd20b'/>
<id>a951bc1e6ba58f11df5ed5ddc41311e10f5fd20b</id>
<content type='text'>
The "follow" fail_over_mac policy is useful for multiport devices that
either become confused or incur a performance penalty when multiple
ports are programmed with the same MAC address, but the same MAC
address still may happened by this steps for this policy:

1) echo +eth0 &gt; /sys/class/net/bond0/bonding/slaves
   bond0 has the same mac address with eth0, it is MAC1.

2) echo +eth1 &gt; /sys/class/net/bond0/bonding/slaves
   eth1 is backup, eth1 has MAC2.

3) ifconfig eth0 down
   eth1 became active slave, bond will swap MAC for eth0 and eth1,
   so eth1 has MAC1, and eth0 has MAC2.

4) ifconfig eth1 down
   there is no active slave, and eth1 still has MAC1, eth2 has MAC2.

5) ifconfig eth0 up
   the eth0 became active slave again, the bond set eth0 to MAC1.

Something wrong here, then if you set eth1 up, the eth0 and eth1 will have the same
MAC address, it will break this policy for ACTIVE_BACKUP mode.

This patch will fix this problem by finding the old active slave and
swap them MAC address before change active slave.

Signed-off-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
Tested-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "follow" fail_over_mac policy is useful for multiport devices that
either become confused or incur a performance penalty when multiple
ports are programmed with the same MAC address, but the same MAC
address still may happened by this steps for this policy:

1) echo +eth0 &gt; /sys/class/net/bond0/bonding/slaves
   bond0 has the same mac address with eth0, it is MAC1.

2) echo +eth1 &gt; /sys/class/net/bond0/bonding/slaves
   eth1 is backup, eth1 has MAC2.

3) ifconfig eth0 down
   eth1 became active slave, bond will swap MAC for eth0 and eth1,
   so eth1 has MAC1, and eth0 has MAC2.

4) ifconfig eth1 down
   there is no active slave, and eth1 still has MAC1, eth2 has MAC2.

5) ifconfig eth0 up
   the eth0 became active slave again, the bond set eth0 to MAC1.

Something wrong here, then if you set eth1 up, the eth0 and eth1 will have the same
MAC address, it will break this policy for ACTIVE_BACKUP mode.

This patch will fix this problem by finding the old active slave and
swap them MAC address before change active slave.

Signed-off-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
Tested-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bonding: correctly handle bonding type change on enslave failure</title>
<updated>2015-07-20T23:23:06+00:00</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>nikolay@cumulusnetworks.com</email>
</author>
<published>2015-07-15T20:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7d5cd2ce5292b45e555de776cb9e72975a07460d'/>
<id>7d5cd2ce5292b45e555de776cb9e72975a07460d</id>
<content type='text'>
If the bond is enslaving a device with different type it will be setup
by it, but if after being setup the enslave fails the bond doesn't
switch back its type and also keeps pointers to foreign structures that can
be long gone. Thus revert back any type changes if the enslave failed and
the bond had to change its type.
Example:
 Before patch:
$ echo lo &gt; bond0/bonding/slaves
-bash: echo: write error: Cannot assign requested address
$ ip l sh bond0
20: bond0: &lt;BROADCAST,MULTICAST,MASTER&gt; mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
    link/loopback 16:54:78:34:bd:41 brd 00:00:00:00:00:00
$ echo +eth1 &gt; bond0/bonding/slaves
$ ip l sh bond0
20: bond0: &lt;BROADCAST,MULTICAST&gt; mtu 1500 qdisc noop state DOWN mode
DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:47:69 brd ff:ff:ff:ff:ff:ff
(notice the MASTER flag is gone)

 After patch:
$ echo lo &gt; bond0/bonding/slaves
-bash: echo: write error: Cannot assign requested address
$ ip l sh bond0
21: bond0: &lt;BROADCAST,MULTICAST,MASTER&gt; mtu 1500 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 6e:66:94:f6:07:fc brd ff:ff:ff:ff:ff:ff
$ echo +eth1 &gt; bond0/bonding/slaves
$ ip l sh bond0
21: bond0: &lt;BROADCAST,MULTICAST,MASTER&gt; mtu 1500 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:47:69 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Fixes: e36b9d16c6a6 ("bonding: clean muticast addresses when device changes type")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the bond is enslaving a device with different type it will be setup
by it, but if after being setup the enslave fails the bond doesn't
switch back its type and also keeps pointers to foreign structures that can
be long gone. Thus revert back any type changes if the enslave failed and
the bond had to change its type.
Example:
 Before patch:
$ echo lo &gt; bond0/bonding/slaves
-bash: echo: write error: Cannot assign requested address
$ ip l sh bond0
20: bond0: &lt;BROADCAST,MULTICAST,MASTER&gt; mtu 1500 qdisc noop state DOWN
mode DEFAULT group default
    link/loopback 16:54:78:34:bd:41 brd 00:00:00:00:00:00
$ echo +eth1 &gt; bond0/bonding/slaves
$ ip l sh bond0
20: bond0: &lt;BROADCAST,MULTICAST&gt; mtu 1500 qdisc noop state DOWN mode
DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:47:69 brd ff:ff:ff:ff:ff:ff
(notice the MASTER flag is gone)

 After patch:
$ echo lo &gt; bond0/bonding/slaves
-bash: echo: write error: Cannot assign requested address
$ ip l sh bond0
21: bond0: &lt;BROADCAST,MULTICAST,MASTER&gt; mtu 1500 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 6e:66:94:f6:07:fc brd ff:ff:ff:ff:ff:ff
$ echo +eth1 &gt; bond0/bonding/slaves
$ ip l sh bond0
21: bond0: &lt;BROADCAST,MULTICAST,MASTER&gt; mtu 1500 qdisc noop state DOWN
mode DEFAULT group default qlen 1000
    link/ether 52:54:00:3f:47:69 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Fixes: e36b9d16c6a6 ("bonding: clean muticast addresses when device changes type")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bonding: fix destruction of bond with devices different from arphrd_ether</title>
<updated>2015-07-20T19:56:11+00:00</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>nikolay@cumulusnetworks.com</email>
</author>
<published>2015-07-15T19:52:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=06f6d1094aa0992432b1e2a0920b0ee86ccd83bf'/>
<id>06f6d1094aa0992432b1e2a0920b0ee86ccd83bf</id>
<content type='text'>
When the bonding is being unloaded and the netdevice notifier is
unregistered it executes NETDEV_UNREGISTER for each device which should
remove the bond's proc entry but if the device enslaved is not of
ARPHRD_ETHER type and is in front of the bonding, it may execute
bond_release_and_destroy() first which would release the last slave and
destroy the bond device leaving the proc entry and thus we will get the
following error (with dynamic debug on for bond_netdev_event to see the
events order):
[  908.963051] eql: event: 9
[  908.963052] eql: IFF_SLAVE
[  908.963054] eql: event: 2
[  908.963056] eql: IFF_SLAVE
[  908.963058] eql: event: 6
[  908.963059] eql: IFF_SLAVE
[  908.963110] bond0: Releasing active interface eql
[  908.976168] bond0: Destroying bond bond0
[  908.976266] bond0 (unregistering): Released all slaves
[  908.984097] ------------[ cut here ]------------
[  908.984107] WARNING: CPU: 0 PID: 1787 at fs/proc/generic.c:575
remove_proc_entry+0x112/0x160()
[  908.984110] remove_proc_entry: removing non-empty directory
'net/bonding', leaking at least 'bond0'
[  908.984111] Modules linked in: bonding(-) eql(O) 9p nfsd auth_rpcgss
oid_registry nfs_acl nfs lockd grace fscache sunrpc crct10dif_pclmul
crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev qxl drm_kms_helper
snd_hda_codec_generic aesni_intel ttm aes_x86_64 glue_helper pcspkr lrw
gf128mul ablk_helper cryptd snd_hda_intel virtio_console snd_hda_codec
psmouse serio_raw snd_hwdep snd_hda_core 9pnet_virtio 9pnet evdev joydev
drm virtio_balloon snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core
pvpanic acpi_cpufreq parport_pc parport processor thermal_sys button
autofs4 ext4 crc16 mbcache jbd2 hid_generic usbhid hid sg sr_mod cdrom
ata_generic virtio_blk virtio_net floppy ata_piix e1000 libata ehci_pci
virtio_pci scsi_mod uhci_hcd ehci_hcd virtio_ring virtio usbcore
usb_common [last unloaded: bonding]

[  908.984168] CPU: 0 PID: 1787 Comm: rmmod Tainted: G        W  O
4.2.0-rc2+ #8
[  908.984170] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[  908.984172]  0000000000000000 ffffffff81732d41 ffffffff81525b34
ffff8800358dfda8
[  908.984175]  ffffffff8106c521 ffff88003595af78 ffff88003595af40
ffff88003e3a4280
[  908.984178]  ffffffffa058d040 0000000000000000 ffffffff8106c59a
ffffffff8172ebd0
[  908.984181] Call Trace:
[  908.984188]  [&lt;ffffffff81525b34&gt;] ? dump_stack+0x40/0x50
[  908.984193]  [&lt;ffffffff8106c521&gt;] ? warn_slowpath_common+0x81/0xb0
[  908.984196]  [&lt;ffffffff8106c59a&gt;] ? warn_slowpath_fmt+0x4a/0x50
[  908.984199]  [&lt;ffffffff81218352&gt;] ? remove_proc_entry+0x112/0x160
[  908.984205]  [&lt;ffffffffa05850e6&gt;] ? bond_destroy_proc_dir+0x26/0x30
[bonding]
[  908.984208]  [&lt;ffffffffa057540e&gt;] ? bond_net_exit+0x8e/0xa0 [bonding]
[  908.984217]  [&lt;ffffffff8142f407&gt;] ? ops_exit_list.isra.4+0x37/0x70
[  908.984225]  [&lt;ffffffff8142f52d&gt;] ?
unregister_pernet_operations+0x8d/0xd0
[  908.984228]  [&lt;ffffffff8142f58d&gt;] ?
unregister_pernet_subsys+0x1d/0x30
[  908.984232]  [&lt;ffffffffa0585269&gt;] ? bonding_exit+0x23/0xdba [bonding]
[  908.984236]  [&lt;ffffffff810e28ba&gt;] ? SyS_delete_module+0x18a/0x250
[  908.984241]  [&lt;ffffffff81086f99&gt;] ? task_work_run+0x89/0xc0
[  908.984244]  [&lt;ffffffff8152b732&gt;] ?
entry_SYSCALL_64_fastpath+0x16/0x75
[  908.984247] ---[ end trace 7c006ed4abbef24b ]---

Thus remove the proc entry manually if bond_release_and_destroy() is
used. Because of the checks in bond_remove_proc_entry() it's not a
problem for a bond device to change namespaces (the bug fixed by the
Fixes commit) but since commit
f9399814927ad ("bonding: Don't allow bond devices to change network
namespaces.") that can't happen anyway.

Reported-by: Carol Soto &lt;clsoto@linux.vnet.ibm.com&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Fixes: a64d49c3dd50 ("bonding: Manage /proc/net/bonding/ entries from
                      the netdev events")
Tested-by: Carol L Soto &lt;clsoto@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the bonding is being unloaded and the netdevice notifier is
unregistered it executes NETDEV_UNREGISTER for each device which should
remove the bond's proc entry but if the device enslaved is not of
ARPHRD_ETHER type and is in front of the bonding, it may execute
bond_release_and_destroy() first which would release the last slave and
destroy the bond device leaving the proc entry and thus we will get the
following error (with dynamic debug on for bond_netdev_event to see the
events order):
[  908.963051] eql: event: 9
[  908.963052] eql: IFF_SLAVE
[  908.963054] eql: event: 2
[  908.963056] eql: IFF_SLAVE
[  908.963058] eql: event: 6
[  908.963059] eql: IFF_SLAVE
[  908.963110] bond0: Releasing active interface eql
[  908.976168] bond0: Destroying bond bond0
[  908.976266] bond0 (unregistering): Released all slaves
[  908.984097] ------------[ cut here ]------------
[  908.984107] WARNING: CPU: 0 PID: 1787 at fs/proc/generic.c:575
remove_proc_entry+0x112/0x160()
[  908.984110] remove_proc_entry: removing non-empty directory
'net/bonding', leaking at least 'bond0'
[  908.984111] Modules linked in: bonding(-) eql(O) 9p nfsd auth_rpcgss
oid_registry nfs_acl nfs lockd grace fscache sunrpc crct10dif_pclmul
crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev qxl drm_kms_helper
snd_hda_codec_generic aesni_intel ttm aes_x86_64 glue_helper pcspkr lrw
gf128mul ablk_helper cryptd snd_hda_intel virtio_console snd_hda_codec
psmouse serio_raw snd_hwdep snd_hda_core 9pnet_virtio 9pnet evdev joydev
drm virtio_balloon snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core
pvpanic acpi_cpufreq parport_pc parport processor thermal_sys button
autofs4 ext4 crc16 mbcache jbd2 hid_generic usbhid hid sg sr_mod cdrom
ata_generic virtio_blk virtio_net floppy ata_piix e1000 libata ehci_pci
virtio_pci scsi_mod uhci_hcd ehci_hcd virtio_ring virtio usbcore
usb_common [last unloaded: bonding]

[  908.984168] CPU: 0 PID: 1787 Comm: rmmod Tainted: G        W  O
4.2.0-rc2+ #8
[  908.984170] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[  908.984172]  0000000000000000 ffffffff81732d41 ffffffff81525b34
ffff8800358dfda8
[  908.984175]  ffffffff8106c521 ffff88003595af78 ffff88003595af40
ffff88003e3a4280
[  908.984178]  ffffffffa058d040 0000000000000000 ffffffff8106c59a
ffffffff8172ebd0
[  908.984181] Call Trace:
[  908.984188]  [&lt;ffffffff81525b34&gt;] ? dump_stack+0x40/0x50
[  908.984193]  [&lt;ffffffff8106c521&gt;] ? warn_slowpath_common+0x81/0xb0
[  908.984196]  [&lt;ffffffff8106c59a&gt;] ? warn_slowpath_fmt+0x4a/0x50
[  908.984199]  [&lt;ffffffff81218352&gt;] ? remove_proc_entry+0x112/0x160
[  908.984205]  [&lt;ffffffffa05850e6&gt;] ? bond_destroy_proc_dir+0x26/0x30
[bonding]
[  908.984208]  [&lt;ffffffffa057540e&gt;] ? bond_net_exit+0x8e/0xa0 [bonding]
[  908.984217]  [&lt;ffffffff8142f407&gt;] ? ops_exit_list.isra.4+0x37/0x70
[  908.984225]  [&lt;ffffffff8142f52d&gt;] ?
unregister_pernet_operations+0x8d/0xd0
[  908.984228]  [&lt;ffffffff8142f58d&gt;] ?
unregister_pernet_subsys+0x1d/0x30
[  908.984232]  [&lt;ffffffffa0585269&gt;] ? bonding_exit+0x23/0xdba [bonding]
[  908.984236]  [&lt;ffffffff810e28ba&gt;] ? SyS_delete_module+0x18a/0x250
[  908.984241]  [&lt;ffffffff81086f99&gt;] ? task_work_run+0x89/0xc0
[  908.984244]  [&lt;ffffffff8152b732&gt;] ?
entry_SYSCALL_64_fastpath+0x16/0x75
[  908.984247] ---[ end trace 7c006ed4abbef24b ]---

Thus remove the proc entry manually if bond_release_and_destroy() is
used. Because of the checks in bond_remove_proc_entry() it's not a
problem for a bond device to change namespaces (the bug fixed by the
Fixes commit) but since commit
f9399814927ad ("bonding: Don't allow bond devices to change network
namespaces.") that can't happen anyway.

Reported-by: Carol Soto &lt;clsoto@linux.vnet.ibm.com&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Fixes: a64d49c3dd50 ("bonding: Manage /proc/net/bonding/ entries from
                      the netdev events")
Tested-by: Carol L Soto &lt;clsoto@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
