Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp588224lqh; Thu, 28 Mar 2024 10:11:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdWOt07+8XMPUBPL2QkwtFEBNJ+um4d2dshwOmosprkAu8ONbZE+Dpf4xJCm94MQMvVJsmWyefaVA7cHSpcVtUTB2QFZ6Q/eM1N6JlWg== X-Google-Smtp-Source: AGHT+IEn2VlfU8XKWC4D3ixpeXcpr6M1qvfT90tlozP8nRxhehEhBPFjNHuZXOe6K3s1jRzEcGDT X-Received: by 2002:a17:906:4f10:b0:a4a:3912:9ecc with SMTP id t16-20020a1709064f1000b00a4a39129eccmr2483039eju.27.1711645890087; Thu, 28 Mar 2024 10:11:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711645890; cv=pass; d=google.com; s=arc-20160816; b=fuBGoYa0vBher6xZMH6H2JcxBljdzKAtEqfX/9ATHdKR8jJy+oQaqfHXGCEmzRVqzP IbiSP8hKawUZRpWh8mOhXm5Tz6X7Jv6UdSc6gf5CKGpT14o/x7jSjx4I0n3nN9O/o25L F4KLCGvbleUBK9DaC3dK/IHYVJHQoumtFnDQH1iboRE5fIdk6rvV3LZ3a5zYPmoiHDDl vZGXImh6CNqNn31C/SCZGHEtdQNgX76PGfyKkGlZhHKxaA5JZ7RjTmYu7ShF8gJT2mjT laIAWcMoaFt53drZD1+we7o9me6+32oKFQ1TKN++zb3C5qPPNM729lc+WoRJxhLidONM fsnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=GXdCfE7s/bNVHx97vok1nwkG9SbToiToTRH3WIlrTDU=; fh=sWq8HRQwg7VV3w3hZddr2jBHXi+TwNapGNmYGt/TAbE=; b=vAu7NmTOYlc5YbLC23KjuQxvrtD7RGqDyMoaxJMYQZB3jXQLefnFzTezZAsmpNnq9s LgPyTBPSsAROm0gUus7rSnjFZ5xvlDrxH1UOhmnJIjginaja9pTuJAZOSF9DoVUmxEOd 5fwPxDY79tyr0fcfrFfRBbgLBN7pN90OsOBjc5qB8F89+PtyVWqB1BRc+NCqS04YlKog sEBfj9kONJNKtcL4pN8a643K/9kPHsN0puAeQ+dICttRqueJRU/k82BqtwUbIn2TVqVj abkqLIyzzyJsE/4sY1JjoEHDPHumBsTYjKtr7iy7g7zFldPo9eukDmw5hhd8hbyQo4Mn WHcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JELJL5bi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123348-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cm22-20020a170906f59600b00a47063ddeadsi999453ejd.376.2024.03.28.10.11.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:11:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123348-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JELJL5bi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123348-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A24B81F29134 for ; Thu, 28 Mar 2024 17:11:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A4255A780; Thu, 28 Mar 2024 17:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JELJL5bi" 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 A0FBC1CD24; Thu, 28 Mar 2024 17:10:55 +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=1711645855; cv=none; b=tiKzBUI5sd7YLUEoqXt51P55k5X0Ak9ZG/FoHoWKBQ10cheB281zePyKBclTFyNYLNBzH1M0qYuw+E1NqP/zkp8kca4D8cIlafhCfJfG/EhinutqA9rQ3UK5Q/pOcxBiq98SKralnA7GkFpXmHD3iOd0omLRFO7aiyk9GJpRk7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711645855; c=relaxed/simple; bh=R8LpNjl8m4fubf+pY59w77ALbveltFnOc5DHBVdn/08=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IrufnF3cBqCw8an148n/s/s8kx5J1wVzDdbtTb1GsK8sbcRFk63dbe3Vytve3G3/mnJekgL/hD61qAm2GMh9jdYDC/PUU50D+uIvLGLFaPGo889nIPmEFiP19w8NTEs8FBRft4Ke2O5V4EvSHaOt5/P/DfuxSMg/LnXk60ZwZy0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JELJL5bi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61A6FC43390; Thu, 28 Mar 2024 17:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711645855; bh=R8LpNjl8m4fubf+pY59w77ALbveltFnOc5DHBVdn/08=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JELJL5biHYV9q1YEvBoGXM2gCd44ho1PIKaxqhn+7X3Na5tue1FvPcWVDknuu2lrA gbyj1UXAxEMAvtd/3/ydrcp2cHV/45zjhGh1qYcVHG/CBdpgZfZ5btt+/YSY7d8oXH Kkm2E2Rck7d5sz+y9LYoMMDfY3TmxLUrutcP5ZDY58ez0E/yEVL2zNHuYT2/KPwi29 U+k2AUYv3B6oxuRLfsYLzW5V3hGXRDjJbT6qYvN2j2BR7pQUltvrDqPtE9ehKNOUrF puqLKyxESL0/eyelmzhhwLzztquc01WxLX9p9xoYUvTP8v9Qin8wfVT2tcrB5uVQKy 01meEHIh0Kb3w== Date: Thu, 28 Mar 2024 10:10:53 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: Breno Leitao , "David S. Miller" , Eric Dumazet , "Paolo Abeni" , , , , , Jiri Pirko , Simon Horman , Daniel Borkmann , Lorenzo Bianconi , Coco Li , "open list:NETWORKING DRIVERS" , open list Subject: Re: [PATCH net-next] net: create a dummy net_device allocator Message-ID: <20240328101053.69a968ec@kernel.org> In-Reply-To: <10d89693-21af-4560-a088-d58d16cbb9dd@intel.com> References: <20240327200809.512867-1-leitao@debian.org> <10d89693-21af-4560-a088-d58d16cbb9dd@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 28 Mar 2024 16:02:12 +0100 Alexander Lobakin wrote: > > +/** > > + * alloc_netdev_dummy - Allocate and initialize a dummy net device. > > + * @sizeof_priv: size of private data to allocate space for > > + * @name: device name format string > > + */ > > +struct net_device *alloc_netdev_dummy(int sizeof_priv, const char *name) > > Since the users of init_dummy_netdev embed &net_device into their > private structures, do we need sizeof_priv here at all? Or maybe we > could unconditionally pass 0? FWIW similar thing could be said about @name, if we never intend to register the device - it will never have a legitimate (user visible) name. So we may be better off naming them "dummy#" or some such. No strong preference, tho. Adding params back later may be a bit of a pain. > > +{ > > + return alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, > > + init_dummy_netdev_core); > > +} > > +EXPORT_SYMBOL_GPL(alloc_netdev_dummy); > > + > > /** > > * synchronize_net - Synchronize with packet receive processing > > * > > As Jakub mentioned, you need to introduce consumers of the functionality > you add within the same series. Personally, I'd like to see a series > with agressive conversion of all the affected drivers from > init_dummy_netdev() to alloc_dummy_netdev() and final removal of > init_dummy_netdev() :D We can, and put it on a shared branch so other trees can also pull in the conversions. No preference on my side, tho. I think that Breno doesn't have any of the HW in question, so starting with one and making sure it works could be more "work conserving", than redoing all patches..