Commit 37826f0
IB/mad: Check available slots before posting receive WRs
The ib_post_receive_mads() function handles posting receive work
requests (WRs) to MAD QPs and is called in two cases:
1) When a MAD port is opened.
2) When a receive WQE is consumed upon receiving a new MAD.
Whereas, if MADs arrive during the port open phase, a race condition
might cause an extra WR to be posted, exceeding the QP’s capacity.
This leads to failures such as:
infiniband mlx5_0: ib_post_recv failed: -12
infiniband mlx5_0: Couldn't post receive WRs
infiniband mlx5_0: Couldn't start port
infiniband mlx5_0: Couldn't open port 1
Fix this by checking the current receive count before posting a new WR.
If the QP’s receive queue is full, do not post additional WRs.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Maher Sanalla <[email protected]>
Link: https://patch.msgid.link/c4984ba3c3a98a5711a558bccefcad789587ecf1.1741875592.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <[email protected]>1 parent 0c55174 commit 37826f0
1 file changed
+20
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2671 | 2671 | | |
2672 | 2672 | | |
2673 | 2673 | | |
2674 | | - | |
2675 | 2674 | | |
2676 | 2675 | | |
2677 | 2676 | | |
2678 | 2677 | | |
| 2678 | + | |
2679 | 2679 | | |
2680 | 2680 | | |
2681 | 2681 | | |
| |||
2685 | 2685 | | |
2686 | 2686 | | |
2687 | 2687 | | |
2688 | | - | |
| 2688 | + | |
2689 | 2689 | | |
2690 | 2690 | | |
2691 | 2691 | | |
2692 | 2692 | | |
2693 | 2693 | | |
2694 | 2694 | | |
2695 | 2695 | | |
2696 | | - | |
2697 | | - | |
2698 | | - | |
2699 | | - | |
| 2696 | + | |
| 2697 | + | |
2700 | 2698 | | |
2701 | 2699 | | |
2702 | 2700 | | |
| |||
2705 | 2703 | | |
2706 | 2704 | | |
2707 | 2705 | | |
2708 | | - | |
2709 | 2706 | | |
2710 | | - | |
| 2707 | + | |
2711 | 2708 | | |
2712 | 2709 | | |
2713 | 2710 | | |
2714 | 2711 | | |
2715 | 2712 | | |
2716 | | - | |
2717 | | - | |
2718 | 2713 | | |
2719 | | - | |
2720 | | - | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
2721 | 2722 | | |
| 2723 | + | |
2722 | 2724 | | |
2723 | 2725 | | |
2724 | 2726 | | |
2725 | 2727 | | |
2726 | 2728 | | |
2727 | 2729 | | |
2728 | | - | |
2729 | | - | |
2730 | | - | |
2731 | | - | |
2732 | | - | |
2733 | 2730 | | |
2734 | 2731 | | |
2735 | 2732 | | |
2736 | 2733 | | |
2737 | | - | |
| 2734 | + | |
2738 | 2735 | | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
2739 | 2741 | | |
2740 | 2742 | | |
2741 | 2743 | | |
| |||
0 commit comments