linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Junxian Huang <huangjunxian6@hisilicon.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org, linuxarm@huawei.com,
	linux-kernel@vger.kernel.org, tangchengchang@huawei.com
Subject: Re: [PATCH for-next] RDMA/hns: Support mmapping reset state to userspace
Date: Tue, 10 Dec 2024 09:48:27 -0400	[thread overview]
Message-ID: <20241210134827.GG2347147@nvidia.com> (raw)
In-Reply-To: <f046d3f8-a1c8-0174-8db9-24467c038557@hisilicon.com>

On Tue, Dec 10, 2024 at 02:24:16PM +0800, Junxian Huang wrote:
> 
> 
> On 2024/12/10 3:01, Jason Gunthorpe wrote:
> > On Mon, Oct 14, 2024 at 09:07:31PM +0800, Junxian Huang wrote:
> >> From: Chengchang Tang <tangchengchang@huawei.com>
> >>
> >> Mmap reset state to notify userspace about HW reset. The mmaped flag
> >> hw_ready will be initiated to a non-zero value. When HW is reset,
> >> the mmap page will be zapped and userspace will get a zero value of
> >> hw_ready.
> > 
> > This needs alot more explanation about *why* does userspace need this
> > information and why is hns unique here.
> > 
> 
> Our HW cannot flush WQEs by itself unless the driver posts a modify-qp-to-err
> mailbox. But when the HW is reset, it'll stop handling mailbox too, so the HW
> becomes unable to produce any more CQEs for the existing WQEs. This will break
> some users' expectation that they should be able to poll CQEs as many as the
> number of the posted WQEs in any cases.

But your reset flow partially disassociates the device, when the
userspace goes back to sleep, or rearms the CQ, it should get a hard
fail and do a full cleanup without relying on flushing.

> We try to notify the reset state to userspace so that we can generate software
> WCs for the existing WQEs in userspace instead of HW in reset state, which is
> what this rdma-core PR does:

That doesn't sound right at all. Device disassociation is a hard fail,
we don't try to elegantly do things like generate completions. The
device is dead, the queues are gone.

Jason

  reply	other threads:[~2024-12-10 13:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 13:07 [PATCH for-next] RDMA/hns: Support mmapping reset state to userspace Junxian Huang
2024-11-04  8:31 ` Leon Romanovsky
2024-12-09 19:01 ` Jason Gunthorpe
2024-12-10  6:24   ` Junxian Huang
2024-12-10 13:48     ` Jason Gunthorpe [this message]
2024-12-13  9:37       ` Junxian Huang
2024-12-13 12:49         ` Jason Gunthorpe
2024-12-17  6:09           ` Junxian Huang

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=20241210134827.GG2347147@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=huangjunxian6@hisilicon.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=tangchengchang@huawei.com \
    /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 NNTP newsgroup(s).