Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp679054lqb; Sun, 17 Mar 2024 01:42:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHz9r0vYU4BGZ4WwEug+qczYKrWAIpE92HnZE8hfAaV61wfeJy71XcRBzhwycxZ4/kcRP98Md5W1bsvGnlDf0Aol8/Jw6rXlaVo3W1NQ== X-Google-Smtp-Source: AGHT+IHoteFvPV9cuiuYbDVLcYFG/LxiHp0VMU5/3XyE0z+A2ISko6VhTZsADEGf8q5JIUeOCU66 X-Received: by 2002:a05:6a21:e85:b0:1a1:4d7c:bdc4 with SMTP id ma5-20020a056a210e8500b001a14d7cbdc4mr9436911pzb.22.1710664921667; Sun, 17 Mar 2024 01:42:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710664921; cv=pass; d=google.com; s=arc-20160816; b=phTUoKBemodkED/JPQuAaCZBh8M3lidCwqnCo1cUXmFN9yGaQ6cAPmLJGXczwfhhvm AwxpzO52suGpLTjAF7Qhhx761aBmVESvchirSnklvND+1K1cb/Ry1LzacF6Fois6Xktf lJSjJLJ+qDeU2ZtVQGY4lOnMVk2jpZfy3P5M7J9kE7LXKreHYtkr4HColcV4dCDvllA1 QHAzvRhZdkp8VPafbWHIkaENIS7ZyGRx3/ZGlVlWuHbTqNeNOGb/SDSlekhdiVcg73yd fph2ngIqkxHIPjmiA1PPUhgFzXe3zJ2/ocQkhjYq3mZ9xuVSlK/IXURhdd8j/7inDT6K fHkA== 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=KloHe9Y2i416LVc8WLoJpCWkM88QUQh5FuovlnBSJto=; fh=rLi9L62qXbHn+gFN8fhGmrVjaoTFi4Q8/3WYGV8IRac=; b=jIvUieddZLF0fDvllEkttJqdtufzQ2Cibd+ECQjuWl/g/v3GTW6BZBSuh3EyDEkqah CSLACUagFNuYxUU3k931v3n0xZyqK8w4D7BkIlGeYBnghJePUs0c53JTADSJn6gpYitV byTJjfRA6G471AFdGXIiW0I0HaqsFznSQ3x2SvDzRcbxfY2MQ3hGjyZ3rUiRqd7adeC+ QziJAjppDfpuoff9fCmUTTL3Orib7ZlXRXTEoX2nI5YYOgOHRa6ukKABv1BPMmRlh/vG LLMhfAuLM11Qy5Z2KF9zRd49+AfZfC3bQ6UICh30JoUIfMxim/9WjJUKHFMwzKAEjIPa ArYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HAV3Kvmz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-105358-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105358-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 lp14-20020a056a003d4e00b006e7227efa2asi404554pfb.305.2024.03.17.01.42.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 01:42:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105358-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=HAV3Kvmz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-105358-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105358-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 5B27928195D for ; Sun, 17 Mar 2024 08:42:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E52112B8B; Sun, 17 Mar 2024 08:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HAV3Kvmz" 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 6A24D4C9B; Sun, 17 Mar 2024 08:41:53 +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=1710664913; cv=none; b=TUFqiTzN2+0ccnioyBiEncg3EwaVWiTieAJ2jhat1mo0f5fBtR3220Tyz5YSvfb/9mRjVjSkesZwK7/Ow23yEhhjhM7pxNiiUlQZ3XcxpVve3Ai2h/iQQBIcSeMwY4l2oh0mjqdHxg6CEO25z9SzK7G4DCehzNJdIlPe4ot7+3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710664913; c=relaxed/simple; bh=KYe7mcfbpEyBaVxIu8Von0fzySiopDT2W0zyPdWOo/I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XWkcxyrwQ4fFDCDkUU4BZADnENva/cn0XrfuAEwhxn4Kr11DEjdgVrSdsqA7kbrzZnZdkKmzx6+1pI0d2oW4lOMZCHE2IXMvV/YqOpoYhIBu6PvSjNt189KdTG8diheoHj8HKF1RRIJmpURZsyW2lcIJJ4bSiLqDmkeUMK/Gvco= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HAV3Kvmz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F464C433F1; Sun, 17 Mar 2024 08:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710664912; bh=KYe7mcfbpEyBaVxIu8Von0fzySiopDT2W0zyPdWOo/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HAV3KvmzOibnLApF7+nQ38GO38iESk7U4xBDCSDfdJNkPn/4OO8FZjR6laExQg0QR BXvDls4icw80XhFTM2Zu1+GwSr/DEzMxIgOM78XOBvKbRwCBNiAfElAfIiO69+ldwt xGP3M6k+cgIbaN8YiU6nRF0M96FWCdUzOJljV3dwMxFS+r9vNxlZHDkaYtkWkAUeaB j8ARepXG8aAWJ1mMmnNyzDgyng0KpQis6VgWoR0XZ/QqrLgWOSZW5BIQQp9bplVwIE J4O42Pe72s914W3P4PqKWA3NLU+Qm+rsdoo2vI8HSs1HnZl9DL1ASSpBineUu1HXWa 9kwqpU9/g4KnQ== Date: Sun, 17 Mar 2024 10:41:44 +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: <20240317084144.GF12921@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: On Fri, Mar 15, 2024 at 10:51:46AM -0700, Breno Leitao wrote: > On Fri, Mar 15, 2024 at 12:12:15PM -0400, Dennis Dalessandro wrote: > > On 3/13/24 6:33 AM, 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. > > > > > > 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. > > > --- > > > Changelog: > > > > > > 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 > > > --- > > > > Very lightly tested, but interface came up and I could send traffic. Code seems > > OK too. > > > > I'd prefer to at least remove the first sentence of the commit message. > > That is OK for me. Would you like to remove it when merging it, or, > would you prefer me to resend it? Please resend together with Dennis's Acked-by. Thanks > > Thanks