From: Stefan Metzmacher <metze@samba.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>
Subject: Re: Does ib_dereg_mr require an additional IB_WR_LOCAL_INV?
Date: Thu, 25 Sep 2025 13:21:22 +0200 [thread overview]
Message-ID: <cf4e9b44-e373-4f1c-afcd-51f97da65145@samba.org> (raw)
In-Reply-To: <20250924151002.GK2547959@ziepe.ca>
Am 24.09.25 um 17:10 schrieb Jason Gunthorpe:
> On Tue, Sep 23, 2025 at 11:09:48PM +0200, Stefan Metzmacher wrote:
>> 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() // again
>> rdma_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()...
>
> 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.
Thanks!
prev parent reply other threads:[~2025-09-25 11:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 21:09 Does ib_dereg_mr require an additional IB_WR_LOCAL_INV? Stefan Metzmacher
2025-09-24 15:10 ` Jason Gunthorpe
2025-09-25 11:21 ` Stefan Metzmacher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf4e9b44-e373-4f1c-afcd-51f97da65145@samba.org \
--to=metze@samba.org \
--cc=jgg@ziepe.ca \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).