From: sashiko-bot@kernel.org
To: "Edward Srouji" <edwards@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/mlx5: Free software WCs left on wc_list at CQ destroy
Date: Tue, 03 Nov 2026 17:00:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-195767@kernel.org> (raw)
In-Reply-To: <20261103-free-sw-wcs-v1-1-3885ce449012@nvidia.com>
> Software WCs generated by mlx5_ib_generate_wc() are allocated one at a
> time and linked onto cq->wc_list. The only thing that ever frees them is
> poll_soft_wc(), i.e. a consumer actually reaping them. If the CQ is
> destroyed while entries are still linked, those allocations are leaked.
>
> Drain the list in destroy_cq_kernel(). Nothing can be walking wc_list by
> then: the poll context is the only walker, notify_work the only thing
> that can re-arm it, and both are stopped before post_destroy_cq() runs.
>
> destroy_cq_kernel() is also the error unwind for mlx5_ib_create_cq(), so
> move the INIT_LIST_HEAD() of wc_list up next to the other list
> initialisations, ahead of anything that can jump to err_cqb. The driver
> object is zero-allocated, and list_for_each_entry_safe() evaluates the
> next linkage before testing the loop condition, so draining a wc_list
> that is still all zeroes would oops.
>
> Fixes: 25361e02c448 ("IB/mlx5: Generate completions in software")
> Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
> Signed-off-by: Edward Srouji <edwards@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-free-sw-wcs-v1-1-3885ce449012@nvidia.com?part=1
next prev parent reply other threads:[~2026-11-03 17:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 16:55 [PATCH rdma-next] RDMA/mlx5: Free software WCs left on wc_list at CQ destroy Edward Srouji
2026-11-03 17:00 ` sashiko-bot [this message]
2026-11-04 14:01 ` Leon Romanovsky
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=sashiko-outbox-195767@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=edwards@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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