<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/bridge/br_stp_timer.c, branch linux-4.13.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-05-21T17:33:28+00:00</updated>
<entry>
<title>bridge: start hello_timer when enabling KERNEL_STP in br_stp_start</title>
<updated>2017-05-21T17:33:28+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2017-05-19T14:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6d18c732b95c0a9d35e9f978b4438bba15412284'/>
<id>urn:sha1:6d18c732b95c0a9d35e9f978b4438bba15412284</id>
<content type='text'>
Since commit 76b91c32dd86 ("bridge: stp: when using userspace stp stop
kernel hello and hold timers"), bridge would not start hello_timer if
stp_enabled is not KERNEL_STP when br_dev_open.

The problem is even if users set stp_enabled with KERNEL_STP later,
the timer will still not be started. It causes that KERNEL_STP can
not really work. Users have to re-ifup the bridge to avoid this.

This patch is to fix it by starting br-&gt;hello_timer when enabling
KERNEL_STP in br_stp_start.

As an improvement, it's also to start hello_timer again only when
br-&gt;stp_enabled is KERNEL_STP in br_hello_timer_expired, there is
no reason to start the timer again when it's NO_STP.

Fixes: 76b91c32dd86 ("bridge: stp: when using userspace stp stop kernel hello and hold timers")
Reported-by: Haidong Li &lt;haili@redhat.com&gt;
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Acked-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Reviewed-by: Ivan Vecera &lt;cera@cera.cz&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: move to workqueue gc</title>
<updated>2017-02-07T03:53:13+00:00</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>nikolay@cumulusnetworks.com</email>
</author>
<published>2017-02-04T17:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f7cdee8a79a1cb03fa9ca71b825e72f880b344e1'/>
<id>urn:sha1:f7cdee8a79a1cb03fa9ca71b825e72f880b344e1</id>
<content type='text'>
Move the fdb garbage collector to a workqueue which fires at least 10
milliseconds apart and cleans chain by chain allowing for other tasks
to run in the meantime. When having thousands of fdbs the system is much
more responsive. Most importantly remove the need to check if the
matched entry has expired in __br_fdb_get that causes false-sharing and
is completely unnecessary if we cleanup entries, at worst we'll get 10ms
of traffic for that entry before it gets deleted.

Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: add helper to set topology change</title>
<updated>2016-12-11T02:27:23+00:00</updated>
<author>
<name>Vivien Didelot</name>
<email>vivien.didelot@savoirfairelinux.com</email>
</author>
<published>2016-12-10T18:44:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8384b5f5b293389a42cc65bfca2d767d15809aa1'/>
<id>urn:sha1:8384b5f5b293389a42cc65bfca2d767d15809aa1</id>
<content type='text'>
Add a __br_set_topology_change helper to set the topology change value.

This can be later extended to add actions when the topology change flag
is set or cleared.

Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: bridge: log port STP state on change</title>
<updated>2016-02-18T19:20:08+00:00</updated>
<author>
<name>Vivien Didelot</name>
<email>vivien.didelot@savoirfairelinux.com</email>
</author>
<published>2016-02-16T15:09:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c25b16dbbcf37ce8019bacf634ee47d852225d9'/>
<id>urn:sha1:7c25b16dbbcf37ce8019bacf634ee47d852225d9</id>
<content type='text'>
Remove the shared br_log_state function and print the info directly in
br_set_state, where the net_bridge_port state is actually changed.

Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Acked-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bridge: stp: when using userspace stp stop kernel hello and hold timers</title>
<updated>2015-07-29T06:33:20+00:00</updated>
<author>
<name>Nikolay Aleksandrov</name>
<email>razor@blackwall.org</email>
</author>
<published>2015-07-23T18:01:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=76b91c32dd86f624b5df038dcb68cddd5a18d355'/>
<id>urn:sha1:76b91c32dd86f624b5df038dcb68cddd5a18d355</id>
<content type='text'>
These should be handled only by the respective STP which is in control.
They become problematic for devices with limited resources with many
ports because the hold_timer is per port and fires each second and the
hello timer fires each 2 seconds even though it's global. While in
user-space STP mode these timers are completely unnecessary so it's better
to keep them off.
Also ensure that when the bridge is up these timers are started only when
running with kernel STP.

Signed-off-by: Satish Ashok &lt;sashok@cumulusnetworks.com&gt;
Signed-off-by: Nikolay Aleksandrov &lt;nikolay@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<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.radix-linux.su/kernel/linux.git/commit/?id=93a33a584e2a49a217118148125944fd02d47b54'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=775dd692bd34f9201ed2aa775a0edcba4f973f3e'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=31a5b837c2e0d282f36d06a2b96f16d97464fd68'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=83401eb4990ff6af55aeed8f49681558544192e6'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=a399a8053164ec8bcb06fed52be9941a26ecde11'/>
<id>urn:sha1: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>
</entry>
</feed>
