<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/bridge/br_stp_timer.c, branch v4.1</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>bridge: fix lockdep splat</title>
<updated>2015-05-22T20:23:56+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-05-21T20:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=93a33a584e2a49a217118148125944fd02d47b54'/>
<id>93a33a584e2a49a217118148125944fd02d47b54</id>
<content type='text'>
Following lockdep splat was reported :

[   29.382286] ===============================
[   29.382315] [ INFO: suspicious RCU usage. ]
[   29.382344] 4.1.0-0.rc0.git11.1.fc23.x86_64 #1 Not tainted
[   29.382380] -------------------------------
[   29.382409] net/bridge/br_private.h:626 suspicious
rcu_dereference_check() usage!
[   29.382455]
               other info that might help us debug this:

[   29.382507]
               rcu_scheduler_active = 1, debug_locks = 0
[   29.382549] 2 locks held by swapper/0/0:
[   29.382576]  #0:  (((&amp;p-&gt;forward_delay_timer))){+.-...}, at:
[&lt;ffffffff81139f75&gt;] call_timer_fn+0x5/0x4f0
[   29.382660]  #1:  (&amp;(&amp;br-&gt;lock)-&gt;rlock){+.-...}, at:
[&lt;ffffffffa0450dc1&gt;] br_forward_delay_timer_expired+0x31/0x140
[bridge]
[   29.382754]
               stack backtrace:
[   29.382787] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.1.0-0.rc0.git11.1.fc23.x86_64 #1
[   29.382838] Hardware name: LENOVO 422916G/LENOVO, BIOS A1KT53AUS 04/07/2015
[   29.382882]  0000000000000000 3ebfc20364115825 ffff880666603c48
ffffffff81892d4b
[   29.382943]  0000000000000000 ffffffff81e124e0 ffff880666603c78
ffffffff8110bcd7
[   29.383004]  ffff8800785c9d00 ffff88065485ac58 ffff880c62002800
ffff880c5fc88ac0
[   29.383065] Call Trace:
[   29.383084]  &lt;IRQ&gt;  [&lt;ffffffff81892d4b&gt;] dump_stack+0x4c/0x65
[   29.383130]  [&lt;ffffffff8110bcd7&gt;] lockdep_rcu_suspicious+0xe7/0x120
[   29.383178]  [&lt;ffffffffa04520f9&gt;] br_fill_ifinfo+0x4a9/0x6a0 [bridge]
[   29.383225]  [&lt;ffffffffa045266b&gt;] br_ifinfo_notify+0x11b/0x4b0 [bridge]
[   29.383271]  [&lt;ffffffffa0450d90&gt;] ? br_hold_timer_expired+0x70/0x70 [bridge]
[   29.383320]  [&lt;ffffffffa0450de8&gt;]
br_forward_delay_timer_expired+0x58/0x140 [bridge]
[   29.383371]  [&lt;ffffffffa0450d90&gt;] ? br_hold_timer_expired+0x70/0x70 [bridge]
[   29.383416]  [&lt;ffffffff8113a033&gt;] call_timer_fn+0xc3/0x4f0
[   29.383454]  [&lt;ffffffff81139f75&gt;] ? call_timer_fn+0x5/0x4f0
[   29.383493]  [&lt;ffffffff8110a90f&gt;] ? lock_release_holdtime.part.29+0xf/0x200
[   29.383541]  [&lt;ffffffffa0450d90&gt;] ? br_hold_timer_expired+0x70/0x70 [bridge]
[   29.383587]  [&lt;ffffffff8113a6a4&gt;] run_timer_softirq+0x244/0x490
[   29.383629]  [&lt;ffffffff810b68cc&gt;] __do_softirq+0xec/0x670
[   29.383666]  [&lt;ffffffff810b70d5&gt;] irq_exit+0x145/0x150
[   29.383703]  [&lt;ffffffff8189f506&gt;] smp_apic_timer_interrupt+0x46/0x60
[   29.383744]  [&lt;ffffffff8189d523&gt;] apic_timer_interrupt+0x73/0x80
[   29.383782]  &lt;EOI&gt;  [&lt;ffffffff816f131f&gt;] ? cpuidle_enter_state+0x5f/0x2f0
[   29.383832]  [&lt;ffffffff816f131b&gt;] ? cpuidle_enter_state+0x5b/0x2f0

