Does ib_dereg_mr require an additional IB_WR_LOCAL_INV?
Subsystems (3)
Hi,
I'm trying to understand (and hopefully simplify) the code in fs/smb/client/smbdirect.c, related to 'struct ib_mr' cleanup on disconnect.
Assume we have the following sequence of calls:
...ib_alloc_mr()ib_dma_map_sg()ib_map_mr_sg()ib_post_send(IB_WR_REG_MR)
On cleanup we currently us something like this:
ib_drain_qp()init_completion()ib_post_send(IB_WR_LOCAL_INV)wait_for_completion()...ib_dereg_mr()ib_drain_qp() // againrdma_destroy_qp();ib_destroy_cq(revc_cq)ib_destroy_cq(send_cq)ib_dealloc_pd()rdma_destroy_id()
Now I'm wondering if the following is really required:init_completion() ib_post_send(IB_WR_LOCAL_INV) wait_for_completion()...
It would make things much easier if not...
Thanks for any possible hint :-)
metze
Quoted 27 lines · Stefan Metzmacher
Hi,
I'm trying to understand (and hopefully simplify) the code in
fs/smb/client/smbdirect.c, related to 'structib_mr' cleanup on disconnect.Assume we have the following sequence of calls:
...
ib_alloc_mr()ib_dma_map_sg()ib_map_mr_sg()ib_post_send(IB_WR_REG_MR)On cleanup we currently us something like this:
ib_drain_qp()init_completion()ib_post_send(IB_WR_LOCAL_INV)wait_for_completion()...ib_dereg_mr()ib_drain_qp()// againrdma_destroy_qp();ib_destroy_cq(revc_cq)ib_destroy_cq(send_cq)ib_dealloc_pd()rdma_destroy_id()
Quoted 4 lines
Now I'm wondering if the following is really required:
init_completion()ib_post_send(IB_WR_LOCAL_INV)wait_for_completion()...
I would say IB_WR_LOCAL_INV is redundent with the ib_dereg_mr(). There is no need to invalidate something that will be de-registered in a few moments.
Jason
Am 24.09.25 um 17:10 schrieb Jason Gunthorpe:
Quoted 28 lines · Stefan Metzmacher
Quoted 27 lines
Hi,
I'm trying to understand (and hopefully simplify) the code in
fs/smb/client/smbdirect.c, related to 'structib_mr' cleanup on disconnect.Assume we have the following sequence of calls:
...
ib_alloc_mr()ib_dma_map_sg()ib_map_mr_sg()ib_post_send(IB_WR_REG_MR)On cleanup we currently us something like this:
ib_drain_qp()init_completion()ib_post_send(IB_WR_LOCAL_INV)wait_for_completion()...ib_dereg_mr()ib_drain_qp()// againrdma_destroy_qp();ib_destroy_cq(revc_cq)ib_destroy_cq(send_cq)ib_dealloc_pd()rdma_destroy_id()
Quoted 8 lines
Quoted 4 lines
Now I'm wondering if the following is really required:
init_completion()ib_post_send(IB_WR_LOCAL_INV)wait_for_completion()...I would say
IB_WR_LOCAL_INVis redundent with theib_dereg_mr(). There is no need to invalidate something that will be de-registered in a few moments.
Thanks!