Commit 1e75550
Revert "RDMA/rxe: Create duplicate mapping tables for FMRs"
Below 2 commits will be reverted:
commit 8ff5f5d ("RDMA/rxe: Prevent double freeing rxe_map_set()")
commit 647bf13 ("RDMA/rxe: Create duplicate mapping tables for FMRs")
The community has a few bug reports which pointed this commit at last.
Some proposals are raised up in the meantime but all of them have no
follow-up operation.
The previous commit led the map_set of FMR to be not available any more if
the MR is registered again after invalidating. Although the mentioned
patch try to fix a potential race in building/accessing the same table
for fast memory regions, it broke rtrs etc ULPs. Since the latter could
be worse, revert this patch.
With previous commit, it's observed that a same MR in rnbd server will
trigger below code path:
-> rxe_mr_init_fast()
|-> alloc map_set() # map_set is uninitialized
|...-> rxe_map_mr_sg() # build the map_set
|-> rxe_mr_set_page()
|...-> rxe_reg_fast_mr() # mr->state change to VALID from FREE that means
# we can access host memory(such rxe_mr_copy)
|...-> rxe_invalidate_mr() # mr->state change to FREE from VALID
|...-> rxe_reg_fast_mr() # mr->state change to VALID from FREE,
# but map_set was not built again
|...-> rxe_mr_copy() # kernel crash due to access wild addresses
# that lookup from the map_set
The backtraces are not always identical.
[1st]----------
RIP: 0010:lookup_iova+0x66/0xa0 [rdma_rxe]
Code: 00 00 00 48 d3 ee 89 32 c3 4c 8b 18 49 8b 3b 48 8b 47 08 48 39 c6 72 38 48 29 c6 45 31 d2 b8 01 00 00 00 48 63 c8 48 c1 e1 04 <48> 8b 4c 0f 08 48 39 f1 77 21 83 c0 01 48 29 ce 3d 00 01 00 00 75
RSP: 0018:ffffb7ff80063bf0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff9b9949d86800 RCX: 0000000000000000
RDX: ffffb7ff80063c00 RSI: 0000000049f6b378 RDI: 002818da00000004
RBP: 0000000000000120 R08: ffffb7ff80063c08 R09: ffffb7ff80063c04
R10: 0000000000000002 R11: ffff9b9916f7eef8 R12: ffff9b99488a0038
R13: ffff9b99488a0038 R14: ffff9b9914fb346a R15: ffff9b990ab27000
FS: 0000000000000000(0000) GS:ffff9b997dc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007efc33a98ed0 CR3: 0000000014f32004 CR4: 00000000001706f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
rxe_mr_copy.part.0+0x6f/0x140 [rdma_rxe]
rxe_responder+0x12ee/0x1b60 [rdma_rxe]
? rxe_icrc_check+0x7e/0x100 [rdma_rxe]
? rxe_rcv+0x1d0/0x780 [rdma_rxe]
? rxe_icrc_hdr.isra.0+0xf6/0x160 [rdma_rxe]
rxe_do_task+0x67/0xb0 [rdma_rxe]
rxe_xmit_packet+0xc7/0x210 [rdma_rxe]
rxe_requester+0x680/0xee0 [rdma_rxe]
? update_load_avg+0x5f/0x690
? update_load_avg+0x5f/0x690
? rtrs_clt_recv_done+0x1b/0x30 [rtrs_client]
[2nd]----------
RIP: 0010:rxe_mr_copy.part.0+0xa8/0x140 [rdma_rxe]
Code: 00 00 49 c1 e7 04 48 8b 00 4c 8d 2c d0 48 8b 44 24 10 4d 03 7d 00 85 ed 7f 10 eb 6c 89 54 24 0c 49 83 c7 10 31 c0 85 ed 7e 5e <49> 8b 3f 8b 14 24 4c 89 f6 48 01 c7 85 d2 74 06 48 89 fe 4c 89 f7
RSP: 0018:ffffae3580063bf8 EFLAGS: 00010202
RAX: 0000000000018978 RBX: ffff9d7ef7a03600 RCX: 0000000000000008
RDX: 000000000000007c RSI: 000000000000007c RDI: ffff9d7ef7a03600
RBP: 0000000000000120 R08: ffffae3580063c08 R09: ffffae3580063c04
R10: ffff9d7efece0038 R11: ffff9d7ec4b1db00 R12: ffff9d7efece0038
R13: ffff9d7ef4098260 R14: ffff9d7f11e23c6a R15: 4c79500065708144
FS: 0000000000000000(0000) GS:ffff9d7f3dc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fce47276c60 CR3: 0000000003f66004 CR4: 00000000001706f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
rxe_responder+0x12ee/0x1b60 [rdma_rxe]
? rxe_icrc_check+0x7e/0x100 [rdma_rxe]
? rxe_rcv+0x1d0/0x780 [rdma_rxe]
? rxe_icrc_hdr.isra.0+0xf6/0x160 [rdma_rxe]
rxe_do_task+0x67/0xb0 [rdma_rxe]
rxe_xmit_packet+0xc7/0x210 [rdma_rxe]
rxe_requester+0x680/0xee0 [rdma_rxe]
? update_load_avg+0x5f/0x690
? update_load_avg+0x5f/0x690
? rtrs_clt_recv_done+0x1b/0x30 [rtrs_client]
rxe_do_task+0x67/0xb0 [rdma_rxe]
tasklet_action_common.constprop.0+0x92/0xc0
__do_softirq+0xe1/0x2d8
run_ksoftirqd+0x21/0x30
smpboot_thread_fn+0x183/0x220
? sort_range+0x20/0x20
kthread+0xe2/0x110
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x22/0x30
Link: https://lore.kernel.org/r/1658805386-2-1-git-send-email-lizhijian@fujitsu.com
Link: https://lore.kernel.org/all/20220210073655.42281-1-guoqing.jiang@linux.dev/T/
Link: https://www.spinics.net/lists/linux-rdma/msg110836.html
Link: https://lore.kernel.org/lkml/94a5ea93-b8bb-3a01-9497-e2021f29598a@linux.dev/t/
Tested-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Reviewed-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>1 parent c2ea08c commit 1e75550
File tree
5 files changed
+104
-162
lines changed- drivers/infiniband/sw/rxe
5 files changed
+104
-162
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 68 | + | |
80 | 69 | | |
81 | 70 | | |
82 | | - | |
| 71 | + | |
| 72 | + | |
83 | 73 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 74 | + | |
87 | 75 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
91 | 79 | | |
92 | 80 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
96 | 84 | | |
97 | 85 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 86 | | |
128 | | - | |
129 | 87 | | |
130 | 88 | | |
131 | 89 | | |
| 90 | + | |
132 | 91 | | |
133 | | - | |
134 | 92 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 93 | + | |
145 | 94 | | |
146 | 95 | | |
147 | 96 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
151 | 103 | | |
152 | 104 | | |
153 | 105 | | |
| |||
164 | 116 | | |
165 | 117 | | |
166 | 118 | | |
167 | | - | |
168 | 119 | | |
169 | 120 | | |
170 | 121 | | |
171 | 122 | | |
172 | 123 | | |
173 | 124 | | |
174 | 125 | | |
| 126 | + | |
175 | 127 | | |
176 | 128 | | |
177 | 129 | | |
| |||
185 | 137 | | |
186 | 138 | | |
187 | 139 | | |
188 | | - | |
| 140 | + | |
189 | 141 | | |
190 | 142 | | |
191 | 143 | | |
192 | 144 | | |
193 | 145 | | |
194 | 146 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 147 | + | |
| 148 | + | |
201 | 149 | | |
| 150 | + | |
| 151 | + | |
202 | 152 | | |
203 | 153 | | |
204 | 154 | | |
| |||
214 | 164 | | |
215 | 165 | | |
216 | 166 | | |
217 | | - | |
| 167 | + | |
218 | 168 | | |
219 | 169 | | |
220 | 170 | | |
221 | 171 | | |
222 | 172 | | |
223 | 173 | | |
| 174 | + | |
224 | 175 | | |
225 | 176 | | |
226 | 177 | | |
227 | 178 | | |
228 | 179 | | |
229 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
230 | 185 | | |
231 | 186 | | |
232 | 187 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 188 | | |
239 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
240 | 194 | | |
241 | 195 | | |
242 | 196 | | |
| |||
250 | 204 | | |
251 | 205 | | |
252 | 206 | | |
253 | | - | |
| 207 | + | |
254 | 208 | | |
255 | 209 | | |
256 | 210 | | |
| |||
268 | 222 | | |
269 | 223 | | |
270 | 224 | | |
271 | | - | |
272 | | - | |
| 225 | + | |
273 | 226 | | |
274 | 227 | | |
275 | 228 | | |
276 | | - | |
277 | 229 | | |
278 | | - | |
279 | | - | |
280 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
281 | 233 | | |
282 | 234 | | |
283 | 235 | | |
284 | 236 | | |
285 | 237 | | |
286 | 238 | | |
287 | | - | |
288 | | - | |
| 239 | + | |
289 | 240 | | |
290 | 241 | | |
291 | 242 | | |
| |||
295 | 246 | | |
296 | 247 | | |
297 | 248 | | |
298 | | - | |
299 | | - | |
| 249 | + | |
300 | 250 | | |
301 | 251 | | |
302 | 252 | | |
| |||
317 | 267 | | |
318 | 268 | | |
319 | 269 | | |
320 | | - | |
| 270 | + | |
321 | 271 | | |
322 | 272 | | |
323 | 273 | | |
| |||
330 | 280 | | |
331 | 281 | | |
332 | 282 | | |
333 | | - | |
| 283 | + | |
334 | 284 | | |
335 | 285 | | |
336 | 286 | | |
337 | 287 | | |
338 | 288 | | |
339 | | - | |
| 289 | + | |
340 | 290 | | |
341 | 291 | | |
342 | 292 | | |
| |||
372 | 322 | | |
373 | 323 | | |
374 | 324 | | |
375 | | - | |
| 325 | + | |
376 | 326 | | |
377 | 327 | | |
378 | 328 | | |
| |||
382 | 332 | | |
383 | 333 | | |
384 | 334 | | |
385 | | - | |
| 335 | + | |
386 | 336 | | |
387 | 337 | | |
388 | 338 | | |
| |||
628 | 578 | | |
629 | 579 | | |
630 | 580 | | |
631 | | - | |
| 581 | + | |
632 | 582 | | |
633 | | - | |
634 | 583 | | |
635 | 584 | | |
636 | 585 | | |
| |||
646 | 595 | | |
647 | 596 | | |
648 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
649 | 605 | | |
650 | | - | |
651 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
652 | 609 | | |
653 | 610 | | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | 611 | | |
680 | 612 | | |
681 | 613 | | |
| |||
695 | 627 | | |
696 | 628 | | |
697 | 629 | | |
| 630 | + | |
698 | 631 | | |
699 | 632 | | |
700 | | - | |
701 | 633 | | |
702 | 634 | | |
703 | | - | |
704 | | - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
705 | 638 | | |
706 | | - | |
707 | | - | |
| 639 | + | |
| 640 | + | |
708 | 641 | | |
0 commit comments