Commit 2e9ff3f
bpf: Handle in-place update for full LPM trie correctly
[ Upstream commit 532d6b3 ]
When a LPM trie is full, in-place updates of existing elements
incorrectly return -ENOSPC.
Fix this by deferring the check of trie->n_entries. For new insertions,
n_entries must not exceed max_entries. However, in-place updates are
allowed even when the trie is full.
Fixes: b95a5c4 ("bpf: add a longest prefix match trie map implementation")
Reviewed-by: Toke Høiland-Jørgensen <[email protected]>
Signed-off-by: Hou Tao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent c1ab31e commit 2e9ff3f
1 file changed
+21
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
305 | 315 | | |
306 | 316 | | |
307 | 317 | | |
| |||
325 | 335 | | |
326 | 336 | | |
327 | 337 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 338 | | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
340 | | - | |
341 | | - | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
372 | | - | |
| 373 | + | |
| 374 | + | |
373 | 375 | | |
374 | | - | |
| 376 | + | |
375 | 377 | | |
376 | 378 | | |
377 | 379 | | |
| |||
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
392 | 394 | | |
393 | 395 | | |
394 | 396 | | |
| |||
400 | 402 | | |
401 | 403 | | |
402 | 404 | | |
403 | | - | |
404 | | - | |
| 405 | + | |
| 406 | + | |
405 | 407 | | |
406 | | - | |
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
| |||
438 | 440 | | |
439 | 441 | | |
440 | 442 | | |
441 | | - | |
442 | | - | |
443 | | - | |
| 443 | + | |
444 | 444 | | |
445 | | - | |
446 | | - | |
447 | 445 | | |
448 | 446 | | |
449 | 447 | | |
| |||
0 commit comments