Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp456552lqg; Fri, 1 Mar 2024 10:07:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMkbqClyC46i1qWJtiPiD9/8qS/00QLlVxOdCGTFF9yXhIIK7P6d9SrNrzPVJVwOyeoBpHEcy0zyb1/3Z5wWCicIvH6QJ9STSWrcFZOw== X-Google-Smtp-Source: AGHT+IEuvV3w7X5jva5VVEx1Rt+s42nYyHI1UAV1MT0k8ebYMax1u2J165uZK9G/PVuRNiHCImxY X-Received: by 2002:a05:6a20:3944:b0:1a1:e41:3edb with SMTP id r4-20020a056a20394400b001a10e413edbmr3341709pzg.11.1709316431460; Fri, 01 Mar 2024 10:07:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709316431; cv=pass; d=google.com; s=arc-20160816; b=vFiUgX3GtV7MS92fD+WuDldL5tVERVxeTykC303/6muJ7cbXOg+pc51rxgjkpKm7JP rlnPNU7g9WlHNcT0Q3XvHB/biyFA1wiRhjZ7rVDGlfEB4Sv+MgMZfdOk8I+cTdc1jbJ9 Of1OY33qEyKb7y6lcv3Xy7/QqC0q6VFfKLKlrtNc2oprUll8MjmPs1VN4K9z0try7z08 aGc+JhBRA7OITaaWdhuI2ywXN4ofkXVFYG1wYd4x6zl5DGQvPTaL6vAiBVjnIRKTfkCF NbkTxxxxFV5eautxoBOR4sLllClO5/zWRB/qspMQNZ7Gw8wWYevexduT6wcp1egzV5Li OP0g== 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=EIj/hPN+ik4qmCHTNuVgjY4pQTRSkTwciabO+oM1s/E=; fh=BpVONM+ks1rstx2Iw9OgN3/AVJIowpSVUaSNQtMaiwk=; b=T+UpDthN3e96ZwDF5Q+yfB46RO+gbrbrw7rLIWD7DSedhXwChnfcTcNA9HDlhvWl/q QUdyjQOI8XBTv33ZP/KF1aL+KxoEBwD1O551xrbsBuKj+w79pyyk0WoemfnOU/GcXdXJ d7DZKXmFWdKbQMknlSYxZICK98EFF3tp6tAHAvfd6KwcGT5JYCzBu2UYFzcsIjioMiH6 OkOcqe2bPmrNlwFuPa0Ch1n3Pc7CR5wl0h46k37iRTJR5y/HRO3C4j8HziGUTlTqt29P tjATUBRZdr8n4b2zSXqwYZKPFcW1Q/g3fYpQRph0nylOw12EbL3RA9mVXqK7+tn2aWgM soBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WkaA+sqq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88846-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c14-20020a056a000ace00b006e558a20e88si4222523pfl.208.2024.03.01.10.07.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 10:07:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WkaA+sqq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88846-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 AF0B8B2D8C7 for ; Fri, 1 Mar 2024 17:37:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4D2820DC5; Fri, 1 Mar 2024 17:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WkaA+sqq" 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 0440B36120; Fri, 1 Mar 2024 17:35:18 +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=1709314519; cv=none; b=kvehxK6uKTKDwi4DdZuHFtFggwplhphCjofMfuoBQ5nwnNO5LKkAsvDItG0s0vbjuAplnOFeaNZHCmdsQhMOA0CHqq76eJWCS6CqvAAi2jbtRp2edSnPKz75PK7ei4ld8GPtMkyfVwxbAUl0OPknGFaAk+u9Ia4rcoOTNNwIDos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314519; c=relaxed/simple; bh=EIj/hPN+ik4qmCHTNuVgjY4pQTRSkTwciabO+oM1s/E=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CYuzTJ34sX42gmHxchW+1S2tu6VywUBbprr7flxEqXoNZLgwleUPaFrXSKq1dGd2YffE9pq5knit4x8Bt5zP4DNZh200PvVZvN8Nvr5oIhm+KOw2y8om+4nl4jrCxx8QpA3AsAJOUg1tcmpvK5MYu1C0cfd4woWLCE0XzhE9cfs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WkaA+sqq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DFFEC433F1; Fri, 1 Mar 2024 17:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709314518; bh=EIj/hPN+ik4qmCHTNuVgjY4pQTRSkTwciabO+oM1s/E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WkaA+sqqt5Aprf/+ou7cadfG7bxUeTKvsb5UJe29yaHjEOEn6Xl888m3O2bwtLr6m kBnYkXlU4+7VoH2QtqxJ2DRwKn4HrRYX/16b57ztkG+ZAN5A7ICLi58/9rswLl8Rti Qya+bELvvD8OVl4sCXqtzQPB9dso+1CAesx2eAHVWtsvAi9GaHYbTxtlvVIJpoiDA4 HGxm3AyZ6Y6hdoDZTywToy6Jb+RstK9GbEzAfhoKabwFkPa/JSDS1rDfY+xGrfXWMR bbS/FfN63kTeEybMi4gMbgSLSzIloMpSLLJwly7c9dmfhbFWPlDNskqEs2w7TbRgra bOOWtop18STRw== Date: Fri, 1 Mar 2024 09:35:17 -0800 From: Jakub Kicinski To: Alexander Lobakin Cc: Eric Dumazet , Kees Cook , "David S. Miller" , Paolo Abeni , Andy Shevchenko , "Gustavo A. R. Silva" , , , Simon Horman , "Jiri Pirko" , Daniel Borkmann , Coco Li , Amritha Nambiar , Subject: Re: [PATCH] netdev: Use flexible array for trailing private bytes Message-ID: <20240301093517.428e5b5d@kernel.org> In-Reply-To: <77d3f074-8cb6-466b-ab31-a7b0bac659d0@intel.com> References: <20240229213018.work.556-kees@kernel.org> <20240229225910.79e224cf@kernel.org> <9050bdec-b34a-4133-8ba5-021dfd4b1c75@intel.com> <77d3f074-8cb6-466b-ab31-a7b0bac659d0@intel.com> 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 Fri, 1 Mar 2024 15:30:03 +0100 Alexander Lobakin wrote: > I like the idea of declaring priv explicitly rather than doing size + > ptr magic. But maybe we could just add this flex array to struct > net_device and avoid introducing a new structure. 100% I should have linked to the thread that led to Kees's work. Adding directly to net_device would be way better but there's a handful of drivers which embed the struct. If we can switch them to dynamic allocation, that'd be great. And, as you may be alluding to, it removes the need for the WARN_ON() entirely as well.