Commit 6ad56de
l2: don't let the fib scan clobber the learn count mid-learning
l2fib_scan retallies every learned MAC into a local learn_count and then
unconditionally writes it back over l2learn_main.global_learn_count (and
the per-bd counts). But the bucket walk it derives that tally from
suspends every periodically, yielding the main thread to the data path.
If MACs are learned during one of those yields, the tally is a stale
undercount counted and writing it back drops global_learn_count below
its true value. The data-path learn limit (l2_learn.c) then sees room
again and learning overshoots the limit.
This surfaced as an intermittent failure of test_l2bd_learnlimit01:
want_l2_macs_events() flushes the fib and kicks a one-pass scan via
l2fib_start_ager_scan(), whose walk straddles the test's immediately
following learning burst and resets global_learn_count to a pre-burst
value, so a second bridge domain learns one MAC past the global limit
(lfs2 == 1 instead of 0). The periodic 100ms event scan can race a
learning burst the same way in normal operation.
This patch deliberately ignores multi-threaded scenarios and is only a
naive workaround to make CI happy.
Type: fix
Change-Id: Ib147efe81fe9d5fb82cd81cdc213fc9e8d5c14c9
Signed-off-by: Klement Sekera <ksekera@netgate.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>1 parent 0c676da commit 6ad56de
1 file changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1098 | 1098 | | |
1099 | 1099 | | |
1100 | 1100 | | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1101 | 1106 | | |
1102 | 1107 | | |
1103 | 1108 | | |
| |||
1246 | 1251 | | |
1247 | 1252 | | |
1248 | 1253 | | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1252 | 1270 | | |
1253 | | - | |
1254 | | - | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1255 | 1274 | | |
1256 | 1275 | | |
1257 | 1276 | | |
| |||
0 commit comments