Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1623139lql; Wed, 13 Mar 2024 03:43:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuAHSuzvfl63QRlyzCQtwjTXR7GxPXO7dEbXAmyPkxl03IQvcFBWPJuE71UpIxNK24F0VwmXO+ygYV5YQrRGTnUtWS5ai6L0uWukAqNg== X-Google-Smtp-Source: AGHT+IGs2ueEkqmEB/gsFf0IYBOo6NW0fcu1jH8uxS+dTxXUSrMVr21iZsgIlo3BEzfjxNtSw5Tt X-Received: by 2002:a17:90b:e0e:b0:29b:ab0e:4f0a with SMTP id ge14-20020a17090b0e0e00b0029bab0e4f0amr10156118pjb.23.1710326584652; Wed, 13 Mar 2024 03:43:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710326584; cv=pass; d=google.com; s=arc-20160816; b=qNEKUoFqJOS13SB4vg7qL9CxN51Cr7xB9lWGt/d5VDU5xbK2DDVo4hAyu9LAzxNRKD 6ARMdS5cFd8KbdIqHQGNtpIlp7C154i+1NWtlgUljHhnbbu3QkaBfe23u3FeKuE3t5KO kHLQkHNg/81iDGn793hKUlSVbj8UL+8Pd7rz/+xqbiz22XzF9Cihhv8Hbc2J01LIjHj+ zvfZqstUj3ApH/fAasa5KFUtrdJc87w0NyT7yOHXJk2p7x+72qmZ9llXxr2ljtcmulSj w30fIhSkRQ2fIjqap58EJCtQIQT1DpD6aul81xYR9ii6wZEdRb2B1wULJcYn8RiT6q8k lAqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=U01LeKf2QUgOw4I0kc7jRtfbaffUsQqYXu5VGY9x5oc=; fh=rLi9L62qXbHn+gFN8fhGmrVjaoTFi4Q8/3WYGV8IRac=; b=rovsGeb5qRolGQeAyekbZJ8CeRn2+QjmZg8aHdrJfXB7E/1euDmJWariIw/dM83J2E c+I0L2Y6lk+47g7HfxU5gBOYUy6u9ex5poKiLEF5IbKBetUYTU/KQXrAbsBPeNYd8tuF A0h1RmvgtA4fa1JlKDueosgGcUnhhjTVe7xWox+gIgGhbKgBpLs+C08sf7Qj1CjwuXpr B6jQ/VLesT3gjzBPSzU+cYkQyqcLny24iMlAn5G0pn7ypZoQjv+nv5HGqweope25W5Ia 1qi0ACXuChfSP200/APP803xMIcrvsF4HFu4uM5toYpIv9DuphCZx29XaT35Vl7dwa1N W8BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HFMKzVpf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s12-20020a17090a880c00b0029b7a26a204si1176188pjn.158.2024.03.13.03.43.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 03:43:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HFMKzVpf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101367-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101367-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D1971282D40 for ; Wed, 13 Mar 2024 10:43:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBDE13D3B7; Wed, 13 Mar 2024 10:42:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HFMKzVpf" 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 0AF1FEAC8; Wed, 13 Mar 2024 10:42:56 +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=1710326577; cv=none; b=E9f4tV88n/crEurv9JfzmndWI0olpg7+HfnS4vFh4JiDXngHFmP+stmyuoPoTpoIbSt7uDnyoIcGlBEQNvoCqURdlz5tKdPzPwxEtLMY5v1MBCbRRcBm2saXiVkf4jPlvivBm28TcE685O4zOJ1HdnFbS1P+yIFHvrZ049+M+DM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710326577; c=relaxed/simple; bh=g8tA9wFEag5+QRV7OGwOBW6Yvz6OSanOITK6gWb4Gas=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GTpHcrTw0DVo++9pteW783we+eaeNQTQ9rCHPbJ6Xed45DSL1Gr4e0yeRNFgX43aBYJPDQOFPgQZI7+6ekowk5W6gS4VvyRvLuuqSDJgFMuOSkh8SgaecSGicPWB0/Vq5wnAWxVJnVdcDT4v6QB9GppAKpIRFNe3NHqVS6fp6SY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HFMKzVpf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE8F9C433C7; Wed, 13 Mar 2024 10:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710326576; bh=g8tA9wFEag5+QRV7OGwOBW6Yvz6OSanOITK6gWb4Gas=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HFMKzVpfMJwgI5O9uxaqtHfik8AA4SYFnbCvIfZBcZZ5MK+IOCPMVWVheckms7N3l FkvK9+KYmWFj6fMX9Vnc/O48nUeF5RnG2j307rQKg304BZfWAkURzcK+E2nIzn3Rja gE6PqwEx76sZ24uqt6KRS9zWkxJMhZRE5ubG302rYwWR4DUH03F5tpILPQzGhG4xzs fi5E7kXbnXqBqpnvAXXnpI356lTcNDiD3zT3+ltYcP5itvJ2xD+F+Q49lR/ncCesiZ o0D9IdGncz1g49C+Ud3v/iMUhbjElpg3cQ1lJOepAazRJaF3ETiC9F1Fg2hr4sxIR+ Yallcl0aDj9Ww== Date: Wed, 13 Mar 2024 12:42:52 +0200 From: Leon Romanovsky To: Breno Leitao Cc: Dennis Dalessandro , Jason Gunthorpe , kuba@kernel.org, keescook@chromium.org, "open list:HFI1 DRIVER" , open list Subject: Re: [PATCH v2] IB/hfi1: allocate dummy net_device dynamically Message-ID: <20240313104252.GA12921@unreal> References: <20240313103311.2926567-1-leitao@debian.org> 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-Disposition: inline In-Reply-To: <20240313103311.2926567-1-leitao@debian.org> On Wed, Mar 13, 2024 at 03:33:10AM -0700, Breno Leitao wrote: > struct net_device shouldn't be embedded into any structure, instead, > the owner should use the priv space to embed their state into net_device. "shouldn't" is a strong word, given the fact that original init_dummy_netdev() was designed to be used in such way. > > Embedding net_device into structures prohibits the usage of flexible > arrays in the net_device structure. For more details, see the discussion > at [1]. > > Un-embed the net_device from struct hfi1_netdev_rx by converting it > into a pointer. Then use the leverage alloc_netdev() to allocate the > net_device object at hfi1_alloc_rx(). > > [1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ > > Signed-off-by: Breno Leitao > > ---- > PS: this diff needs d160c66cda0ac8614 ("net: Do not return value from > init_dummy_netdev()") in order to apply and build cleanly. We are in merge window now, so if Dennis approves, I will apply it after the merge window Thanks