Problem here is that br_forward_delay_timer_expired() is a timer
handler, calling br_ifinfo_notify() which assumes either rcu_read_lock()
or RTNL are held.

Simplest fix seems to add rcu read lock section.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Reported-by: Dominick Grift &lt;dac.override@gmail.com&gt;
Cc: Vlad Yasevich &lt;vyasevich@gmail.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>
Following lockdep splat was reported :

[   29.382286] ===============================
[   29.382315] [ INFO: suspicious RCU usage. ]
[   29.382344] 4.1.0-0.rc0.git11.1.fc23.x86_64 #1 Not tainted
[   29.382380] -------------------------------
[   29.382409] net/bridge/br_private.h:626 suspicious
rcu_dereference_check() usage!
[   29.382455]
               other info that might help us debug this:

[   29.382507]
               rcu_scheduler_active = 1, debug_locks = 0
[   29.382549] 2 locks held by swapper/0/0:
[   29.382576]  #0:  (((&amp;p-&gt;forward_delay_timer))){+.-...}, at:
[&lt;ffffffff81139f75&gt;] call_timer_fn+0x5/0x4f0
[   29.382660]  #1:  (&amp;(&amp;br-&gt;lock)-&gt;rlock){+.-...}, at:
[&lt;ffffffffa0450dc1&gt;] br_forward_delay_timer_expired+0x31/0x140
[bridge]
[   29.382754]
               stack backtrace:
[   29.382787] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.1.0-0.rc0.git11.1.fc23.x86_64 #1
[   29.382838] Hardware name: LENOVO 422916G/LENOVO, BIOS A1KT53AUS 04/07/2015
[   29.382882]  0000000000000000 3ebfc20364115825 ffff880666603c48
ffffffff81892d4b
[   29.382943]  0000000000000000 ffffffff81e124e0 ffff880666603c78
ffffffff8110bcd7
[   29.383004]  ffff8800785c9d00 ffff88065485ac58 ffff880c62002800
ffff880c5fc88ac0
[   29.383065] Call Trace:
[   29.383084]  &lt;IRQ&gt;  [&lt;ffffffff81892d4b&gt;] dump_stack+0x4c/0x65
[   29.383130]  [&lt;ffffffff8110bcd7&gt;] lockdep_rcu_suspicious+0xe7/0x120
[   29.383178]  [&lt;ffffffffa04520f9&gt;] br_fill_ifinfo+0x4a9/0x6a0 [bridge]
[   29.383225]  [&lt;ffffffffa045266b&gt;] br_ifinfo_notify+0x11b/0x4b0 [bridge]
[   29.383271]  [&lt;ffffffffa0450d90&gt;] ? br_hold_timer_expired+0x70/0x70 [bridge]
[   29.383320]  [&lt;ffffffffa0450de8&gt;]
br_forward_delay_timer_expired+0x58/0x140 [bridge]
[   29.383371]  [&lt;ffffffffa0450d90&gt;] ? br_hold_timer_expired+0x70/0x70 [bridge]
[   29.383416]  [&lt;ffffffff8113a033&gt;] call_timer_fn+0xc3/0x4f0
[   29.383454]  [&lt;ffffffff81139f75&gt;] ? call_timer_fn+0x5/0x4f0
[   29.383493]  [&lt;ffffffff8110a90f&gt;] ? lock_release_holdtime.part.29+0xf/0x200
[   29.383541]  [&lt;ffffffffa0450d90&gt;] ? br_hold_timer_expired+0x70/0x70 [bridge]
[   29.383587]  [&lt;ffffffff8113a6a4&gt;] run_timer_softirq+0x244/0x490
[   29.383629]  [&lt;ffffffff810b68cc&gt;] __do_softirq+0xec/0x670
[   29.383666]  [&lt;ffffffff810b70d5&gt;] irq_exit+0x145/0x150
[   29.383703]  [&lt;ffffffff8189f506&gt;] smp_apic_timer_interrupt+0x46/0x60
[   29.383744]  [&lt;ffffffff8189d523&gt;] apic_timer_interrupt+0x73/0x80
[   29.383782]  &lt;EOI&gt;  [&lt;ffffffff816f131f&gt;] ? cpuidle_enter_state+0x5f/0x2f0
[   29.383832]  [&lt;ffffffff816f131b&gt;] ? cpuidle_enter_state+0x5b/0x2f0

