mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haakon Bugge <haakon.bugge@oracle.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Sean Hefty <shefty@nvidia.com>, Jacob Moroni <jmoroni@google.com>,
	Leon Romanovsky <leon@kernel.org>,
	Vlad Dumitrescu <vdumitrescu@nvidia.com>,
	Or Har-Toov <ohartoov@nvidia.com>,
	Manjunath Patil <manjunath.b.patil@oracle.com>,
	OFED mailing list <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH for-next] RDMA/cm: Rate limit destroy CM ID timeout error message
Date: Thu, 16 Oct 2025 16:43:16 +0000	[thread overview]
Message-ID: <6244F8C9-2067-4A8A-8DCD-02A4A2D117F6@oracle.com> (raw)
In-Reply-To: <20251016161229.GM3938986@ziepe.ca>



> On 16 Oct 2025, at 18:12, Jason Gunthorpe <jgg@ziepe.ca> wrote:
> 
> On Thu, Oct 16, 2025 at 03:25:15PM +0000, Haakon Bugge wrote:
>> 
>> 
>>> On 15 Oct 2025, at 20:45, Jason Gunthorpe <jgg@ziepe.ca> wrote:
>>> 
>>> On Wed, Oct 15, 2025 at 06:34:33PM +0000, Sean Hefty wrote:
>>>>>> With this hack, running cmtime with 10.000 connections in loopback,
>>>>>> the "cm_destroy_id_wait_timeout: cm_id=000000007ce44ace timed out.
>>>>>> state 6 -> 0, refcnt=1" messages are indeed produced. Had to kill
>>>>>> cmtime because it was hanging, and then it got defunct with the
>>>>>> following stack:
>>>>> 
>>>>> Seems like a bug, it should not hang forever if a MAD is lost..
>>>> 
>>>> The hack skipped calling ib_post_send.  But the result of that is a
>>>> completion is never written to the CQ.
>> 
>> 
>> Which is exactly the behaviour I see when the VF gets "whacked". This is from a system without the reproducer hack. Looking at the netdev detected TX timeout:
>> 
>> mlx5_core 0000:af:00.2 ens4f2: TX timeout detected
>> mlx5_core 0000:af:00.2 ens4f2: TX timeout on queue: 0, SQ: 0xe31ee, CQ: 0x484, SQ Cons: 0x0 SQ Prod: 0x7, usecs since last trans: 18439000
>> mlx5_core 0000:af:00.2 ens4f2: EQ 0x7: Cons = 0x3ded47a, irqn = 0x197
>> 
>> (I get tons of the like)
>> 
>> There are two points here. All of them has "SQ Cons: 0x0", which to me implies that no TX CQE has ever been polled for any of them.
> 
>> The other point is that we do _not_ see "Recovered %d eqes on EQ
>> 0x%x" (which is because mlx5_eq_poll_irq_disabled() always returns
>> zero), which means that either a) no CQE has been generated by the
>> HCA or b) a CQE has been generated but no corresponding EQE has been
>> written to the EQ.
> 
> Lost interrupts/cqe are an obnoxiously common bug in virtualization
> environments. Be sure you are running latest NIC firmware. Be sure you
> have all the qemu/kvm fixes.

Sorry, may be I did not mention it, but I run BM with a bunch of VFs instantiated.

> But yes, if you hit these bugs then the QP gets effectively stuck
> forever.
> 
> We don't have a stuck QP watchdog for the GMP QP, IIRC. Perhaps we
> should, but I'd also argue if you are loosing interrupts for GMP QPs
> then your VM platform is so broken it won't succeed to run normal RDMA
> applications :\

Most probably. But the intent of mlx5e_tx_reporter_timeout_recover() is to recover, but it does not manually poll the CQ. What I mean, if there are no EQEs to recover, but the CQ is non-empty, should they somehow be handled?

> At the end of the day you must not have these "TX timeout" type
> errors, they are very very serious. Whatever bugs cause them must be
> squashed.
I can agree to that :-) But, life is not perfect.

> 
>>>> The state machine or
>>>> reference counting is likely waiting for the completion, so it knows
>>>> that HW is done trying to access the buffer.
>>> 
>>> That does make sense, it has to immediately trigger the completion to
>>> be accurate. A better test would be to truncate the mad or something
>>> so it can't be rx'd
>> 
>> As argued above, I think my reproducer hack is sound and to the point.
> 
> Not quite, you are just loosing CQEs. We should never loose a CQE.
> 
> Yes perhaps your QP can become permanently stuck, and that's bad. But
> the fix is to detect the stuck QP, push it through to error and drain
> it generating all the err CQs without any loss.

In my opinion, it is not a QP that is stuck. It is the VF. I had an example above where I ran into this issue (using RDS), but creating a connection from user-space using ib_send_bw, the newly created cm_id also got stuck, presumable due to the lack of CQE, EQE, or interrupt.

> To better model what you are seeing you want to do something like
> randomly drop the GMP QP doorbell ring, that will cause the QP to get
> stuck similar to a lost interrupt/etc.


Well, I started off this thread thinking a cm_deref_id() was missing somewhere, but now I am more inclined to think as you do, this is an unrecoverable situation, and I should work with NVIDIA to fix it.


Thxs, Håkon



  reply	other threads:[~2025-10-16 16:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12 10:05 Håkon Bugge
2025-09-12 19:27 ` yanjun.zhu
2025-09-15  7:43 ` Leon Romanovsky
2025-09-15  9:44   ` Haakon Bugge
2025-09-16 14:18 ` Jason Gunthorpe
2025-09-16 14:36   ` Jacob Moroni
2025-09-25 11:29     ` Haakon Bugge
2025-10-13 14:04       ` Haakon Bugge
2025-10-15 11:38         ` Haakon Bugge
2025-10-15 16:49           ` Jason Gunthorpe
2025-10-15 18:34             ` Sean Hefty
2025-10-15 18:45               ` Jason Gunthorpe
2025-10-16 15:25                 ` Haakon Bugge
2025-10-16 16:12                   ` Jason Gunthorpe
2025-10-16 16:43                     ` Haakon Bugge [this message]
2025-10-16 18:01                       ` Jason Gunthorpe
2025-10-21 16:32                         ` Haakon Bugge

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=6244F8C9-2067-4A8A-8DCD-02A4A2D117F6@oracle.com \
    --to=haakon.bugge@oracle.com \
    --cc=jgg@ziepe.ca \
    --cc=jmoroni@google.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=manjunath.b.patil@oracle.com \
    --cc=ohartoov@nvidia.com \
    --cc=shefty@nvidia.com \
    --cc=vdumitrescu@nvidia.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

all inboxes | Powered by JetHome®