Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp597224lql; Mon, 11 Mar 2024 11:26:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6LtHy6FDltvMFhlAzB/ryjiFW7bCXfLwzXjZhnj+JXju1lOk0E0iD09u5B8nqHSeWAFfx+OL6rjq137FMfFwANgKK4eDBYOu2us1kkA== X-Google-Smtp-Source: AGHT+IFnCvVVQRh124EEWXNuaUKBqOLv/xYizUIBrWVBzGGJ8se/cjL84abWL7WuAJCuVVXHR1fC X-Received: by 2002:a05:6a00:148a:b0:6e6:9c97:a90e with SMTP id v10-20020a056a00148a00b006e69c97a90emr1826656pfu.18.1710181577670; Mon, 11 Mar 2024 11:26:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710181577; cv=pass; d=google.com; s=arc-20160816; b=dwP3O+66GLTKb90Ni3/NtvyIMhcqtEAKy4/btK+WPqut1Wjt2SCTb7lUGTdFPzadID KRIFStpT/jGnDpEupEU97neJfC1LT7dBtwqv0QE58qgHHgbnsrpQThu6GGS2P3Z7VYyJ l7cEXcZ1BrODFsmHspxQUFckpgCdvMzcmiXLerF+CuotB/3585/x1LxBoJrdp2cvI7lm jNw9OwHGgntjr1vcTfuifIVHynnKaiEs1Zhf04crgxEbn9ZAHULwulHVCf5zdluE2CDv AIrSneigIxRXrLWobcwlAzymyG08+obdYDdoGYskFJBQZzm1vHE51aiQ5MyeMuILGhCE KDIw== 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=G6akVAOfuWR+gLnK11V8HKFaUkYvAs5nfRmX29U90K8=; fh=AeE1o5rzxHCzYH7xl4kdgYFIu7LcT4n4Pp71fVWVZto=; b=GGJYUj7tjZHMr+ILAUe+1xPccf4ynzFXAFoYcy3iYz4uH0m0R+VCQIPewevPy4PhO6 N4ravAXOyogkgcYYbqv7+Ikjm6EiYbTu2iVpeYj9qEe7emhziAuLanbBRRPVP2E9VzNi TPypkOxu8AKcRSC3742dU8EO1zxzrLpHXhVjvjbNqX4ZoL3KUuaUce/QayPE7nugiGMp I2kqKx2KSb2v/K2EmXNNbvLWcMjZqm+f3U3gH+E0HWW+4C2ObF383K0Q3UXnJrQCvjw4 5RT0eYD2ASwpa4voH+8CdfE9ZH8zYo1mkl38gO66iLuiC9PqIOjd+RISsDfhXw9yeB/H k/cQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MXYPrR+W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-99356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z16-20020a656650000000b005dc425eab0esi5348863pgv.461.2024.03.11.11.26.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 11:26:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MXYPrR+W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-99356-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99356-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5C70EB218D6 for ; Mon, 11 Mar 2024 18:25:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E19C153E2D; Mon, 11 Mar 2024 18:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MXYPrR+W" 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 1132D537FB; Mon, 11 Mar 2024 18:25:33 +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=1710181534; cv=none; b=a+Xp9yYmFKMIYiixn1U8FkdWSDzkwtbsRgF8XNWPOcva3MXqUu+lare/469QptzhFHVYgz+u3xa69ZUtX7i+a3wDJPBr78C8ZW9j4Ur/jFyF6q5rLod3+SHiTYEXY9PwYntVKWWLo4yDlhoskswHR1k6Kl725MdHclFw+7T4zoE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710181534; c=relaxed/simple; bh=r3BDLwL9q69U152caiaU1puZXaBqIjvI7xhy1YrI7fw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iz2is98VFjkbZQyMkFh1w34LG6ZC4BsJlqf1+7C9BpENQKqKoUU2ocXkocTzPwwuR5C2+mqNghlpLnvQNzhTkTAIP3Rb26Xfwht+dgbLap1zDp7oHJ9Zbl0yAbrr0d3Fm5ovpBgtVS8fjfYzNzThHWxHj8+PStApS3CY4+FT5PE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MXYPrR+W; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56F4AC433C7; Mon, 11 Mar 2024 18:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710181533; bh=r3BDLwL9q69U152caiaU1puZXaBqIjvI7xhy1YrI7fw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MXYPrR+WUmb6e4dbDkvedPj73lMETfPnb3253qEzLmDERUURMB4/oHR77z/0XIgdK VsloJXnCmZVVl4bNUyQU+ccqGJASsJup/AktQhzm4S11SWqj92sNDBTIm+YA0dwJ4f 1fIN3y86KzreS0CRO17Z24eZqqA7pHhtQqfeRcVAEGxf8ibQJrDp8fTdiopXPDmu1w uaSkZnkUaZgw+qBLuQvgNuOgHPIWPPI9y8nMW832hNuLzWESo4NY6zTXtiESRTcsEh 1OSh7GGqpqqkZMKHsxZBdlPicMdQrlV8xLa52bsDCLjPW28wvbxUbYs0mKZw8YzKCY PyMOHWmKt4W5Q== Date: Mon, 11 Mar 2024 11:25:32 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: Breno Leitao , Dennis Dalessandro , Jason Gunthorpe , keescook@chromium.org, "open list:HFI1 DRIVER" , open list Subject: Re: [PATCH net-next] IB/hfi1: allocate dummy net_device dynamically Message-ID: <20240311112532.71f1cb35@kernel.org> In-Reply-To: <20240311102251.GJ12921@unreal> References: <20240308182951.2137779-1-leitao@debian.org> <20240310101451.GD12921@unreal> <20240311102251.GJ12921@unreal> 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 Mon, 11 Mar 2024 12:22:51 +0200 Leon Romanovsky wrote: > > From my experience, you can leverage all the helpers to deal with the > > relationship between struct net_device and you private structure. Here > > are some examples that comes to my mind: > > > > * alloc_netdev() allocates the private structure for you > > * netdev_priv() gets the private structure for you > > * dev->priv_destructor sets the destructure to be called when the > > interface goes away or failures. > > Everything above is true, but it doesn't relevant to HFI1 devices which > are not netdev devices. Why are they abusing struct net_device then? If you're willing to take care of removing the use of NAPI from this driver completely, that'd be great. > > > Will it create multiple "dummy" netdev in the system? Will all devices > > > have the same "dummy" name? > > > > Are these devices visible to userspace? > > HFI devices yes, dummy device no. > > > > > This allocation are using NET_NAME_UNKNOWN, which implies that the > > device is not expose to userspace. > > Great > > > > > Would you prefer a different name? > > I prefer to see some new wrapper over plain alloc_netdev, which will > create this dummy netdevice. For example, alloc_dummy_netdev(...). Nope, no bona fide APIs for hacky uses.