Problem here is that br_forward_delay_timer_expired() is a timer
handler, calling br_ifinfo_notify() which assumes either rcu_read_lock()
or RTNL are held.

Simplest fix seems to add rcu read lock section.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Reported-by: Dominick Grift &lt;dac.override@gmail.com&gt;
Cc: Vlad Yasevich &lt;vyasevich@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: bridge: add a br_set_state helper function</title>
<updated>2014-10-02T02:03:50+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2014-09-30T23:13:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=775dd692bd34f9201ed2aa775a0edcba4f973f3e'/>
<id>775dd692bd34f9201ed2aa775a0edcba4f973f3e</id>
<content type='text'>
In preparation for being able to propagate port states to e.g: notifiers
or other kernel parts, do not manipulate the port state directly, but
instead use a helper function which will allow us to do a bit more than
just setting the state.

Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.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>
In preparation for being able to propagate port states to e.g: notifiers
or other kernel parts, do not manipulate the port state directly, but
instead use a helper function which will allow us to do a bit more than
just setting the state.

Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bridge: add space before '(/{', after ',', etc.</title>
<updated>2013-12-20T00:27:26+00:00</updated>
<author>
<name>tanxiaojun</name>
<email>tanxiaojun@huawei.com</email>
</author>
<published>2013-12-19T05:28:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=31a5b837c2e0d282f36d06a2b96f16d97464fd68'/>
<id>31a5b837c2e0d282f36d06a2b96f16d97464fd68</id>
<content type='text'>
Spaces required before the open parenthesis '(', before the open
brace '{', after that ',' and around that '?/:'.

Signed-off-by: Tan Xiaojun &lt;tanxiaojun@huawei.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>
Spaces required before the open parenthesis '(', before the open
brace '{', after that ',' and around that '?/:'.

Signed-off-by: Tan Xiaojun &lt;tanxiaojun@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bridge: fix race with topology change timer</title>
<updated>2013-05-03T20:08:58+00:00</updated>
<author>
<name>stephen hemminger</name>
<email>stephen@networkplumber.org</email>
</author>
<published>2013-05-02T14:23:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=83401eb4990ff6af55aeed8f49681558544192e6'/>
<id>83401eb4990ff6af55aeed8f49681558544192e6</id>
<content type='text'>
A bridge should only send topology change notice if it is not
the root bridge. It is possible for message age timer to elect itself
as a new root bridge, and still have a topology change timer running
but waiting for bridge lock on other CPU.

Solve the race by checking if we are root bridge before continuing.
This was the root cause of the cases where br_send_tcn_bpdu would OOPS.

Reported-by: JerryKang &lt;jerry.kang@samsung.com&gt;
Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&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>
A bridge should only send topology change notice if it is not
the root bridge. It is possible for message age timer to elect itself
as a new root bridge, and still have a topology change timer running
but waiting for bridge lock on other CPU.

Solve the race by checking if we are root bridge before continuing.
This was the root cause of the cases where br_send_tcn_bpdu would OOPS.

Reported-by: JerryKang &lt;jerry.kang@samsung.com&gt;
Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>time: jiffies_delta_to_clock_t() helper to the rescue</title>
<updated>2012-08-09T23:17:03+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-08-08T21:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a399a8053164ec8bcb06fed52be9941a26ecde11'/>
<id>a399a8053164ec8bcb06fed52be9941a26ecde11</id>
<content type='text'>
Various /proc/net files sometimes report crazy timer values, expressed
in clock_t units.

This happens when an expired timer delta (expires - jiffies) is passed
to jiffies_to_clock_t().

This function has an overflow in :

return div_u64((u64)x * TICK_NSEC, NSEC_PER_SEC / USER_HZ);

commit cbbc719fccdb8cb (time: Change jiffies_to_clock_t() argument type
to unsigned long) only got around the problem.

As we cant output negative values in /proc/net/tcp without breaking
various tools, I suggest adding a jiffies_delta_to_clock_t() wrapper
that caps the negative delta to a 0 value.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: hank &lt;pyu@redhat.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>
Various /proc/net files sometimes report crazy timer values, expressed
in clock_t units.

