Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp954854lqb; Fri, 15 Mar 2024 10:52:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPaQtiJHjW/tcDljEqsh8pZG9G1UpAMyB6YeEvMh3Q7hjDzYiAnJorUa9orZ1stMB5MkzO6j5bsAJTQ2BfAR8c3VfdoA+Au0fI65Ugiw== X-Google-Smtp-Source: AGHT+IH9+ItHEB5BYX4ozXqW30swV2dFyJIJBGokkOs5rMRRYAXkpZCvGStxtP1WjqJKEvNZq/Ak X-Received: by 2002:ac8:5844:0:b0:42f:20f2:ccb7 with SMTP id h4-20020ac85844000000b0042f20f2ccb7mr6528960qth.31.1710525121182; Fri, 15 Mar 2024 10:52:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710525121; cv=pass; d=google.com; s=arc-20160816; b=LA6CTKiA/PmEtBLLCqEOsNUKBeApQjuUsuwkGEepmranMy0GcWLrcLXJpHj0UutaUg YmnASOTNdGQ37QZDfQAf1OCA+xjaHvw4laMUbLzJYTdFkJs5rDA+EMHSMtq0Z5umyazB b51tB36HKEI9Q+FU88Z2sVRJMaAJLXrpqriRvx+f36JMM63DISNSHAW79c21fvEbvLkc Cmt6cV2bjBLQeZkjrlkqdOyL7rNhQeFglBE0B4bElc8IPV6A5OIGBQFpqqi6+eclCGu/ CgKpsZSX/Vb4KKersbRZY4zVJeV1txfzKLrqgmtOy9VvBNl6pwaDNSUki2WOVXRW7VJC 1C9g== 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; bh=tKhttWeTZFZe9zGUUxoh+QILRHPUFPMvrl4pX6JuEh4=; fh=TdAxcet8NHExGXhxBoF9tdqqgCYiEg3KivmuQrT50wQ=; b=eodOKWgCyX3hEiAWANmxVkUesLzjMyio4utbPBUzGDiWKkKYdC4yP/T97GJk1AlGdL b/z9dqOqtKFsOskBdN3YP75gkSWpajsd4pLlyD0GrNL4HUC8Mzf0b4xpMFeEPOPDz1cz jA5p5nDNNiX4wVvbovTzTiXcvQ1/LEI2UxW2MMkGIBLAtQEc5i5gLloiCi8IzfBZwNKS 1bWmZopnmvOpx9/S3NXMBYX/aN0F1bDhYkyHIBxYoLZyykbPmnFjVkN0+D81hHZzklIf 6wCCypqnRkJY8xWvpNEXWSsBiumTQdV1Hu7TOTcQWsIQsX3h5r44OZcGMa5p120bI0q+ tpqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-104752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104752-linux.lists.archive=gmail.com@vger.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 c15-20020ac87dcf000000b00430a6130fb2si3131211qte.807.2024.03.15.10.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 10:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104752-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-104752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104752-linux.lists.archive=gmail.com@vger.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 E21951C20F32 for ; Fri, 15 Mar 2024 17:52:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFDA24C637; Fri, 15 Mar 2024 17:51:52 +0000 (UTC) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 958804AED8; Fri, 15 Mar 2024 17:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710525112; cv=none; b=tsLawyvuPZmUZjHay5+DteIwypXr0WwthEfzfKpXdev4WskdGiIku4xThjDHlEo2JeeWHJk27G1UZ21FLxpsXmNR69QxvNmOJoCwQ8ZcKOVyNOB5cDcn0Cah7pjI+NQdjtuobrFggppOslLTULPE34RYliRlKTpIchwacz0zB7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710525112; c=relaxed/simple; bh=3Xw33QmgVj0mYkZZEX6Jxx0BTb+yNOI1PCk8MJ0g6tk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F7fuJwS3LeqFrpdrByO1MfFQcsc1pDLUmye5Q1Td2pN+L60AN0mnWXVeqv5rggLXoifY4VymKR1ue/DmptPtCw37HVw9j7zPrvf7wz/Z8kI7jRQolheY0DrdafGwHETLoc8OpaVx66PaxiUJADs7PrVuJfdhTe2kzIAQFfpby+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-51381021af1so3415693e87.0; Fri, 15 Mar 2024 10:51:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710525109; x=1711129909; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tKhttWeTZFZe9zGUUxoh+QILRHPUFPMvrl4pX6JuEh4=; b=TlZjcU/t5Ff0pWtH0BTmcn0R4VgIZ6yRoa3rHlbR/cyar8kx0AqFyfewidQnFxl/MV T8LvvJGyEoXMcY+ky7NjgNFZWFUj+0lLXyTbJQrRr+C+5H5/eTU68asw2SJW8hpm7kGe 7Tt7zaGIHC8ETKLnQ60FW83664dX7ExkPAosSPGrI1bY2rCaBlafN8IIpE+ImyW+NBud nVlu+EIGRvQ73brUp61MNE1qBxgPAIi8bCz18uOGRIyLZNK5KCTIM0/QatDfwY2alV0e EJCDMcCJ0T71rrk2pqKGRrwL/hxmgekIeXzNbCh/LOzlErO2XYXTfks9zCEpTsXroAYT rj/w== X-Forwarded-Encrypted: i=1; AJvYcCXjdXeIv/zkH3FnXDZyqh2zd/dN7xcC9DlU1js8YTi98C0rjU3A2HMb5cMx2QwqYtVLjoR8Y7Yff1MoYb1vEvt65e7OYW+PQtbzPoSXhVXC2c9J0QufXtiuHbzM5o6jTGPSxM+QRH1slA== X-Gm-Message-State: AOJu0YzB6gxZPeiko+FAmw9vHbihCJOhiyhs1mJkVRTJD5jGASnKYcJE DOJXJgMpPM9vZAPhp6BYyUiey+hUZyqkpT5mD23OwZYyLeJX3Ur1V8wyrb6D X-Received: by 2002:a19:8c57:0:b0:513:226c:651d with SMTP id i23-20020a198c57000000b00513226c651dmr3196443lfj.2.1710525108467; Fri, 15 Mar 2024 10:51:48 -0700 (PDT) Received: from gmail.com (fwdproxy-lla-002.fbsv.net. [2a03:2880:30ff:2::face:b00c]) by smtp.gmail.com with ESMTPSA id n8-20020a170906118800b00a45be04f00fsm1922934eja.171.2024.03.15.10.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 10:51:48 -0700 (PDT) Date: Fri, 15 Mar 2024 10:51:46 -0700 From: Breno Leitao To: Dennis Dalessandro Cc: Jason Gunthorpe , Leon Romanovsky , 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: 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 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? Thanks