[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251023071916.901355-26-den@valinux.co.jp>
Date: Thu, 23 Oct 2025 16:19:16 +0900
From: Koichiro Den <den@...inux.co.jp>
To: ntb@...ts.linux.dev,
linux-pci@...r.kernel.org,
dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: mani@...nel.org,
kwilczynski@...nel.org,
kishon@...nel.org,
bhelgaas@...gle.com,
corbet@....net,
vkoul@...nel.org,
jdmason@...zu.us,
dave.jiang@...el.com,
allenbh@...il.com,
Basavaraj.Natikar@....com,
Shyam-sundar.S-k@....com,
kurt.schwemmer@...rosemi.com,
logang@...tatee.com,
jingoohan1@...il.com,
lpieralisi@...nel.org,
robh@...nel.org,
jbrunet@...libre.com,
Frank.Li@....com,
fancer.lancer@...il.com,
arnd@...db.de,
pstanner@...hat.com,
elfring@...rs.sourceforge.net
Subject: [RFC PATCH 25/25] Documentation: PCI: endpoint: pci-epf-vntb: Update and add mwN_offset usage
Add a concrete example showing how to place two memory windows in the
same BAR (one for data, one for interrupts) by using 'mwN_offset' and
'mwN_bar'. This is useful when BAR resources are scarce and is aligned
with recent endpoint-side inbound mapping support.
Note that part of the `ls` delta covers missing doc update for
attributes that were introduced in the commit e7cd58d2fdf8 ("PCI:
endpoint: pci-epf-vntb: Allow BAR assignment via configfs")
Signed-off-by: Koichiro Den <den@...inux.co.jp>
---
Documentation/PCI/endpoint/pci-vntb-howto.rst | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/Documentation/PCI/endpoint/pci-vntb-howto.rst b/Documentation/PCI/endpoint/pci-vntb-howto.rst
index 70d3bc90893f..142cf9244cc6 100644
--- a/Documentation/PCI/endpoint/pci-vntb-howto.rst
+++ b/Documentation/PCI/endpoint/pci-vntb-howto.rst
@@ -90,8 +90,10 @@ of the function device and is populated with the following NTB specific
attributes that can be configured by the user::
# ls functions/pci_epf_vntb/func1/pci_epf_vntb.0/
- db_count mw1 mw2 mw3 mw4 num_mws
- spad_count
+ ctrl_bar mw1_bar mw2_offset mw4 spad_count
+ db_bar mw1_offset mw3 mw4_bar vbus_number
+ db_count mw2 mw3_bar mw4_offset vntb_pid
+ mw1 mw2_bar mw3_offset num_mws vntb_vid
A sample configuration for NTB function is given below::
@@ -106,6 +108,16 @@ A sample configuration for virtual NTB driver for virtual PCI bus::
# echo 0x080A > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vntb_pid
# echo 0x10 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vbus_number
+When BAR resources are tight but you still want to enable interrupts (which
+require a dedicated MW in addition to the data MW), map both MWs into a
+single BAR via 'mwN_offset' and 'mwN_bar' as shown below::
+
+ # echo 0xF0000 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/mw1
+ # echo 0x8000 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/mw2
+ # echo 0xF0000 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/mw2_offset
+ # echo 2 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/mw1_bar
+ # echo 2 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/mw2_bar
+
Binding pci-epf-ntb Device to EP Controller
--------------------------------------------
--
2.48.1
Powered by blists - more mailing lists