Re: [PATCH for-next] RDMA/hns: Support mmapping reset state to userspace

From: Jason Gunthorpe
Date: Fri Dec 13 2024 - 07:49:16 EST


On Fri, Dec 13, 2024 at 05:37:58PM +0800, Junxian Huang wrote:
> > 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.
>
> Not sure if I got your point, when you said "the userspace goes back to sleep",
> did you mean the ibv_get_async_event() api? Are you suggesting that userspace
> should call ibv_get_async_event() to monitor async events, and when it gets a
> fatal event, it should stop polling CQs and clean up everything instead of
> still waiting for the remaining CQEs?

Yes, it should do that as well. This is wha the devce fatal event is
for.

I'm also saying that any kernel systems calls, like sleeping for CQ
events should start failing too.

Jason