Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Stefan Metzmacher <metze@samba.org>
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: Wed, 24 Sep 2025 12:10:02 -0300	[thread overview]
Message-ID: <20250924151002.GK2547959@ziepe.ca> (raw)
In-Reply-To: <656eacb1-a39f-4b59-99db-5522d102468a@samba.org>

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.

Jason

  reply	other threads:[~2025-09-24 15:10 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 [this message]
2025-09-25 11:21   ` Stefan Metzmacher

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=20250924151002.GK2547959@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=metze@samba.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