Commit faa6244
RDMA/hns: Fix different dgids mapping to the same dip_idx
DIP algorithm requires a one-to-one mapping between dgid and dip_idx.
Currently a queue 'spare_idx' is used to store QPN of QPs that use
DIP algorithm. For a new dgid, use a QPN from spare_idx as dip_idx.
This method lacks a mechanism for deduplicating QPN, which may result
in different dgids sharing the same dip_idx and break the one-to-one
mapping requirement.
This patch replaces spare_idx with xarray and introduces a refcnt of
a dip_idx to indicate the number of QPs that using this dip_idx.
The state machine for dip_idx management is implemented as:
* The entry at an index in xarray is empty -- This indicates that the
corresponding dip_idx hasn't been created.
* The entry at an index in xarray is not empty but with 0 refcnt --
This indicates that the corresponding dip_idx has been created but
not used as dip_idx yet.
* The entry at an index in xarray is not empty and with non-0 refcnt --
This indicates that the corresponding dip_idx is being used by refcnt
number of DIP QPs.
Fixes: eb653ed ("RDMA/hns: Bugfix for incorrect association between dip_idx and dgid")
Fixes: f91696f ("RDMA/hns: Support congestion control type selection according to the FW")
Signed-off-by: Feng Fang <[email protected]>
Signed-off-by: Junxian Huang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>1 parent cdb21c1 commit faa6244
File tree
5 files changed
+75
-44
lines changed- drivers/infiniband/hw/hns
5 files changed
+75
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | 492 | | |
499 | 493 | | |
500 | 494 | | |
| |||
503 | 497 | | |
504 | 498 | | |
505 | 499 | | |
506 | | - | |
| 500 | + | |
507 | 501 | | |
508 | 502 | | |
509 | 503 | | |
| |||
658 | 652 | | |
659 | 653 | | |
660 | 654 | | |
| 655 | + | |
661 | 656 | | |
662 | 657 | | |
663 | 658 | | |
| |||
984 | 979 | | |
985 | 980 | | |
986 | 981 | | |
987 | | - | |
988 | | - | |
989 | 982 | | |
990 | 983 | | |
991 | 984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2553 | 2553 | | |
2554 | 2554 | | |
2555 | 2555 | | |
2556 | | - | |
| 2556 | + | |
2557 | 2557 | | |
2558 | 2558 | | |
2559 | | - | |
2560 | | - | |
| 2559 | + | |
2561 | 2560 | | |
2562 | | - | |
| 2561 | + | |
2563 | 2562 | | |
2564 | | - | |
2565 | | - | |
| 2563 | + | |
| 2564 | + | |
2566 | 2565 | | |
2567 | 2566 | | |
2568 | 2567 | | |
2569 | | - | |
| 2568 | + | |
2570 | 2569 | | |
2571 | 2570 | | |
2572 | 2571 | | |
| |||
2974 | 2973 | | |
2975 | 2974 | | |
2976 | 2975 | | |
2977 | | - | |
| 2976 | + | |
2978 | 2977 | | |
2979 | 2978 | | |
2980 | 2979 | | |
| |||
4694 | 4693 | | |
4695 | 4694 | | |
4696 | 4695 | | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
| 4704 | + | |
| 4705 | + | |
| 4706 | + | |
| 4707 | + | |
| 4708 | + | |
| 4709 | + | |
| 4710 | + | |
| 4711 | + | |
| 4712 | + | |
| 4713 | + | |
| 4714 | + | |
| 4715 | + | |
4697 | 4716 | | |
4698 | 4717 | | |
4699 | 4718 | | |
4700 | 4719 | | |
4701 | 4720 | | |
4702 | | - | |
4703 | | - | |
4704 | | - | |
| 4721 | + | |
| 4722 | + | |
4705 | 4723 | | |
4706 | | - | |
| 4724 | + | |
4707 | 4725 | | |
4708 | 4726 | | |
4709 | | - | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
4710 | 4730 | | |
4711 | | - | |
4712 | | - | |
| 4731 | + | |
4713 | 4732 | | |
4714 | | - | |
4715 | | - | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
4716 | 4736 | | |
| 4737 | + | |
| 4738 | + | |
4717 | 4739 | | |
4718 | 4740 | | |
4719 | 4741 | | |
4720 | 4742 | | |
4721 | 4743 | | |
4722 | 4744 | | |
4723 | 4745 | | |
4724 | | - | |
4725 | | - | |
4726 | | - | |
4727 | | - | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
4728 | 4756 | | |
4729 | 4757 | | |
4730 | | - | |
4731 | | - | |
4732 | | - | |
4733 | | - | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
4734 | 4761 | | |
4735 | 4762 | | |
4736 | | - | |
| 4763 | + | |
4737 | 4764 | | |
4738 | 4765 | | |
4739 | 4766 | | |
| |||
5587 | 5614 | | |
5588 | 5615 | | |
5589 | 5616 | | |
| 5617 | + | |
| 5618 | + | |
| 5619 | + | |
| 5620 | + | |
| 5621 | + | |
| 5622 | + | |
| 5623 | + | |
| 5624 | + | |
| 5625 | + | |
| 5626 | + | |
| 5627 | + | |
| 5628 | + | |
| 5629 | + | |
| 5630 | + | |
5590 | 5631 | | |
5591 | 5632 | | |
5592 | 5633 | | |
| |||
5600 | 5641 | | |
5601 | 5642 | | |
5602 | 5643 | | |
| 5644 | + | |
| 5645 | + | |
| 5646 | + | |
5603 | 5647 | | |
5604 | 5648 | | |
5605 | 5649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | | - | |
| 1351 | + | |
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
1138 | | - | |
1139 | | - | |
1140 | 1138 | | |
1141 | 1139 | | |
1142 | 1140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1573 | 1573 | | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | 1576 | | |
1582 | 1577 | | |
1583 | 1578 | | |
| 1579 | + | |
1584 | 1580 | | |
1585 | 1581 | | |
1586 | 1582 | | |
| |||
1605 | 1601 | | |
1606 | 1602 | | |
1607 | 1603 | | |
| 1604 | + | |
1608 | 1605 | | |
1609 | 1606 | | |
1610 | | - | |
1611 | 1607 | | |
0 commit comments