From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B99D0C433F5 for ; Fri, 13 May 2022 05:47:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377131AbiEMFrg (ORCPT ); Fri, 13 May 2022 01:47:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377127AbiEMFre (ORCPT ); Fri, 13 May 2022 01:47:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F4FF4C402 for ; Thu, 12 May 2022 22:47:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2EE3161B8F for ; Fri, 13 May 2022 05:47:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8E30C34100; Fri, 13 May 2022 05:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652420852; bh=YsgL1I9t2EMaw1F+ImkOdOX0X71ecmG8hE1TuD6mlmk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PoKBBGhNm65xRzHfVOpupQrpzZzeAlK1Xw4eikDfZ6sd2ZhM/xvjoHxHZNBg51c5D sX1/0VI8vTCBTUCoqg+kQTkq6x07zYyJ1V+VCnV6A5lJV8A94ZaHyDQoWTbxD3ePs3 IUCXZDGZSscw21VxwBWnpEMZGcuaPWFQyo670z/iDep0PUBkV4PMFmw4r7quQ99NB9 4h3c3+B7PnY56wnW835Sm3W+WjdegmrZOKGRe2Pj5FGP/W5jFoSzNsXw2eIqTtpfBm Rd0lZJBed7c/OVNIvOcWZwSIrQnpZvp4ICPDGc3b6ALjEeIgovhiMU0yduk4+xXnFP evBfDCFWwA9gw== Date: Fri, 13 May 2022 08:47:28 +0300 From: Leon Romanovsky To: Jason Gunthorpe Cc: Jakub Kicinski , davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, johannes@sipsolutions.net, pablo@netfilter.org, laforge@gnumonks.org, Jason@zx2c4.com Subject: Re: [RFC net-next] net: add ndo_alloc_and_init and ndo_release to replace priv_destructor Message-ID: References: <20220511191218.1402380-1-kuba@kernel.org> <20220511234328.GO49344@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220511234328.GO49344@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, May 11, 2022 at 08:43:28PM -0300, Jason Gunthorpe wrote: > On Wed, May 11, 2022 at 12:12:18PM -0700, Jakub Kicinski wrote: > > Old API <...> > I would be happier if netdev was more like everything else and allowed > a clean alloc/free vs register/unregister pairing. The usual lifecycle > model cast to netdev terms would have the release function set around > alloc_netdev and always called once at free_netdev. > > The caller should set the ops and release function after it has > completed initializing whatever its release will undo, similare to how > device_initialize()/put_device works. Exactly, it will give much clearer picture of netdev life cycle than it is now. Thanks