Skip to contentSkip to conversation

pciutils: Add decode support for RCECs

PATCH Applied Sean V Kelley 2 participants 3 messages Jun 24, 2020 – Sep 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 pciutils: Add decode support for RCECs

Root Complex Event Collectors provide support for terminating error and PME messages from RCiEPs. This patch provides basic decoding for the lspci RCEC Endpoint Association Extended Capability. See PCIe 5.0-1, sec 7.9.10 for further details.

---
Changes since v2 [1]:

- Incorporated suggested improvement to RCiEP bitmap generation.
- Extended to support hyphenating adjacent devices in bitmap.
- Added verbose granularity on "none" cases for bitmap and BUSN reporting.
- Corrected use of "first" with "next" as found in the Spec.
- Reported "AssociatedBusNumbers" as a single hyphenated field.
- Regenerated test output with new formatting.
i.e.,

"-vvv" case
Capabilities: [160 v2] Root Complex Event Collector Endpoint Association
RCiEPBitmap: 00000000 [none]
AssociatedBusNumbers: ff-00 [none]

"-vv" case
Capabilities: [160 v2] Root Complex Event Collector Endpoint Association
RCiEPBitmap: [none]
AssociatedBusNumbers: [none]

(Bjorn Helgaas)

[1] https://lore.kernel.org/linux-pci/[email protected]/

Thanks,

Sean

---
 lib/header.h   |   8 +-
 ls-ecaps.c     |  59 +++++++++-
 setpci.c       |   2 +-
 tests/cap-rcec | 299 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 364 insertions(+), 4 deletions(-)
 create mode 100644 tests/cap-rcec
lib/header.h +7 -1
index 472816e..57a9343 100644
@@ -219,7 +219,7 @@
 #define PCI_EXT_CAP_ID_PB	0x04	/* Power Budgeting */
 #define PCI_EXT_CAP_ID_RCLINK	0x05	/* Root Complex Link Declaration */
 #define PCI_EXT_CAP_ID_RCILINK	0x06	/* Root Complex Internal Link Declaration */
-#define PCI_EXT_CAP_ID_RCECOLL	0x07	/* Root Complex Event Collector */
+#define PCI_EXT_CAP_ID_RCEC	0x07	/* Root Complex Event Collector */
 #define PCI_EXT_CAP_ID_MFVC	0x08	/* Multi-Function Virtual Channel */
 #define PCI_EXT_CAP_ID_VC2	0x09	/* Virtual Channel (2nd ID) */
 #define PCI_EXT_CAP_ID_RCRB	0x0a	/* Root Complex Register Block */
@@ -1048,6 +1048,12 @@
 #define  PCI_RCLINK_LINK_ADDR	8	/* Link Entry: Address (64-bit) */
 #define  PCI_RCLINK_LINK_SIZE	16	/* Link Entry: sizeof */
 
+/* Root Complex Event Collector Endpoint Association */
+#define  PCI_RCEC_EP_CAP_VER(reg)	(((reg) >> 16) & 0xf)
+#define  PCI_RCEC_BUSN_REG_VER	0x02	/* as per PCIe sec 7.9.10.1 */
+#define  PCI_RCEC_RCIEP_BMAP	0x0004	/* as per PCIe sec 7.9.10.2 */
+#define  PCI_RCEC_BUSN_REG	0x0008	/* as per PCIe sec 7.9.10.3 */
+
 /* PCIe Vendor-Specific Capability */
 #define PCI_EVNDR_HEADER	4	/* Vendor-Specific Header */
 #define PCI_EVNDR_REGISTERS	8	/* Vendor-Specific Registers */
ls-ecaps.c +57 -2

71 lines not on this page · raw message

setpci.c +1 -1
index 90ca726..2cb70fa 100644
@@ -350,7 +350,7 @@ static const struct reg_name pci_reg_names[] = {
   { 0x20004,	0, 0, "ECAP_PB" },
   { 0x20005,	0, 0, "ECAP_RCLINK" },
   { 0x20006,	0, 0, "ECAP_RCILINK" },
-  { 0x20007,	0, 0, "ECAP_RCECOLL" },
+  { 0x20007,	0, 0, "ECAP_RCEC" },
   { 0x20008,	0, 0, "ECAP_MFVC" },
   { 0x20009,	0, 0, "ECAP_VC2" },
   { 0x2000a,	0, 0, "ECAP_RBCB" },
tests/cap-rcec new file +299 -0

299 lines not on this page · raw message

--
2.27.0

#1 lore raw

Hello!

Quoted 4 lines

Root Complex Event Collectors provide support for terminating error and PME messages from RCiEPs. This patch provides basic decoding for the lspci RCEC Endpoint Association Extended Capability. See PCIe 5.0-1, sec 7.9.10 for further details.

Applied.

Thanks and sorry for the delay.

Have a nice fortnight

Signature · 3 lines
Martin `MJ' Mareš                        <[email protected]>   http://mj.ucw.cz/
United Computer Wizards, Prague, Czech Republic, Europe, Earth, Universe
A Bash poem: time for echo in canyon; do echo $echo $echo; done
#2 lore raw
Quoted 7 lines · Martin Mareš

Hello!

Quoted 4 lines

Root Complex Event Collectors provide support for terminating error and PME messages from RCiEPs. This patch provides basic decoding for the lspci RCEC Endpoint Association Extended Capability. See PCIe 5.0-1, sec 7.9.10 for further details.

Quoted 5 lines

Applied.

Thanks and sorry for the delay.

Have a nice fortnight

Many thanks Martin.

Cheers,

Sean

Quoted 4 lines
Signature · 3 lines
Martin `MJ' Mareš                        <[email protected]>   http://mj.ucw.cz/
United Computer Wizards, Prague, Czech Republic, Europe, Earth, Universe
A Bash poem: time for echo in canyon; do echo $echo $echo; done