Commit c31e403
RDMA/core: Use route entry flag to decide on loopback traffic
addr_resolve() considers a destination to be local if the next-hop
device of the resolved route for the destination is the loopback
netdevice.
This fails when the source and destination IP addresses belong to
a netdev enslaved to a VRF netdev. In this case the next-hop device
is the VRF itself:
$ ip link add name myvrf up type vrf table 100
$ ip link set ens2f0np0 master myvrf up
$ ip addr add 192.168.1.1/24 dev ens2f0np0
$ ip route get 192.168.1.1 oif myvrf
local 192.168.1.1 dev myvrf table 100 src 192.168.1.1 uid 0
cache <local>
This results in packets being generated with an incorrect destination
MAC of the VRF netdevice and ib_write_bw failing with timeout.
Solve this by determining if a destination is local or not based on
the resolved route's type rather than based on its next-hop netdevice
loopback flag.
This enables to resolve loopback traffic with and without VRF
configurations in a uniform way.
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Vlad Dumitrescu <vdumitrescu@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20250916111103.84069-4-edwards@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>1 parent 200651b commit c31e403
1 file changed
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
449 | 459 | | |
450 | 460 | | |
451 | 461 | | |
452 | | - | |
453 | 462 | | |
454 | 463 | | |
455 | | - | |
456 | | - | |
457 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
458 | 468 | | |
459 | | - | |
460 | | - | |
461 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
462 | 473 | | |
463 | 474 | | |
464 | 475 | | |
465 | | - | |
466 | 476 | | |
467 | 477 | | |
468 | 478 | | |
469 | 479 | | |
470 | 480 | | |
471 | | - | |
472 | 481 | | |
473 | | - | |
| 482 | + | |
474 | 483 | | |
475 | 484 | | |
476 | 485 | | |
| |||
538 | 547 | | |
539 | 548 | | |
540 | 549 | | |
541 | | - | |
542 | 550 | | |
543 | 551 | | |
544 | 552 | | |
| |||
575 | 583 | | |
576 | 584 | | |
577 | 585 | | |
578 | | - | |
| 586 | + | |
579 | 587 | | |
580 | 588 | | |
581 | 589 | | |
582 | 590 | | |
583 | 591 | | |
584 | 592 | | |
585 | 593 | | |
586 | | - | |
| 594 | + | |
587 | 595 | | |
588 | 596 | | |
589 | 597 | | |
| |||
0 commit comments