Skip to contentSkip to conversation

misc: Add Synopsys DesignWare xData IP driver

PATCH Superseded Gustavo Pimentel 3 participants 8 messages Mar 29, 2021 – May 11, 2021

Subsystems (4)

v10 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#1 lore raw

PATCH v10 1/4 misc: Add Synopsys DesignWare xData IP driver

In reply to Gustavo Pimentel

Add Synopsys DesignWare xData IP driver. This driver enables/disables the PCI traffic generator module pertain to the Synopsys DesignWare prototype.

---
 drivers/misc/Kconfig         |  10 ++
 drivers/misc/Makefile        |   1 +
 drivers/misc/dw-xdata-pcie.c | 420 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 431 insertions(+)
 create mode 100644 drivers/misc/dw-xdata-pcie.c
drivers/misc/Kconfig +10 -0
index f532c59..e6af9ff 100644
@@ -402,6 +402,16 @@ config SRAM
 config SRAM_EXEC
 	bool
 
+config DW_XDATA_PCIE
+	depends on PCI
+	tristate "Synopsys DesignWare xData PCIe driver"
+	help
+	  This driver allows controlling Synopsys DesignWare PCIe traffic
+	  generator IP also known as xData, present in Synopsys DesignWare
+	  PCIe Endpoint prototype.
+
+	  If unsure, say N.
+
 config PCI_ENDPOINT_TEST
 	depends on PCI
 	select CRC32
drivers/misc/Makefile +1 -0
index 99b6f15..5411996 100644
@@ -47,6 +47,7 @@ obj-$(CONFIG_SRAM_EXEC)		+= sram-exec.o
 obj-$(CONFIG_GENWQE)		+= genwqe/
 obj-$(CONFIG_ECHO)		+= echo/
 obj-$(CONFIG_CXL_BASE)		+= cxl/
+obj-$(CONFIG_DW_XDATA_PCIE)	+= dw-xdata-pcie.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
 obj-$(CONFIG_OCXL)		+= ocxl/
 obj-$(CONFIG_BCM_VK)		+= bcm-vk/
drivers/misc/dw-xdata-pcie.c new file +420 -0

420 lines not on this page · raw message

Signature · 1 line
2.7.4
#0 lore raw

v10 cover misc: Add Synopsys DesignWare xData IP driver

This patch series adds a new driver called xData-pcie for the Synopsys DesignWare PCIe prototype.

The driver configures and enables the Synopsys DesignWare PCIe traffic generator IP inside of prototype Endpoint which will generate upstream and downstream PCIe traffic. This allows to quickly test the PCIe link throughput speed and check is the prototype solution has some limitation or not.

Changes:
V2: Rework driver according to Greg Kroah-Hartman' feedback
- Replace module parameter by sysfs use.
- Replace bit fields structure with macros and masks use.
- Removed SET() and GET() macros by the writel() and readl().
- Removed some noisy info messages.
V3: Fixed issues detected while running on 64 bits platforms
Rebased patches on top of v5.11-rc1 version
V4: Rework driver according to Greg Kroah-Hartman' feedback
- Add the ABI doc related to the sysfs implemented on this driver
V5: Rework driver accordingly to Leon Romanovsky' feedback
- Removed "default n" on Kconfig
Rework driver accordingly to Krzysztof Wilczyński' feedback
- Added some explanatory comments for some steps
- Added some bit defines instead of magic numbers
V6: Rework driver according to Greg Kroah-Hartman' feedback
- Squashed patches #2 and #3
- Removed units (MB/s) on the sys file
- Reduced mutex scope on the functions called by sysfs
Rework driver accordingly to Krzysztof Wilczyński' feedback
- Fix typo "DesignWare"
V7: Rework driver according to Greg Kroah-Hartman' feedback
- Created a sub device (misc device) that will be associated with the PCI driver
- sysfs group is now associated with the misc drivers instead of the PCI driver
V8: Rework driver according to Greg Kroah-Hartman' feedback
- Added more detail to the version changes on the cover letter
- Squashed patches #1 and #2
- Removed struct device from the dw_xdata_pcie structure
- Replaced the pci_*() use by dev_*()
- Added free call for the misc driver name allocation
- Added reference counting
- Removed snps_edda_data structure and their usage
Rebased patches on top of v5.12-rc4 version
V9: Squashed temporary development patch #5 into the driver patch #1
V10: Reworked the write_store() and read_store() to validate the input using kstrtobool()
Removed stop_store()
Update ABI documentation accordingly

Cc Derek Kiernan <[email protected]>
Cc Dragan Cvetic <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Krzysztof Wilczyński <[email protected]>

