From: "Frédéric Mahé" <frederic.mahe@cirad.fr>
To: Vlad Banea <montrealtango@gmail.com>
Cc: "Frédéric Mahé" <frederic.mahe@cirad.fr>,
"Yixun Lan" <dlan@kernel.org>,
troy.mitchell@linux.spacemit.com, wangruikang@iscas.ac.cn,
guodong.xu@oss.qualcomm.com, jyc0019@gmail.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, pjw@kernel.org,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
spacemit@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] riscv: dts: spacemit: k1: give each PCIe port its own DMA window
Date: Tue, 17 Nov 2026 10:51:28 +0100 [thread overview]
Message-ID: <20261117095129.97140-1-frederic.mahe@cirad.fr> (raw)
In-Reply-To: <20261117084938.82968-1-frederic.mahe@cirad.fr>
A follow-up question on the hole that remains for each port.
On the BPI-F3 the remaining pcie1 hole (CPU 0x1_1000_0000-0x1_1fff_ffff)
still costs a lot: anonymous pages often come from the low end of
ZONE_NORMAL, and when fio's buffers land there, 4k random reads lose
about half their IOPS to SWIOTLB bouncing.
The port only uses a small part of its 256 MB window here:
pci 0001:00:00.0: BAR 0 [mem 0x90000000-0x900fffff]: assigned
pci 0001:00:00.0: BAR 1 [mem 0x90100000-0x901fffff]: assigned
pci 0001:00:00.0: bridge window [mem 0x90200000-0x902fffff]: assigned
So I tried a test DT that excludes only bus 0x9000_0000-0x903f_ffff
from pcie1's dma-ranges (the root port BARs and the bridge window, plus
margin), on top of your v2:
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
<0x0 0x80000000 0x1 0x00000000 0x0 0x10000000>,
<0x0 0x90400000 0x1 0x10400000 0x0 0x0fc00000>,
<0x0 0xa0000000 0x1 0x20000000 0x3 0x60000000>;
Results (v7.4-rc1, 16 GB, NVMe on pcie1):
- 15529 pages in CPU 0x1_1040_0000-0x1_1fff_ffff: 4 KiB O_DIRECT write
and read per page, no bounce, every page read back correctly
- fio crc32c verify (16 GiB direct, 8 GiB buffered) OK, no AER
- 4k random read, IOPS (1 job QD32 / 4 jobs QD32 / 8 jobs QD16):
v2 27.5k / 86k / 137k, test DT 47.5k / 185k / 193k
(same as booting with mem=2G, where nothing bounces)
I did not try DMA into the bridge window itself, as that would target
the drive's own BAR.
So it looks like the root port only claims its programmed BARs and
bridge window, not the whole 256 MB aperture. Troy, is that how the K1
root port works? If so, would a smaller aperture for pcie1 (the M.2
slot on most boards, e.g. 16 MB), with a matching smaller hole, be
acceptable? The other ports could keep large windows.
Thanks,
Frédéric
prev parent reply other threads:[~2026-11-17 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 2:31 Vlad Banea
2026-11-13 8:40 ` Troy Mitchell
2026-11-14 1:44 ` Yixun Lan
2026-11-17 8:49 ` Frédéric Mahé
2026-11-17 9:51 ` Frédéric Mahé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261117095129.97140-1-frederic.mahe@cirad.fr \
--to=frederic.mahe@cirad.fr \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@kernel.org \
--cc=guodong.xu@oss.qualcomm.com \
--cc=jyc0019@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=montrealtango@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=troy.mitchell@linux.spacemit.com \
--cc=wangruikang@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®