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=1794154488; b=ZcRCgZekxGGIPOcVjfPcMVZNfIeTZw3lYYvpVPm0fPwu8/GktBcuH0ix49X56DfJbJfp djjMo3ORSiLg/P2aslfXLjTBHlk1IRSAkz8472DD4013t17miODqO6oRw2E+Ou+VUxJ99 VSAV1Vm/jxfmoPvP58DoxMIHSZOG1KMovSIsZnDaWtq/gepbBQtFXe2f3atqFycKlzDBN J96JVCfOB5IZEe4U69qEhghBTnZs7cFH2Ta5HcAS1lfeXVfQmEuGrCPoA6D9Ocr173eqQ 1MjiTPaesssvZ8PuafyieVmx/sHnLozFjz++0yUIPrFYPK4bp/0QhBHi783sY/Nu5LA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794154488; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=LCKQ56mDdb1iOHCWvmT0VqOMoSE6/zdo3UsASideFKg=; b=PMVl9FTHLEogTvh8W01U3FZSwUqDmtON3x462lKAZ3CSzXEErntYskBtgx7KMCsuhAbg uE3Lm2fvXsA1+5G/GIfyZFjiPRO0DK0RDsi+Yz0ZiWjyhMAHNW2hG6nbSOHnZ2Xyk3Q75 UOoQMUrdrCvsIyX7+FojT0EINQQ0eVVU5IByDVaxuxuFwTTxugsi7zxiR0pJ1g6bTfu5+ OuOOqpJU6DksWfO+oKJMzHOpmkzXZgukwO51kKUlNNstQ9z03KqvjANqXWB2Ri8lCtBSF NfqDw3T1YJAJhwG2eJdBUmVM99mrBj+njg/l4kuFhYTbw6snHHO5wbpI6OJnUwxJ34w== 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="Mn+1kv/T"; 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 4BE68606A31C for ; Sun, 8 Nov 2026 16:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Mn+1kv/T Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCC091F0089F; Sun, 8 Nov 2026 16:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794154487; bh=LCKQ56mDdb1iOHCWvmT0VqOMoSE6/zdo3UsASideFKg=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Mn+1kv/TH6l+0A2fmGuIalbFu+0PE6iT3DAxGoFJSo1KRJtYVx+puxCscqT5IU2lS FHVeb/dc1iS3UPkRJgneYcOZx7mYqe6jwXfNenwOXAE9p/91Rh1IuEU54/fAtwQVQc 0Iwje1uMnJ6zPOWFBXfrST4GSaDXRVKPeH7GwsSjA0QTYPKqDSVHCMLTXsDdQ6Ghhm AcfATno9FVw35GiRtc2sEVAHuJ0gPXNJlWKe4JjCItSkG6hfZjcjOWTUtECtET/qsD AX98FZgG+dzLhO+1DAkdU9Hspy+HVeUGoHmmUEW6vdwwHT8GzJRaFzwyLwudUW7SEI j0B+keAFVS+HA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH rdma-next v2] RDMA/mlx5: Warn on pending software WCs at CQ destroy Reply-To: sashiko-reviews@lists.linux.dev To: "Edward Srouji" Cc: linux-rdma@vger.kernel.org In-Reply-To: <20261108-free-sw-wcs-v2-1-d1e6d80d2746@nvidia.com> References: <20261108-free-sw-wcs-v2-1-d1e6d80d2746@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 08 Nov 2026 16:14:47 +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, linked > onto cq->wc_list and only freed when a consumer polls them. Anything > still on the list when the CQ is destroyed would be leaked. >=20 > This cannot happen with in-tree users. Soft WCs are only generated for > send completions of the mlx5 GSI QP, and ib_mad is the only creator of > GSI QPs. Every MAD send holds a reference on its agent until its send > completion has been processed, unregister_mad_agent() waits for those > references, and ib_mad_port_close() frees the CQ only after all agents > on the port are unregistered. Since poll_soft_wc() frees each soft WC > before its completion handler runs, wc_list is empty by then. >=20 > Add a WARN_ON() so that a consumer violating this assumption is caught > instead of silently leaking memory. >=20 > Signed-off-by: Edward Srouji Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261108-free-sw-wc= s-v2-1-d1e6d80d2746@nvidia.com?part=3D1