Commit 509df67
Alexei Starovoitov
Merge branch 'fixes-for-lpm-trie'
Hou Tao says:
====================
This patch set fixes several issues for LPM trie. These issues were
found during adding new test cases or were reported by syzbot.
The patch set is structured as follows:
Patch #1~#2 are clean-ups for lpm_trie_update_elem().
Patch #3 handles BPF_EXIST and BPF_NOEXIST correctly for LPM trie.
Patch #4 fixes the accounting of n_entries when doing in-place update.
Patch #5 fixes the exact match condition in trie_get_next_key() and it
may skip keys when the passed key is not found in the map.
Patch torvalds#6~torvalds#7 switch from kmalloc() to bpf memory allocator for LPM trie
to fix several lock order warnings reported by syzbot. It also enables
raw_spinlock_t for LPM trie again. After these changes, the LPM trie will
be closer to being usable in any context (though the reentrance check of
trie->lock is still missing, but it is on my todo list).
Patch torvalds#8: move test_lpm_map to map_tests to make it run regularly.
Patch torvalds#9: add test cases for the issues fixed by patch #3~#5.
Please see individual patches for more details. Comments are always
welcome.
Change Log:
v3:
* patch #2: remove the unnecessary NULL-init for im_node
* patch torvalds#6: alloc the leaf node before disabling IRQ to low
the possibility of -ENOMEM when leaf_size is large; Free
these nodes outside the trie lock (Suggested by Alexei)
* collect review and ack tags (Thanks for Toke & Daniel)
v2: https://lore.kernel.org/bpf/20241127004641.1118269-1-houtao@huaweicloud.com/
* collect review tags (Thanks for Toke)
* drop "Add bpf_mem_cache_is_mergeable() helper" patch
* patch #3~#4: add fix tag
* patch #4: rename the helper to trie_check_add_elem() and increase
n_entries in it.
* patch torvalds#6: use one bpf mem allocator and update commit message to
clarify that using bpf mem allocator is more appropriate.
* patch torvalds#7: update commit message to add the possible max running time
for update operation.
* patch torvalds#9: update commit message to specify the purpose of these test
cases.
v1: https://lore.kernel.org/bpf/20241118010808.2243555-1-houtao@huaweicloud.com/
====================
Link: https://lore.kernel.org/all/20241206110622.1161752-1-houtao@huaweicloud.com/
Signed-off-by: Alexei Starovoitov <ast@kernel.org>File tree
4 files changed
+484
-57
lines changed- kernel/bpf
- tools/testing/selftests/bpf
- map_tests
4 files changed
+484
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
290 | | - | |
291 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
292 | 294 | | |
293 | 295 | | |
294 | | - | |
295 | 296 | | |
296 | | - | |
297 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
298 | 302 | | |
299 | | - | |
300 | | - | |
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
| |||
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
313 | 325 | | |
314 | 326 | | |
315 | 327 | | |
316 | 328 | | |
317 | 329 | | |
318 | | - | |
| 330 | + | |
319 | 331 | | |
320 | 332 | | |
321 | 333 | | |
| |||
330 | 342 | | |
331 | 343 | | |
332 | 344 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
347 | 351 | | |
348 | | - | |
| 352 | + | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| |||
364 | 368 | | |
365 | 369 | | |
366 | 370 | | |
367 | | - | |
368 | | - | |
| 371 | + | |
369 | 372 | | |
370 | 373 | | |
371 | 374 | | |
| |||
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
| |||
384 | 391 | | |
385 | 392 | | |
386 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
387 | 405 | | |
388 | 406 | | |
389 | 407 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | 408 | | |
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
397 | 412 | | |
398 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
399 | 418 | | |
400 | 419 | | |
401 | 420 | | |
| |||
406 | 425 | | |
407 | 426 | | |
408 | 427 | | |
409 | | - | |
| 428 | + | |
| 429 | + | |
410 | 430 | | |
| 431 | + | |
411 | 432 | | |
412 | 433 | | |
413 | 434 | | |
| |||
429 | 450 | | |
430 | 451 | | |
431 | 452 | | |
432 | | - | |
433 | | - | |
434 | | - | |
| 453 | + | |
435 | 454 | | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
442 | 460 | | |
443 | 461 | | |
444 | 462 | | |
| |||
459 | 477 | | |
460 | 478 | | |
461 | 479 | | |
462 | | - | |
| 480 | + | |
463 | 481 | | |
464 | 482 | | |
465 | 483 | | |
| |||
535 | 553 | | |
536 | 554 | | |
537 | 555 | | |
538 | | - | |
539 | | - | |
540 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
541 | 562 | | |
542 | 563 | | |
543 | 564 | | |
| |||
559 | 580 | | |
560 | 581 | | |
561 | 582 | | |
| 583 | + | |
| 584 | + | |
562 | 585 | | |
563 | 586 | | |
564 | 587 | | |
| |||
581 | 604 | | |
582 | 605 | | |
583 | 606 | | |
584 | | - | |
| 607 | + | |
585 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
586 | 615 | | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
587 | 620 | | |
588 | 621 | | |
589 | 622 | | |
| |||
615 | 648 | | |
616 | 649 | | |
617 | 650 | | |
618 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
619 | 655 | | |
620 | 656 | | |
621 | 657 | | |
622 | 658 | | |
623 | 659 | | |
624 | 660 | | |
| 661 | + | |
625 | 662 | | |
626 | 663 | | |
627 | 664 | | |
| |||
633 | 670 | | |
634 | 671 | | |
635 | 672 | | |
636 | | - | |
| 673 | + | |
637 | 674 | | |
638 | 675 | | |
639 | 676 | | |
| |||
672 | 709 | | |
673 | 710 | | |
674 | 711 | | |
675 | | - | |
| 712 | + | |
676 | 713 | | |
677 | 714 | | |
678 | 715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
0 commit comments