From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793725255; b=LQpTKw9+RwoGzPpsUFkOei/qOUD2FNKM9GRYrSsYw86cIvet8xXPAmH9p1OcWFtcqMfd K42J36B68eliQivgKZovPgYaELVLVrrh/S2eJ4MQyzyhJsbDeOsRKRCp63M52hD8boQcc Ieiod57Ba2/bR3UFsWJFyoQDw6Xk11SQDvzrxoPlA9xR59vOlvHO57X9eI3VCOcCLAoOY HxUKkSUh8gt1OJs8iJ2YEup1ZIBigp+AybnqghoVuTa8MU/5XdDQ1IBpeMFSwYmDpFAOY X5YeEUorfYr3d41e4ADDbCCNp+1w4/UI5eXGw4JyW9kSRljHWudISInDOcM3mE+w1nA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793725255; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=zMCR2ykLqdVdO5l/pB5CNjsY5OgHzbyfvmtEbTuFp/Y=; b=3aYqt4f/bOJC37W2Z4FZCRV1E98gAtlLgtoej+GH6aVC/0/o2K/ghpf2ht3EnxahUBD4 XXuMJPBns9bhU3lQsP+dm7O6AEnA+fftzRo7vfixDo3bL29y2ulETxPeFpAuZLk/Kpmkk ValOFw6gtAq8DkSUiW0Sr3KVNMA89p02bk7lIQ9BRp2W68KSVlQjPEsWjg6pre0K+CtnF qmZ/pfL5genWZDQc8IMSQsSWz0Ie3DKe98/rwKBPbjo3+cwBiBSDqPHQrEsIMdAQlNyhx /eI2svrFq8EHiynbn5cOC7voHiz3O1OOqKYJOaN0k/UMlP/KAogr/2wJh5hNoJf1YuQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KcWrROPU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8549606A324 for ; Tue, 3 Nov 2026 17:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KcWrROPU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 505BD1F000C1; Tue, 3 Nov 2026 17:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793725254; bh=zMCR2ykLqdVdO5l/pB5CNjsY5OgHzbyfvmtEbTuFp/Y=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=KcWrROPUf0fxs56kftr5XPFq+2cprMG9U5shAMTTncUTNrBDEwnn6gxl6xF28ikue 3Y12/sm0sDhOZ8isYSGJSLaSleJ77BSuHAClb5z+F9eeWdzRKJb/C5q4XrY4RJyqM6 v+tX83fcYBWmA2KUl6GriJntEL97vHhstf5zbzTRlIFfe7DVPPnkoolaXndZlmCAC7 tri9vr6/XKbGzKyydc9+gZf863io+rHZRImMxky3ZJlMtf4LzPkMze5msDn1sdPiIT EPPaWzPiH2QlWZc7jWOC7LKRYrK18CQiWfoe7bBG7kb1uwt1KtLk8VRHxy1oyUZxsZ 5TfvtgaYKOA4A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH rdma-next] RDMA/mlx5: Free software WCs left on wc_list at CQ destroy Reply-To: sashiko-reviews@lists.linux.dev To: "Edward Srouji" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261103-free-sw-wcs-v1-1-3885ce449012@nvidia.com> References: <20261103-free-sw-wcs-v1-1-3885ce449012@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 03 Nov 2026 17:00:53 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > 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. >=20 > 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. >=20 > 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. >=20 > Fixes: 25361e02c448 ("IB/mlx5: Generate completions in software") > Reviewed-by: Maher Sanalla > Signed-off-by: Edward Srouji Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261103-free-sw-wc= s-v1-1-3885ce449012@nvidia.com?part=3D1