🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7082

[RFC net-next 0/3] net: airoha: npu: keep NPU-shared DMA buffers in the NPU window

#7082
From: Chris Scott
Date: Sat, 24 Oct 2026 15:41
74 lines
14207 bytes
The EN7581 NPU can only address host DRAM at 0x80000000-0xbfffffff;
higher addresses alias the lower 1 GiB, as confirmed by Airoha [1].
On boards with 2 GiB of RAM nothing keeps the buffers the NPU reads
and writes inside that window:

- the mailbox buffers are streaming-mapped kzalloc() memory, which on
  arm64 bounces through swiotlb; on W1700K the swiotlb pool is at
  0xff6cf000, so the NPU version query reads back 0.0 and mt76 does not
  bind NPU offload (this is the issue behind the earlier "use coherent
  DMA for mailbox messages" / cacheline-buffer postings [2]);

- the coherent buffers mt76 allocates on the NPU device (NPU TX/RX
  rings, HW-RRO and TXD buffers) currently land in the window only
  because of early-boot allocation order; reserving low DRAM away makes
  the SoC hang right after mt7996 firmware load.

Patch 1 adds an optional "dma" shared-dma-pool region to the NPU
binding. Patch 2 attaches it as the NPU device coherent pool, so every
coherent allocation on the NPU device comes from the window. Patch 3
moves the mailbox to per-core coherent buffers, which then come from
that pool.

Streaming mappings are deliberately left alone. Packet buffers are only
passed through to the WiFi DMA engine; restricting them with a
restricted-dma-pool or a bus DMA limit forces swiotlb bouncing and cost
~22% of host-path WiFi TX in testing, and the default swiotlb pool is
itself outside the window on these boards.

Sent as RFC while net-next is closed; I will repost as v1 once it
reopens. Feedback on the approach is welcome, in particular whether a
reserved coherent pool is the preferred way to express the NPU window
rather than a dma-ranges based limit.

Testing: Daniel tested this series, backported to OpenWrt kernel
6.18.57, on a Gemtek W1700K (EN7581 + MT7996, 2 GiB) with a 16 MiB
pool: the pool is assigned at 0xbf000000-0xbfffffff, the NPU version
query is correct, all three bands and MLO come up and there are no
warnings. I tested the equivalent of patches 2 and 3 on the same board
with 6.18.55 and 7.3-rc6: all mt76 NPU rings/RRO/TXD buffers come from
the pool (~10.7 MiB used), host-path and offloaded WiFi throughput are
unchanged versus no pool, and boot still succeeds with low DRAM
reserved away. On net-next the series was build-tested with W=1
(airoha and mt76 incl. MT7996_NPU, at each patch), checkpatch --strict
and dt_binding_check.

mainline en7581.dtsi does not have an NPU node yet, so there is no DTS
change here; boards using the WLAN offload need a 16 MiB pool, others
only need the mailbox (1 MiB is plenty).

Tools: patch 1 was originally written with Codex and patch 3 with
Cursor; patch 2 was written with Claude (Anthropic), which was also
used to rebase patches 1 and 3 onto net-next and rewrite their commit
messages.

[1] https://lore.kernel.org/r/atCRsquzA1UxSpCc@mediatek.com
[2] https://lore.kernel.org/r/20260809152813.585797-1-pawlik.dan@gmail.com

Chris Scott (1):
  net: airoha: npu: attach a coherent pool in the NPU window

Daniel Pawlik (2):
  dt-bindings: net: airoha: npu: add DMA pool memory region
  net: airoha: npu: use coherent memory for mailbox messages

 .../bindings/net/airoha,en7581-npu.yaml       | 40 +++++----
 drivers/net/ethernet/airoha/airoha_npu.c      | 83 +++++++++++++++----
 include/linux/soc/airoha/airoha_offload.h     |  3 +
 3 files changed, 95 insertions(+), 31 deletions(-)


base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
-- 
2.53.0
Technical Details
Message-ID: <20261024154150.45733-1-gilroyscott1970@gmail.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-351412-linux-kernel-netdev=dewy.ru

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-351412-linux-kernel-netdev=dewy.ru
From: gilroyscott1970@gmail.com (Chris Scott)
Newsgroups: linux.kernel.netdev
Subject: [RFC net-next 0/3] net: airoha: npu: keep NPU-shared DMA buffers in the NPU window
Date: Sun, 25 Oct 2026 01:41:47 +1000
Organization: Usenet Network
Message-ID: <20261024154150.45733-1-gilroyscott1970@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="795859"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:72bis4AMwEsrR5JPVYPj5LzGJqo= sha256:Dt+DmVB0LTRnQV/gUe/vwo2gT2v0Esdf0u9JGcCDXiY=
	sha1:jfU02gBa3N883VZN8LFj4cv+0Vo= sha256:LQhtg09aUejRKnRTtO71BRSH5F38JFge4BwHrHvIE2E=
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 531A3111674; Sat, 24 Oct 2026 18:43:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 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.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, 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 1ehhMKwovCoM;
	Sat, 24 Oct 2026 18:43:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-351412-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id E5B5E111672; Sat, 24 Oct 2026 18:43:26 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 11DDB374D9; Sat, 24 Oct 2026 15:42:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792856525;
	b=lBwJg3eFSZwtssbiNxv3PIVcQI04dWA4PtdJB+HlRhVd+ji+CD4js94IguQCALLYGo2E
	 W4fauyvrAylrHUbTFClbfecTWNTI7txF2G/X7GcbdMtcRO3jLlR2K1N8rVJMWFmq/L7aI
	 zEMh4a5SmTHXCXgsrUJxOvaKj3r3eL14MKh5+hR8qX8fZyQ3kBGK/5UpBoO/xi+lLQD/e
	 y9hJbQFERQD3QQFhsgOrwG7QHlygbhSqMwPAOalKquFbAtt/F/4WKTazqNNQwvpOs6tql
	 +g6mj5hZqQyETHw0y73JeJGI0yEDeVXiHhgmOa8XYgW4FI8fGwikg5DRQVGOc6wIMKA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792856525;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=ANXPqZSHJyzWuXCvN2vxk67OVN57MUfNQmVBTDzT6pM=;
	b=4XDK0u2lnm5mPSKkcpjDj3aVMaQdpdvsmOdAdAYdRCnjQotJf+mFBczwlLp8+YvGV/SF
	 TSSFtyZuSvp2kr2lqlDQ/vM06XqGcfSzhgU5bNuOv529gUbE7XSgZk3ZNvkdNyBBlNl6f
	 SgCJ22/n+2680mY7SISTa0C7pppxgLYxYVz2yWUs+7OES1O/l/6Hgh4+/VhGL895Xy0SY
	 3YzXWnezv4n9S3S7Jba43f4ahxKusmu13AsVHisj2R6v/34Pw/l3gI6/LGE4yC3BIe26V
	 wdqB2LkZ3PWlCPArjY88TRIVErLW7pChy9z1Xf2h0zOLwPlK2mMnS23M2aCGQPDCCIw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=l26u6Qyo;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 42E44606A32E;
	Sat, 24 Oct 2026 15:42:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=l26u6Qyo
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792856524;
	b=UcymUFMpno8MofL3QePXTCwecmd2INJNHlzwxpt/AY74nh72nkuqoN3MZBvCxvUiZRI1
	 CyvYmzwSuLkd+OAxoIAFo1FQ2EgJXsfNKLip9e+Oak3T16y02hiz6gAASPwofDceyJC9Y
	 vTd+VquCxGxSJq4Jf2W5ps+tiwtWMQZKidhU4fECzgIC8+Wv06GcYPzJpED7u8p7peZ0x
	 4SxY0mutlQ4H7CTK7QTxEbIVALJ0RIgU2buv+qVYNw33QN7/bNkfJDx6yu/Ygnt6rSpPV
	 wdvY7emoL9PRJP83ppoYsNtwBZCRObxT2FOThc9B/+rt9/wzlw6Co5496jZ1Zp1uzeQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792856524;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=ANXPqZSHJyzWuXCvN2vxk67OVN57MUfNQmVBTDzT6pM=;
	b=yqQc8aLOZDHeConeVZnbxtHup0ZiG3/oMdmhVEwO96RqqYP8qVBNQa9oRIdwvc++NWba
	 dZzjoBDwN5Js/dU1ShdG7tV3lvGOrUBjZMrZKNdIfnChSXssQDyv9arQhZgqU4Mxe+P/2
	 YYaWvUAisRX96CFOkObUCpyXcsbGeBer4tpAeSsAozn2RVPr3boKQldfajnCw5DSTVIpO
	 QWEN2icLw00Y0Gwwd0z/qnJVK19mZFZZ37FyMSwxeFuR4JEkx8UN8qw6nDsNh2thSJhKc
	 iQNo6Se0iHPtOmnRtB7q0dOWEC4KYZ2hA2/fOz+OznlEzC5yKUt1YuOb1f6EAQ5szJw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=l26u6Qyo;
	arc=none smtp.remote-ip=74.125.82.178
X-Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95226606A31D
	for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 15:42:03 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 95226606A31D
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-dy1-f178.google.com with SMTP id 5a478bee46e88-369f33df08eso142153eec.0
        for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 08:42:03 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792856523; x=1793461323; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=ANXPqZSHJyzWuXCvN2vxk67OVN57MUfNQmVBTDzT6pM=;
        b=l26u6Qyo4VsDmQaHqwSB36ri5GN01lYrYiOcWD7Eq5g//0E6KjMfeLg0rYu0dcLsrU
         iOyWaupPt++FB1O9YhHxy9pmzIzhxqd+E2wKD+g4L94R8hUybkHwGHdHJgCKza3jR1wr
         bpnQDdfIpoxXNa35d/DBjlTkyx4BK4ftM2L8xxL1KBbaICc1TfGxO/vtS5Ey2m8pZ3s4
         L59imEjt5NQl8JARRGu3IapMlKYDBSkCUmTkI+vul8mjR4BElg58JBThFkDWT6TKi+mR
         jUHihECpRPexgF3esg4mIhGY/8MWPYDQKBky0kqXiCtEj2yKEX4531auLfTqc6oaqrEr
         AT4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792856523; x=1793461323;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ANXPqZSHJyzWuXCvN2vxk67OVN57MUfNQmVBTDzT6pM=;
        b=zlJyRRTmvVkXYojVMa8moJrjAS3nTBCbb0SxID0hEhEMLhkC+lgcFDSkW8C55UBqmK
         wNyEJC/KzUJeeNn7RrVdtYn8C/SxW9kcc58uu0JpJ+EBj1tEq3WnPPB+L+qiatXwXzD5
         uSAleAzw4alOr9tWeLJLZ7JpuJlxeSEOvMxYycHk9CKsGi28k1ttQZRZu4S+VkR6uG3Q
         dTCL70s7ubL1xrBPI5kD2RvWUt0RhxgJaLr8D7c75jw59uLUoUvQkv9Uo5hUfN0xAr6G
         edgMl6n4OhywmerJH4pTrleasdrnGxfKeIQHKexpXaHmLJx3Vj78Cw1vqd96q81tgZ8/
         8kAQ==
X-Gm-Message-State: AFq9FYLgr/lXQA93Bvyo4nOIomcj63DjykZSVPSowrbAH5glxtQDmayQ
	Yp7YjZx7xvH5FLRPB+EDi57bN4gz7khvO4F1+w3SoD61Z2PQKBh6CMW/dZE57MZv
X-Gm-Gg: AYBFou3BB7YctvaQsfHU1cP/XaRxCnLrIbzJneRgeb6J2XZ+Fh75g9EYLTEPsnB9x1p
	qbvJZMhYlLDbKxPCt3H4MAZzDMzuHPVxmj21MtGLrT5WL/RRWDl86/0ISiljX3vHmMs3koeYt9c
	c9XSDKa1FpB+TW8ghwhNsG492AL80o3rO09/dKV9Bze1j0Y1E3eFkjO2x4D/QFdyRTcCQxkfCZi
	oh2hIigVDDDXi+MR3hde5KG0A3+I8jsVsgqEGmCEcNzc3zzp+SCnYIbxb1JclUdKBV0VccMGRv+
	ZwATIKNp82xjBRc6EEDHsUgkMSvNKRmA7TpXTNWypqsRBBZxyxdluRfb5XHNouokeBaFOR1aD90
	QhCFWEksfQNkWHbhtia8udCp784bO66Xi0z6N3F2B1GqmCOaXnrmaZW2gSO2bm+jZ+th4Lwvo6/
	TSFEg1WF9CH6rYIljQXlri1varbx5afUBWw0nLJk6GlJ04SVQu1+ueO2O8FnV1lt2XDMGYT7AYn
	FLiMaI58z8D6SaV2GyqiKhXd1OH/r6yZg9+VOxpwC8UYZEJ9i2rtUGORA==
X-Received: by 2002:a05:693c:880c:20b0:369:2040:cc88 with SMTP id 5a478bee46e88-369e86144a3mr3470823eec.20.1792856522555;
        Sat, 24 Oct 2026 08:42:02 -0700 (PDT)
X-Received: from plex ([2406:6d00:a27c:4200:aab8:e0ff:fe02:33c1])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-369e8daf444sm7766450eec.18.2026.10.24.08.41.56
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sat, 24 Oct 2026 08:42:02 -0700 (PDT)
X-Cc: lorenzo@kernel.org,
	andrew+netdev@lunn.ch,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	robh@kernel.org,
	krzk+dt@kernel.org,
	conor+dt@kernel.org,
	matthias.bgg@gmail.com,
	angelogioacchino.delregno@collabora.com,
	devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	pawlik.dan@gmail.com,
	zhengping.zhang@airoha.com,
	Chris Scott <gilroyscott1970@gmail.com>
X-Mailer: git-send-email 2.53.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list