Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1190335lqm; Thu, 2 May 2024 07:43:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeAYvlSvdMx7wm9JapJP7Lu4zzcsC88tFm8N6GTfDkENUByQXuWOqlmRRr8APfjrLKAZU3zYFtOEdT3eOkcZpfoNCv3ncILtqrngZrlA== X-Google-Smtp-Source: AGHT+IGj0nITXaoNEvRT8jcxe8u10QeZEcN2TFPFZc7MmdbLUj4gGgs5d6VRhuKfR7+qKwv6aUyi X-Received: by 2002:a05:6214:246f:b0:6a0:cb53:a78 with SMTP id im15-20020a056214246f00b006a0cb530a78mr6847508qvb.8.1714660996240; Thu, 02 May 2024 07:43:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714660996; cv=pass; d=google.com; s=arc-20160816; b=PUAQ9QBQHytHIAGhiJIm8n3hNRyZI5HFl7fjeyjyVmAaZUTSwVBgyJyPexho3kmWfb HllArrZEMa9mefYRCZKPj0/LAZfMx6Cz8e1g/BUxlS8E5/9HP+uWoDmUadlZE8dR6o72 Z1ROL/KFJX5T9FxYywR755QjR3HYepOetd30TfWgnph0gWd9sDQgMFwT6idFNYYD/WRj V8Is9JNRxNAo+Vb+mLYm1+nRMFk6VXXm1PCxazpZEGv+NKNB0WMam4WB3KvJaeyv5Ro8 LU0pLRK53Q3M+Gr9wZlx7lcfYO9Lbb6nPG5xz+i2HtoHFvzMMel4sGGta7yN3m6pyXYq ITvQ== 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=zpJugwJLr/WkGfWivIN/BoyG1miy0yiJpvs1zwL5l8s=; fh=+R5/WDoBX51XrnYfpzkRLoAV8r98EzDsG7tBkiys9rU=; b=qdCdRxZT1S3RemFM6O+D1ofGSYwj3tpt9pqwyHqao+5ZqwOi3vBMQmSIt07KLqdURF dnNGn178EDhuL0fHSW33evbjB1f43T0etGdHBPTNL9gbeWOXhhsSrsrkcTSM+KKVsqlI cmY0GlqJ8qkUm1uKkdMLz7E14ghp+c9opSD7293iqm58DtFEfhlmNfLWvTjDxJk5vm/o 72oKnPd7cD72whe4co8VBoDdnSLE01Jwd+zoYo7T6yqYz0aLe8VQdC9cgtuizNiRfsoS jvg8dazc3QKjRHOGI6xREiuiyCiefathaCHEaH8tvSJAF4c1IONqHJHY4xOJQLqB+3tv BnMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vg2BGsYZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166577-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166577-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r16-20020a056214125000b0069b1ed1a34csi1072368qvv.532.2024.05.02.07.43.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 07:43:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166577-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vg2BGsYZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166577-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166577-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F091B1C20D67 for ; Thu, 2 May 2024 14:43:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E126515356A; Thu, 2 May 2024 14:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vg2BGsYZ" 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 0D38F12DDBF; Thu, 2 May 2024 14:43:04 +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=1714660985; cv=none; b=mTNId4/L5XG1NPg6kcPabP696Fvq8QLVvYdsJCZjtrcDuSumlEhVJSWlfTfdRyXKIWF6FCIYhGUsxvcV/VAy055gK4aNx2meOWLZ326FvV5O6nJgaFDdsCgz9Snw+3T382SbgHuUBvvNrds6Q88k/BNiJrpf7THJLCN/zP4w16Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714660985; c=relaxed/simple; bh=x0bc3ezuQ3DV2EhWzPw50heSwOCJAgNfC0IH1Y0Sx9I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nA9FD9lw4cFBXwa65q3OmkT0UNDvAMJMCL7rHZo9ybaHGZEUTR3MXo4d53G3oLYhNbSzaIQAh9Hy9RfvAcip0aV7rwyxXb6lZI/6OHtdchb2xgzJYvacudXKHLAHiQr/ZftRlU5tvXq0Tht7uGtXb03k/lwAT/otT8HeMAYkyNw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vg2BGsYZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5F1CC113CC; Thu, 2 May 2024 14:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714660984; bh=x0bc3ezuQ3DV2EhWzPw50heSwOCJAgNfC0IH1Y0Sx9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vg2BGsYZY99RQG+6CeKVR2f808dxrpoUrCqttNZlgnyq97AWnj7uNw+i+9NUts4y9 oMNrNvWlL4M748qDJGWXfVEcpxEz+BRZgylJoto2QVlfIhcFZKbKw4uLmcndRiE1iq IlfiT5CVw6nDY+uUPEkP3d71DQ1SyWpOOAXjtWnc28/n3ZDI6W/WUfMuDjTWuK3mPq 6a934sdlA0Ql6U14zYSSlz2HqbKaf3GUKjU+Y2tUqIDU909MRQ1XYg+juJggokMyYS f+Vs+447jzCiPrGp1afYBPP/8E92M8J7OZsXi8MXxJHeMgtvSdiq8dNlBgK1K39k8P YpMFldvnPIR8Q== Date: Thu, 2 May 2024 17:42:58 +0300 From: Leon Romanovsky To: Breno Leitao Cc: kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, Dennis Dalessandro , Jason Gunthorpe , netdev@vger.kernel.org, "open list:HFI1 DRIVER" , open list Subject: Re: [PATCH RESEND net-next v5] IB/hfi1: allocate dummy net_device dynamically Message-ID: <20240502144258.GJ100414@unreal> References: <20240430162213.746492-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: <20240430162213.746492-1-leitao@debian.org> On Tue, Apr 30, 2024 at 09:22:11AM -0700, Breno Leitao wrote: > 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/ > > Acked-by: Dennis Dalessandro > Signed-off-by: Breno Leitao > --- > Changelog > > v5: > * Basically replaced the old alloc_netdev() by the new helper > alloc_netdev_dummy(). > v4: > * Fix the changelog format > v3: > * Re-worded the comment, by removing the first paragraph. > v2: > * Free struct hfi1_netdev_rx allocation if alloc_netdev() fails > * Pass zero as the private size for alloc_netdev(). > * Remove wrong reference for iwl in the comments > --- > drivers/infiniband/hw/hfi1/netdev.h | 2 +- > drivers/infiniband/hw/hfi1/netdev_rx.c | 9 +++++++-- > 2 files changed, 8 insertions(+), 3 deletions(-) > Thanks, Acked-by: Leon Romanovsky