Gustavo Pimentel (4):
misc: Add Synopsys DesignWare xData IP driver
Documentation: misc-devices: Add Documentation for dw-xdata-pcie
driver
MAINTAINERS: Add Synopsys xData IP driver maintainer
docs: ABI: Add sysfs documentation interface of dw-xdata-pcie driver

 Documentation/ABI/testing/sysfs-driver-xdata |  49 ++++
 Documentation/misc-devices/dw-xdata-pcie.rst |  40 +++
 MAINTAINERS                                  |   7 +
 drivers/misc/Kconfig                         |  10 +
 drivers/misc/Makefile                        |   1 +
 drivers/misc/dw-xdata-pcie.c                 | 420 +++++++++++++++++++++++++++
 6 files changed, 527 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-xdata
 create mode 100644 Documentation/misc-devices/dw-xdata-pcie.rst
 create mode 100644 drivers/misc/dw-xdata-pcie.c
Signature · 1 line
2.7.4
#4 lore raw

PATCH v10 2/4 Documentation: misc-devices: Add Documentation for dw-xdata-pcie driver

Add Documentation for dw-xdata-pcie driver.

---
 Documentation/misc-devices/dw-xdata-pcie.rst | 40 ++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/misc-devices/dw-xdata-pcie.rst
Documentation/misc-devices/dw-xdata-pcie.rst new file +40 -0
new file mode 100644
index 00000000..fd75c93
@@ -0,0 +1,40 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+===========================================================================
+Driver for Synopsys DesignWare PCIe traffic generator (also known as xData)
+===========================================================================
+
+This driver should be used as a host-side (Root Complex) driver and Synopsys
+DesignWare prototype that includes this IP.
+
+The "dw-xdata-pcie" driver can be used to enable/disable PCIe traffic
+generator in either direction (mutual exclusion) besides allowing the
+PCIe link performance analysis.
+
+The interaction with this driver is done through the module parameter and
+can be changed in runtime. The driver outputs the requested command state
+information to /var/log/kern.log or dmesg.
+
+Request write TLPs traffic generation - Root Complex to Endpoint direction
+- Command:
+	echo 1 > /sys/class/misc/dw-xdata-pcie/write
+
+Get write TLPs traffic link throughput in MB/s
+- Command:
+        cat /sys/class/misc/dw-xdata-pcie/write
+- Output example:
+	204
+
+Request read TLPs traffic generation - Endpoint to Root Complex direction:
+- Command:
+	echo 1 > /sys/class/misc/dw-xdata-pcie/read
+
+Get read TLPs traffic link throughput in MB/s
+- Command:
+        cat /sys/class/misc/dw-xdata-pcie/read
+- Output example:
+	199
+
+Request to stop any current TLP transfer:
+- Command:
+	echo 1 > /sys/class/misc/dw-xdata-pcie/stop
Signature · 1 line
2.7.4
#5 lore raw

PATCH v10 3/4 MAINTAINERS: Add Synopsys xData IP driver maintainer

In reply to Gustavo Pimentel

Add Synopsys xData IP driver maintainer.

This driver aims to support Synopsys xData IP and is normally distributed along with Synopsys PCIe EndPoint IP as a PCIe traffic generator (depends of the use and licensing agreement).

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index 9e87692..36387b3 100644
@@ -5099,6 +5099,13 @@ S:	Maintained
 F:	drivers/dma/dw-edma/
 F:	include/linux/dma/edma.h
 
+DESIGNWARE XDATA IP DRIVER
+M:	Gustavo Pimentel <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/misc-devices/dw-xdata-pcie.rst
+F:	drivers/misc/dw-xdata-pcie.c
+
 DESIGNWARE USB2 DRD IP DRIVER
 M:	Minas Harutyunyan <[email protected]>
 L:	[email protected]
Signature · 1 line
2.7.4
#6 lore raw

PATCH v10 4/4 docs: ABI: Add sysfs documentation interface of dw-xdata-pcie driver

In reply to Gustavo Pimentel

This patch describes the sysfs interface implemented on the dw-xdata-pcie driver.

---
 Documentation/ABI/testing/sysfs-driver-xdata | 49 ++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-xdata
