From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CEC0375F7D; Thu, 12 Mar 2026 02:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773281100; cv=none; b=ZxezMqBWvn8BAcIl/aY8iZFYcw3StzNJmWqoaHmppTwFfGbaJoB/bYUZoy5NHzRGqOEEwvuO0ANbVI+qZH3a2AF9BJS+cBCcQjLjJde71X2pJcgRT0ExgSnfs8XbzG+YXe87sD0olIxtbaTeqVcuJa6h5fhLmVpiiM4KFjdC6rQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773281100; c=relaxed/simple; bh=LBDqdRbRH1XE6aUpZ1Y24sieKCpeFHI1paVWNbe8EdQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UMOolmRgS0CCccWdwlXdF64rR1wLu8kBccmzuSUSNP1zDsRf8FzfBhRMDeGL2bCG92ZcqUHnGWVZ30rDmbVN2SyGAw57BnX/2VgKwjuG280NPAJPi3LeQDl3ZXVqo4pY4MY4BCfTLVsQ3jwaerD48aHlNEnJ3yqwOSNkcdLcwZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cS2prP0M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cS2prP0M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59342C19421; Thu, 12 Mar 2026 02:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773281099; bh=LBDqdRbRH1XE6aUpZ1Y24sieKCpeFHI1paVWNbe8EdQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cS2prP0MeJ9Q003JCXBqmgpB4RjaAmJR5X2vPoP9uqSESZyiTe3YR+6mTvl2tzUMJ h3SDXgNgqsRZw52J4nONTj6XGYP6ZmlZv23DLD9hZFz/pfTJKWbKiQkQKxd+zpK5yh xadpWrVCW8xd3CXQRtJCyHSG9Wb5+++kcpvpQsxhTjEkRxa+up+3hXdVH9mjTpEOET diMBUwMtMK7vXldPJpNC/ocEnbYtZs9ZeMFzn0/ZdLgrk2CCDk8RZDa3VhndF4ID2E LphOj+rVTVYRFAelnQ2bcjDf603J99RcvSRcliVeA2UOeBUGtr9ny+iDMcEFt4qIGy uGlTPFgU/WpYw== Message-ID: Date: Wed, 11 Mar 2026 20:04:58 -0600 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/4] RDMA/nldev: Add dellink function pointer Content-Language: en-US To: "Yanjun.Zhu" , Leon Romanovsky Cc: jgg@ziepe.ca, zyjzyj2000@gmail.com, shuah@kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260310020519.101415-1-yanjun.zhu@linux.dev> <20260310020519.101415-2-yanjun.zhu@linux.dev> <20260310190140.GL12611@unreal> <5700c718-d10e-4b23-adfc-c14ee1930b18@linux.dev> <20260311085434.GW12611@unreal> <6a8b0983-a198-470a-8125-b0133ccb7032@linux.dev> From: David Ahern In-Reply-To: <6a8b0983-a198-470a-8125-b0133ccb7032@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/11/26 4:01 PM, Yanjun.Zhu wrote: > Got it. The commit log explains how the netdev_notifier mechanism is netdev notifiers are the NETDEV_UNREGISTER and friends. This dellink handler is not related to that; this is an IB stack thing when the rxe link is removed. > used to clean up the related resources. > > In the source code, additional comments have been added to explain how > the dellink operation for rxe is triggered. For iWARP, this change > should not make any difference because iWARP does not implement the > dellink function. > > The commit is shown below. Please take a look and share your comments. > If you agree, I will send out the latest commits out very soon. > > From c05038dcdf69c5985837736a8926ba76d9f3e8e4 Mon Sep 17 00:00:00 2001 > From: Zhu Yanjun > Date: Fri, 23 Sep 2022 16:52:45 +0000 > Subject: [PATCH 1/1] RDMA/nldev: Add dellink function pointer > > The newlink function pointer was previously added to support > dynamic RDMA link creation. In the RXE driver, this path creates > a transport socket listening on port 4791. Consequently, a dellink > function pointer is required to ensure these sockets are properly > closed when a user administratively removes a link via rdma link > delete . > > Furthermore, RXE does not rely solely on this nldev path for resource > management. It also monitors the underlying net_device state via a > registered netdev_notifier. The rxe_net_event callback serves as a > fallback mechanism to ensure that transport sockets are forcibly closed > and all resources are released even if dellink is not explicitly called > (e.g., if the parent NIC interface is removed or the driver is forcefully > unloaded). IMHO, this explanation belongs in the patch that implements dellink for rxe. This patch adds the handler to allow link implementations to cleanup any resources created by newklink as needed.