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 BE92634EF1E for ; Wed, 28 Jan 2026 12:35:50 +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=1769603750; cv=none; b=gkV/uOKbGT++EDnbEbhaUFru/Xdvkgsof0eCg/xK2Y/6OKyewk/HNu/8JSnay8Smc0vrdEqHJMFtRNIgAoxkTdNjRMcIlg+xvjY5+wBgyFS8up0gWNyr/WWHxAbuqEY5LB/n4YbROQfIL1ycmzqwMxYb1oxfQmQWvMjwhcJnC/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769603750; c=relaxed/simple; bh=2hB3mxmxd1PJsgoUfw0PYv8ForcxzI42wf0pNXzt5JQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hjzfq3C6UZQX3jchZ8JAWcWAuNxkKVhBcxBUk48BsTCrNhROslXRSR814Pszkw9DznL+tPfYtpCkCvmZsUHajnBLM3q/YHfByXQdv8cRkNmyympiPCeAq3k2XOA/FQ7mpifSWDD3bmB7ICFeXnecG0AKH8NEAJt91gJxvXgu2P8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E/cCCv2F; 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="E/cCCv2F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEC8BC116C6; Wed, 28 Jan 2026 12:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769603750; bh=2hB3mxmxd1PJsgoUfw0PYv8ForcxzI42wf0pNXzt5JQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E/cCCv2F7IVATYMpVDys0ekpoa90PuotWl79Y5+Nkd2vdQY1Qjgg2AKdUbkqDFzqR eAZx+jd82qWzoGzRde4dt49gJJBd/O96OUiqMrRIASu5w/oSLbC5ckic3dOgcA3FYk 1QyfW/F5siqVLktTHUaEUP/olmaV0rZxOtEyRLoZhbV78M8wnq028i9htqRLqaaycC nSYYIqP9Pk6uwCEgNX1ZatKXNRIAFLh909fm8o0V1ZSQZAzfzRwm/tg1hnhC9cSZHY 4/lEqMrsa4oscEmkoVrlJP8cuSmzoE9cjsMbhx/GufKLM8WXLr504p9EQ1Cy4DjJwm ka8oPv5OGkW5g== Date: Wed, 28 Jan 2026 14:35:46 +0200 From: Leon Romanovsky To: Tetsuo Handa Cc: Steffen Klassert , Herbert Xu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Ilan Tayari , Guy Shapiro , Yossi Kuperman , Network Development , Sabrina Dubroca Subject: Re: [PATCH net] xfrm: always flush state and policy upon NETDEV_DOWN/NETDEV_UNREGISTER events Message-ID: <20260128123546.GC40916@unreal> References: <1de734e2-1da6-4b5c-8e03-66af7f88d074@I-love.SAKURA.ne.jp> <20260128102404.GC12149@unreal> <83d06aca-4437-4d61-9c99-ac19b797a243@I-love.SAKURA.ne.jp> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83d06aca-4437-4d61-9c99-ac19b797a243@I-love.SAKURA.ne.jp> On Wed, Jan 28, 2026 at 07:44:02PM +0900, Tetsuo Handa wrote: > On 2026/01/28 19:24, Leon Romanovsky wrote: > > I think this can work, but IMHO the more robust approach is to ensure that all > > states and policies are removed when the NETIF_F_HW_ESP feature bit is cleared. > > The transaction will become complicated, for dev->features manipulation > function can fail. Line above returning NOTIFY_OK, check that NETIF_F_HW_ESP is cleared, and remove everything. > > > > > Would it be possible to handle this in NETDEV_FEAT_CHANGE? > > > > Is there a guarantee that xfrm_dev_event(NETDEV_FEAT_CHANGE) is called > regardless of other callback functions, for it can return NOTIFY_BAD ? I don't know. Thanks > >