Article View: linux.kernel.netdev
Article #971Re: [PATCH net-next v2 0/2] net: netmem: document design principles and intended direction
From: Stanislav Fomichev
Date: Thu, 08 Oct 2026 22:09
Date: Thu, 08 Oct 2026 22:09
35 lines
10352 bytes
10352 bytes
On 10/08, Mina Almasry wrote: > Because the networking stack and drivers are only partially converted to > netmem_ref and current memory providers only supply unreadable net_iovs, > automated code review and analysis tools (such as LLMs) frequently infer > the wrong architectural invariants from existing code. Specifically, > they often assume that page_pool's struct page APIs are primary rather > than legacy wrappers, that memory providers always imply net_iov, that > net_iov is inherently unreadable, or that callers should branch on or > downcast netmem_ref directly. > > Document the intended netmem, memory provider, page_pool, and skb > fragment design principles concisely in the relevant headers, code > comments, and netmem documentation so both developers and automated > tools follow the intended abstractions. This series adds comments and > documentation rather than performing a large refactor all at once, so > that future incremental changes nudge the codebase in the intended > direction. > > This reflects my mental model of the netmem, page_pool, and memory > provider architecture; I welcome feedback and disagreements, > particularly from major contributors to page_pool and memory providers. > > Cc: Luigi Rizzo <lrizzo@google.com> > Cc: Björn Töpel <bjorn@kernel.org> > Cc: Stanislav Fomichev <sdf@fomichev.me> > Cc: Pavel Begunkov <asml.silence@gmail.com> > --- > v2: > - Document both current implementation status (memory providers currently > supply net_iov, and net_iov is currently unreadable) and target design > principles, and clarify that new code should generalize existing > limitations as much as possible (Stanislav Fomichev). Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Technical Details
Message-ID:
<asgUroVsxJq7gut1@devvm7509.cco0.facebook.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343339-linux-kernel-netdev=dewy.ruReferences:
<20261008023030.1089616-1-almasrymina@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343339-linux-kernel-netdev=dewy.ru
From: sdf.kernel@gmail.com (Stanislav Fomichev)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 0/2] net: netmem: document design principles
and intended direction
Date: Thu, 8 Oct 2026 15:09:56 -0700
Organization: Usenet Network
Message-ID: <asgUroVsxJq7gut1@devvm7509.cco0.facebook.com>
References: <20261008023030.1089616-1-almasrymina@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="985014"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Zkrj0qiF4Cd2/USoY5MEE/C+wTw= sha256:wtDMscO6gE3jHkq9wDA3WYxGTBG/57nTxm9SW0sHFiM=
sha1:JlJZ1khhzGV+zsjmxfds44O/lAk= sha256:rdZXUIise2wNJtkj1PbO8EjbtyCUQQrAkWLLIJe0/cQ=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 7B19910F55B; Fri, 9 Oct 2026 01:13:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.749
X-Spam-Status: No, score=-0.749 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id P5J3gGbIZHVB;
Fri, 9 Oct 2026 01:13:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-343339-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 1C28E10F559; Fri, 9 Oct 2026 01:13:37 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 56BDA48606; Thu, 8 Oct 2026 22:13:35 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E766455608;
Thu, 8 Oct 2026 22:13:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q8qgeY0z"
X-Received: from mail-pj2-f8.google.com (mail-pj2-f8.google.com [74.125.227.136])
(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 4E0B9441633
for <netdev@vger.kernel.org>; Thu, 8 Oct 2026 22:13:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.136
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791497614; cv=none; b=OTB0PNAzSqv0Stjmj7XxyklP87TbI65O+kDC35sNWTXkCtgQ3HZLiaUJMsIOmfpIjLVNtPoGtJ4mAuJ/jZwqFHzFgXJEj8dnhwbzpNmI8zEUB0T/Rea20Ky/C4n1b8iICtET4pjGi86ImEh6TfVqfGX959P4NNXDcR6635QykjA=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791497614; c=relaxed/simple;
bh=XhbvqjOdjhVKjaUTw6zflrPNgueBqC/aiLfFiC3naJY=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=Y9ZvQXirTvjMn1ZZkcFp6hXlKisdTC28kkCujD70ovbP9Fhotunbm2n+SqYknCG6IEkJevYSR9z5kU+MEzdrbKwIBu3ONZEFVWJVlscZVPptsxEkheiYYO1D69ZbfBeEjQWH7qwAUP/9mNmRQM/U+qPWLvQW943DcjVIpv6+CwQ=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q8qgeY0z; arc=none smtp.client-ip=74.125.227.136
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pj2-f8.google.com with SMTP id d9443c01a7336-2e609985789so8921685ad.1
for <netdev@vger.kernel.org>; Thu, 08 Oct 2026 15:13:33 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1791497612; x=1792102412; darn=vger.kernel.org;
h=in-reply-to:content-transfer-encoding:content-disposition
:content-type:mime-version:references:message-id:subject:cc:to:from
:date:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=wR6B1DFYSH6KdPY/ts+nWKN+fn4/J9gqpkYviWx1rk0=;
b=Q8qgeY0zhMbaeiJHpdP5JltSzND6Rijq+U/cRwVd5f9NqZPLpS6Da5DZsCZUKf7rfO
uPM1mXY1iGXmryRnT8FnJaLFqcA0kjShFr7+wx2QKss+5l8XaxNIWuGeH+GNI0HWaws5
j9t63WxZc38wX30FUAR5cABtBNCruLJI5pmc4sFqtL2co133g18UZmezAq78L15Iq+8R
JuW7sySL3Efws4SchAvE0Il45p9PFTLCABdeC0WDKDdsJWaaygtJ5uGU2Ju1ArJ6NRV4
5eFnoEI7N3IrMo2KNoIKeLoswMMgXkG+7yQKYMs9QXVPGCPuKBjgnTZ82NtbzhG3ekQP
SbHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1791497612; x=1792102412;
h=in-reply-to:content-transfer-encoding:content-disposition
:content-type:mime-version:references:message-id:subject:cc:to:from
:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to:content-type;
bh=wR6B1DFYSH6KdPY/ts+nWKN+fn4/J9gqpkYviWx1rk0=;
b=us7IhGkmIku6/nkIItuot9AHmKH1eWHbS6aSQ9myhj24I82NiOigPsPHkMZ3F9cHtI
Zl+KdH1tt22g+l/SdBcU+WzhbYQo/8CrAIMKVws/Sh8pOGWk8fV3uSArmnzvO7v1PCG9
VMjQI6KE41kJQhUWbgWLXGy7LKI5RUe3lwvfl/ieBB5JSK0eDPgcZ31nyjHzyO0NhMHK
5EpHFgT8mjsmjFs9zUbLq/SlB095le9im/giv5V2wnWwRRIbx6CsaDmqQN4E09Crcxrs
C0m7ww7OwKp4ohqoJFAO55A96uq4ucpiVQlhnGTFSDvdh2WyWjSqpi7CH+i7OA8lqpDl
JjEA==
X-Gm-Message-State: AFq9FYJpPDqi1Dq/B0n1OrkiwSfB2mAhTQ9X0Cm4CcQzliu8BnPlN1I6
jmpRScO/OKL01NpNWLCUMUn3yTcsYifp+cF+fKgnklLF5A2iU+3Z2Hpm
X-Gm-Gg: AYBFou1H5PEQgJsPSZlZkOU2cRocZdzDTd+0MJn+bkscOFn9FotAyvYJlvvTA0SuOwS
E9mWZ+QpJ+nS7XHIlrE9SVv6UxcCbQ0zqWZPIWlXpM5nwJbwl1RhUwZU2zpaDU1RI2E43L1PvlK
9L2ltaF0pL+F6uLJ7bVb7MyVvdDmo7KRvN1zZtVtENKt+lIlsKOsE8OazZrIBPC7z3BSaxQil9W
yCdetkvuaiiKQQ2AHN94lgHXr5znajUBYad4kyFbq9GrD0BBDR7vLOqsWGCbjGZd2zfZVSYmJe0
cHqQjZy0YXfI6ptIQdX4RcCvrVV+CvtGHC5uhPUdVw6YMCSQ+ScO5wMQdJpcJUhmEcT4yZltWau
JetRDtkOFFJ1Yf+K0zmpAgCvjHjVjP6J5319t9mQTE0/MosA6UM1wJBC7LDsTqc6omhkMbBeq5y
mfs8sOkFq12pTvYtd66gb2sAWuu4YK0aykzEer70FCiz1vDylH8K2ScIIeUxPAj4fP
X-Received: by 2002:a17:903:19e7:b0:2e6:1a6c:abcd with SMTP id d9443c01a7336-2e84280a68fmr108075ad.3.1791497612535;
Thu, 08 Oct 2026 15:13:32 -0700 (PDT)
X-Received: from localhost ([2a03:2880:2ff:55::])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e8422b8c57sm337035ad.53.2026.10.08.15.13.31
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 08 Oct 2026 15:13:31 -0700 (PDT)
X-Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jonathan Corbet <corbet@lwn.net>, Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>, Jesper Dangaard Brouer <hawk@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>, Luigi Rizzo <lrizzo@google.com>,
Björn Töpel <bjorn@kernel.org>, Pavel Begunkov <asml.silence@gmail.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261008023030.1089616-1-almasrymina@google.com>