UCT/IB: Fix leak if some operations failed after uct_ib_md_open_common()
What
Fix leak if some operations failed after uct_ib_md_open_common().
Why ?
If some operations failed after uct_ib_md_open_common(), then we don't roll back changes done by uct_ib_md_open_common().
How ?
- Introduce
uct_ib_md_close_common()which performance reverse actions which could be done byuct_ib_md_open_common(). - Update
uct_ib_mlx5_devx_md_open()anduct_ib_mlx5dv_md_open()to invokeuct_ib_md_close_common()if some operations failed afteruct_ib_md_open_common()was invoked.
@Artemy-Mellanox can you pls review?
@Artemy-Mellanox @brminich could you review pls?
@Artemy-Mellanox @brminich @yosefe could you review pls?
@yosefe could you review pls?
@yosefe could you review pls?
@Artemy-Mellanox @yosefe could you review pls?
@Artemy-Mellanox @yosefe could you review pls?
@Artemy-Mellanox could you review pls?
@Artemy-Mellanox could you review pls?
@yosefe could you review pls?
@yosefe could you review pls?
@dmitrygx can you pls fix the new conflict?
@dmitrygx can you pls fix the new conflict?
@yosefe thanks for noticing, done
On AWS machine with EFA TCP Nic:
[ PASSED ] 11065 tests.
[ FAILED ] 32 tests, listed below:
[ FAILED ] test_uct_ib_sl_utils.query_ooo_sl_mask, where TypeParam = and GetParam() =
[ FAILED ] ib/test_md.rkey_ptr/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.alloc/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.mem_type_detect_mds/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.mem_query/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.sys_device/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.reg/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.reg_perf/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.reg_advise/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.alloc_advise/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.reg_multi_thread/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.sockaddr_accessibility/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.invalidate/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.reg_bad_arg/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.dereg_bad_arg/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md.exported_mkey/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_md_fork.fork/0, where GetParam() = rdmap0s6
[ FAILED ] alloc_methods/test_mem.md_alloc/0, where GetParam() = 0
[ FAILED ] alloc_methods/test_mem.md_alloc/1, where GetParam() = 2
[ FAILED ] alloc_methods/test_mem.md_alloc/2, where GetParam() = 3
[ FAILED ] alloc_methods/test_mem.md_alloc/3, where GetParam() = 4
[ FAILED ] alloc_methods/test_mem.md_fixed/0, where GetParam() = 0
[ FAILED ] alloc_methods/test_mem.md_fixed/1, where GetParam() = 2
[ FAILED ] alloc_methods/test_mem.md_fixed/2, where GetParam() = 3
[ FAILED ] alloc_methods/test_mem.md_fixed/3, where GetParam() = 4
[ FAILED ] cma/test_uct_perf.envelope/0, where GetParam() = cma/memory
[ FAILED ] cma/test_uct_loopback.envelope/0, where GetParam() = cma/memory
[ FAILED ] ib/test_ib_md.ib_md_umr_rcache/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_ib_md.ib_md_umr_direct/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_ib_md.ib_md_umr_ksm/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_ib_md.relaxed_order/0, where GetParam() = rdmap0s6
[ FAILED ] ib/test_ib_md.aligned/0, where GetParam() = rdmap0s6
@yosefe squashed, could you review pls?