This happens when an expired timer delta (expires - jiffies) is passed
to jiffies_to_clock_t().

This function has an overflow in :

return div_u64((u64)x * TICK_NSEC, NSEC_PER_SEC / USER_HZ);

commit cbbc719fccdb8cb (time: Change jiffies_to_clock_t() argument type
to unsigned long) only got around the problem.

As we cant output negative values in /proc/net/tcp without breaking
various tools, I suggest adding a jiffies_delta_to_clock_t() wrapper
that caps the negative delta to a 0 value.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: hank &lt;pyu@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: cleanup unsigned to unsigned int</title>
<updated>2012-04-15T16:44:40+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2012-04-15T05:58:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=95c961747284a6b83a5e2d81240e214b0fa3464d'/>
<id>95c961747284a6b83a5e2d81240e214b0fa3464d</id>
<content type='text'>
Use of "unsigned int" is preferred to bare "unsigned" in net tree.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.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>
Use of "unsigned int" is preferred to bare "unsigned" in net tree.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bridge: add notification over netlink when STP changes state</title>
<updated>2011-07-23T00:01:12+00:00</updated>
<author>
<name>stephen hemminger</name>
<email>shemminger@vyatta.com</email>
</author>
<published>2011-07-22T07:47:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4ecb961c8b474ebef5aff55f715c7875e69dd57b'/>
<id>4ecb961c8b474ebef5aff55f715c7875e69dd57b</id>
<content type='text'>
When STP changes state of interface need to send a new link
message to reflect that change.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.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 STP changes state of interface need to send a new link
message to reflect that change.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bridge: control carrier based on ports online</title>
<updated>2011-03-14T21:29:02+00:00</updated>
<author>
<name>stephen hemminger</name>
<email>shemminger@vyatta.com</email>
</author>
<published>2011-03-07T08:34:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1faa4356a3bd89ea11fb92752d897cff3a20ec0e'/>
<id>1faa4356a3bd89ea11fb92752d897cff3a20ec0e</id>
<content type='text'>
This makes the bridge device behave like a physical device.
In earlier releases the bridge always asserted carrier. This
changes the behavior so that bridge device carrier is on only
if one or more ports are in the forwarding state. This
should help IPv6 autoconfiguration, DHCP, and routing daemons.

I did brief testing with Network and Virt manager and they
seem fine, but since this changes behavior of bridge, it should
wait until net-next (2.6.39).

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Reviewed-by: Nicolas de Pesloüan &lt;nicolas.2p.debian@free.fr&gt;
Tested-By: Adam Majer &lt;adamm@zombino.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>
This makes the bridge device behave like a physical device.
In earlier releases the bridge always asserted carrier. This
changes the behavior so that bridge device carrier is on only
if one or more ports are in the forwarding state. This
should help IPv6 autoconfiguration, DHCP, and routing daemons.

I did brief testing with Network and Virt manager and they
seem fine, but since this changes behavior of bridge, it should
wait until net-next (2.6.39).

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Reviewed-by: Nicolas de Pesloüan &lt;nicolas.2p.debian@free.fr&gt;
Tested-By: Adam Majer &lt;adamm@zombino.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bridge: change console message interface</title>
<updated>2010-05-16T06:10:02+00:00</updated>
<author>
<name>stephen hemminger</name>
<email>shemminger@vyatta.com</email>
</author>
<published>2010-05-10T09:31:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=28a16c97963d3bc36a2c192859f6d8025ef2967a'/>
<id>28a16c97963d3bc36a2c192859f6d8025ef2967a</id>
<content type='text'>
Use one set of macro's for all bridge messages.

Note: can't use netdev_XXX macro's because bridge is purely
virtual and has no device parent.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.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>
Use one set of macro's for all bridge messages.

Note: can't use netdev_XXX macro's because bridge is purely
virtual and has no device parent.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: remove CVS keywords</title>
<updated>2008-06-12T04:00:38+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@kernel.org</email>
</author>
<published>2008-06-11T05:46:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0b040829952d84bf2a62526f0e24b624e0699447'/>
<id>0b040829952d84bf2a62526f0e24b624e0699447</id>
<content type='text'>
This patch removes CVS keywords that weren't updated for a long time
from comments.

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&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>
This patch removes CVS keywords that weren't updated for a long time
from comments.

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