Documentation/ABI/testing/sysfs-driver-xdata new file +49 -0
new file mode 100644
index 00000000..f574e8e
@@ -0,0 +1,49 @@
+What:		/sys/class/misc/drivers/dw-xdata-pcie.<device>/write
+Date:		April 2021
+KernelVersion:	5.13
+Contact:	Gustavo Pimentel <[email protected]>
+Description:	Allows the user to enable the PCIe traffic generator which
+		will create write TLPs frames - from the Root Complex to the
+		Endpoint direction or to disable the PCIe traffic generator
+		in all directions.
+
+		Write y/1/on to enable, n/0/off to disable
+
+		Usage e.g.
+		 echo 1 > /sys/class/misc/dw-xdata-pcie.<device>/write
+		or
+		 echo 0 > /sys/class/misc/dw-xdata-pcie.<device>/write
+
+		The user can read the current PCIe link throughput generated
+		through this generator in MB/s.
+
+		Usage e.g.
+		 cat /sys/class/misc/dw-xdata-pcie.<device>/write
+		 204
+
+		The file is read and write.
+
+What:		/sys/class/misc/dw-xdata-pcie.<device>/read
+Date:		April 2021
+KernelVersion:	5.13
+Contact:	Gustavo Pimentel <[email protected]>
+Description:	Allows the user to enable the PCIe traffic generator which
+		will create read TLPs frames - from the Endpoint to the Root
+		Complex direction or to disable the PCIe traffic generator
+                in all directions.
+
+		Write y/1/on to enable, n/0/off to disable
+
+		Usage e.g.
+		 echo 1 > /sys/class/misc/dw-xdata-pcie.<device>/read
+		or
+		 echo 0 > /sys/class/misc/dw-xdata-pcie.<device>/read
+
+		The user can read the current PCIe link throughput generated
+		through this generator in MB/s.
+
+		Usage e.g.
+		 cat /sys/class/misc/dw-xdata-pcie.<device>/read
+		 199
+
+		The file is read and write.
Signature · 1 line
2.7.4
#7 lore raw
In reply to Gustavo Pimentel
Quoted 8 lines · Gustavo Pimentel

This patch series adds a new driver called xData-pcie for the Synopsys DesignWare PCIe prototype.

The driver configures and enables the Synopsys DesignWare PCIe traffic generator IP inside of prototype Endpoint which will generate upstream and downstream PCIe traffic. This allows to quickly test the PCIe link throughput speed and check is the prototype solution has some limitation or not.

Looks good, all now queued up.

greg k-h

#2 lore raw
In reply to Gustavo Pimentel

Hi Gustavo,

Quoted 5 lines · Gustavo Pimentel

Add Synopsys DesignWare xData IP driver. This driver enables/disables the PCI traffic generator module pertain to the Synopsys DesignWare prototype.

Thanks for your patch, which is now commit e8a30eef6ef6da49 ("misc: Add Synopsys DesignWare xData IP driver") in v5.13-rc1.

Quoted 5 lines
drivers/misc/Kconfig +0 -0
index f532c59..e6af9ff 100644

drivers/misc/Kconfig config SRAM · line 411

Quoted 10 lines
drivers/misc/Kconfig +7 -0
@@ -402,6 +402,16 @@ config SRAM
 config SRAM_EXEC
        bool
 
+config DW_XDATA_PCIE
+       depends on PCI
+       tristate "Synopsys DesignWare xData PCIe driver"
+       help
+         This driver allows controlling Synopsys DesignWare PCIe traffic
+         generator IP also known as xData, present in Synopsys DesignWare
+         PCIe Endpoint prototype.

Hence shouldn't this depend on PCIE_DW_EP, and perhaps be moved to drivers/pcie/?
Or is that a driver for a different Synopsys DesignWare PCIe Endpoint?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#3 lore raw
Quoted 21 lines · Geert Uytterhoeven

Hi Gustavo,

Quoted 5 lines · Gustavo Pimentel

Add Synopsys DesignWare xData IP driver. This driver enables/disables the PCI traffic generator module pertain to the Synopsys DesignWare prototype.

Thanks for your patch, which is now commit e8a30eef6ef6da49 ("misc: Add Synopsys DesignWare xData IP driver") in v5.13-rc1.

Quoted 8 lines
drivers/misc/Kconfig +0 -0
index f532c59..e6af9ff 100644
@@ -402,6 +402,16 @@ config SRAM
 config SRAM_EXEC
        bool
 
Quoted 11 lines

drivers/misc/Kconfig config SRAM · line 411

Quoted 7 lines
drivers/misc/Kconfig +7 -0
+config DW_XDATA_PCIE
+       depends on PCI
+       tristate "Synopsys DesignWare xData PCIe driver"
+       help
+         This driver allows controlling Synopsys DesignWare PCIe traffic
+         generator IP also known as xData, present in Synopsys DesignWare
+         PCIe Endpoint prototype.

Hence shouldn't this depend on PCIE_DW_EP, and perhaps be moved to drivers/pcie/?
Or is that a driver for a different Synopsys DesignWare PCIe Endpoint?

Hi Geert,

the Synopsys DesignWare PCIe Endpoint is a different thing, although it has the Endpoint on the name, it's not quite like others EP drivers.

-Gustavo

Quoted 11 lines

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds