lspci: Decode more DevCtl2 fields
Subsystems (2)
cover lspci: Decode more DevCtl2 fields
From: Bjorn Helgaas <[email protected]>
Decode several more DevCtl2 fields and show Interrupt Message Numbers more consistently.
Bjorn Helgaas (8):
lspci: Reorder PCIe DevCtl2 fields to match spec
lspci: Decode PCIe DevCtl2 ID-Based Ordering Enables
lspci: Decode PCIe DevCtl2 Emergency Power Reduction Request
lspci: Decode PCIe DevCtl2 End-to-End TLP Prefix Blocking
lspci: Decode PCIe LnkCtl Link Disable as 'LnkDisable'
lspci: Print PCIe Interrupt Message Numbers consistently
lspci: Remove spurious colon (':') from PCIe PTM decoding
setpci: Fix man page typo
lib/header.h | 4 ++++ ls-caps.c | 20 +++++++++++++------- ls-ecaps.c | 12 ++++++------ setpci.man | 2 +- 4 files changed, 24 insertions(+), 14 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/8 lspci: Reorder PCIe DevCtl2 fields to match spec
From: Bjorn Helgaas <[email protected]>
Decode the PCIe DevCtl2 fields in the same order they're documented in the PCIe spec.
--- ls-caps.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
ls-caps.c +6 -5
@@ -1153,12 +1153,9 @@ static void cap_express_dev2(struct device *d, int where, int type) } w =get_conf_word (d, where +PCI_EXP_DEVCTL2 ); -printf ("\t\tDevCtl2: Completion Timeout: %s, TimeoutDis%c LTR%c 10BitTagReq%c OBFF %s," , +printf ("\t\tDevCtl2: Completion Timeout: %s, TimeoutDis%c" ,cap_express_dev2_timeout_value (PCI_EXP_DEVCTL2_TIMEOUT_VALUE (w)), -FLAG (w,PCI_EXP_DEVCTL2_TIMEOUT_DIS ), -FLAG (w,PCI_EXP_DEVCTL2_LTR ), -FLAG (w,PCI_EXP_DEVCTL2_10BIT_TAG_REQ ), -cap_express_devctl2_obff (PCI_EXP_DEVCTL2_OBFF (w))); +FLAG (w,PCI_EXP_DEVCTL2_TIMEOUT_DIS ));if (type ==PCI_EXP_TYPE_ROOT_PORT || type ==PCI_EXP_TYPE_DOWNSTREAM )printf (" ARIFwd%c\n" ,FLAG (w,PCI_EXP_DEVCTL2_ARI ));else
@@ -1176,6 +1173,10 @@ static void cap_express_dev2(struct device *d, int where, int type)printf (" EgressBlck%c" ,FLAG (w,PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK ));printf ("\n" ); } +printf ("\t\t\t LTR%c 10BitTagReq%c OBFF %s\n" , +FLAG (w,PCI_EXP_DEVCTL2_LTR ), +FLAG (w,PCI_EXP_DEVCTL2_10BIT_TAG_REQ ), +cap_express_devctl2_obff (PCI_EXP_DEVCTL2_OBFF (w))); }static const char *cap_express_link2_speed_cap (int vector)
Signature · 1 line
2.34.1
PATCH 2/8 lspci: Decode PCIe DevCtl2 ID-Based Ordering Enables
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Decode the PCIe DevCtl2 ID-Based Ordering Enable bits.
--- lib/header.h | 2 ++ ls-caps.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)
lib/header.h +2 -0
@@ -903,6 +903,8 @@#define PCI_EXP_DEVCTL2_ARI 0x0020/* ARI Forwarding */ #define PCI_EXP_DEVCTL2_ATOMICOP_REQUESTER_EN 0x0040/* AtomicOp RequesterEnable */ #define PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK 0x0080/* AtomicOp Egress Blocking */ +#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100/* Allow IDO for requests */ +#define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200/* Allow IDO for completions */ #define PCI_EXP_DEVCTL2_LTR 0x0400/* LTR enabled */ #define PCI_EXP_DEVCTL2_10BIT_TAG_REQ 0x1000/* 10 Bit Tag Requester enabled */ #define PCI_EXP_DEVCTL2_OBFF (x) (((x) >> 13) & 3)/* OBFF enabled */
ls-caps.c +3 -1
@@ -1173,7 +1173,9 @@ static void cap_express_dev2(struct device *d, int where, int type)printf (" EgressBlck%c" ,FLAG (w,PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK ));printf ("\n" ); } -printf ("\t\t\t LTR%c 10BitTagReq%c OBFF %s\n" , +printf ("\t\t\t IDOReq%c IDOCompl%c LTR%c 10BitTagReq%c OBFF %s\n" , +FLAG (w,PCI_EXP_DEVCTL2_IDO_REQ_EN ), +FLAG (w,PCI_EXP_DEVCTL2_IDO_CMP_EN ),FLAG (w,PCI_EXP_DEVCTL2_LTR ),FLAG (w,PCI_EXP_DEVCTL2_10BIT_TAG_REQ ),cap_express_devctl2_obff (PCI_EXP_DEVCTL2_OBFF (w)));
Signature · 1 line
2.34.1
PATCH 3/8 lspci: Decode PCIe DevCtl2 Emergency Power Reduction Request
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Decode the PCIe DevCtl2 Emergency Power Reduction Request bit.
--- lib/header.h | 1 + ls-caps.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
lib/header.h +1 -0
@@ -906,6 +906,7 @@#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100/* Allow IDO for requests */ #define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200/* Allow IDO for completions */ #define PCI_EXP_DEVCTL2_LTR 0x0400/* LTR enabled */ +#define PCI_EXP_DEVCTL2_EPR_REQ 0x0800/* Emergency Power Reduction Request */ #define PCI_EXP_DEVCTL2_10BIT_TAG_REQ 0x1000/* 10 Bit Tag Requester enabled */ #define PCI_EXP_DEVCTL2_OBFF (x) (((x) >> 13) & 3)/* OBFF enabled */ #define PCI_EXP_DEVSTA2 0x2a/* Device Status */
ls-caps.c +3 -1
@@ -1173,10 +1173,12 @@ static void cap_express_dev2(struct device *d, int where, int type)printf (" EgressBlck%c" ,FLAG (w,PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK ));printf ("\n" ); } -printf ("\t\t\t IDOReq%c IDOCompl%c LTR%c 10BitTagReq%c OBFF %s\n" , +printf ("\t\t\t IDOReq%c IDOCompl%c LTR%c EmergencyPowerReductionReq%c\n" ,FLAG (w,PCI_EXP_DEVCTL2_IDO_REQ_EN ),FLAG (w,PCI_EXP_DEVCTL2_IDO_CMP_EN ),FLAG (w,PCI_EXP_DEVCTL2_LTR ), +FLAG (w,PCI_EXP_DEVCTL2_EPR_REQ )); +printf ("\t\t\t 10BitTagReq%c OBFF %s\n" ,FLAG (w,PCI_EXP_DEVCTL2_10BIT_TAG_REQ ),cap_express_devctl2_obff (PCI_EXP_DEVCTL2_OBFF (w))); }
Signature · 1 line
2.34.1
PATCH 4/8 lspci: Decode PCIe DevCtl2 End-to-End TLP Prefix Blocking
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Decode the PCIe DevCtl2 End-to-End TLP Prefix Blocking bit. The "EETLPPrefixBlk" format is analogous to the existing "EETLPPrefix" format used for the corresponding DevCap2 bit.
--- lib/header.h | 1 + ls-caps.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)
lib/header.h +1 -0
@@ -909,6 +909,7 @@#define PCI_EXP_DEVCTL2_EPR_REQ 0x0800/* Emergency Power Reduction Request */ #define PCI_EXP_DEVCTL2_10BIT_TAG_REQ 0x1000/* 10 Bit Tag Requester enabled */ #define PCI_EXP_DEVCTL2_OBFF (x) (((x) >> 13) & 3)/* OBFF enabled */ +#define PCI_EXP_DEVCTL2_EE_TLP_BLK 0x8000/* End-End TLP Prefix Blocking */ #define PCI_EXP_DEVSTA2 0x2a/* Device Status */ #define PCI_EXP_LNKCAP2 0x2c/* Link Capabilities */ #define PCI_EXP_LNKCAP2_SPEED (x) (((x) >> 1) & 0x7f)
ls-caps.c +3 -2
@@ -1178,9 +1178,10 @@ static void cap_express_dev2(struct device *d, int where, int type)FLAG (w,PCI_EXP_DEVCTL2_IDO_CMP_EN ),FLAG (w,PCI_EXP_DEVCTL2_LTR ), FLAG(w, PCI_EXP_DEVCTL2_EPR_REQ)); -printf ("\t\t\t 10BitTagReq%c OBFF %s\n" , +printf ("\t\t\t 10BitTagReq%c OBFF %s, EETLPPrefixBlk%c\n" ,FLAG (w,PCI_EXP_DEVCTL2_10BIT_TAG_REQ ), -cap_express_devctl2_obff (PCI_EXP_DEVCTL2_OBFF (w))); +cap_express_devctl2_obff (PCI_EXP_DEVCTL2_OBFF (w)), +FLAG (w,PCI_EXP_DEVCTL2_EE_TLP_BLK )); }static const char *cap_express_link2_speed_cap (int vector)
Signature · 1 line
2.34.1
PATCH 5/8 lspci: Decode PCIe LnkCtl Link Disable as 'LnkDisable'
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Decode the Link Disable bit as "LnkDisable" (not simply "Disable") to match the spec terminology (PCIe r6.0, sec 7.5.3.7)
--- ls-caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ls-caps.c +1 -1
@@ -841,7 +841,7 @@ static void cap_express_link(struct device *d, int where, int type)if ((type ==PCI_EXP_TYPE_ROOT_PORT ) || (type ==PCI_EXP_TYPE_ENDPOINT ) || (type ==PCI_EXP_TYPE_LEG_END ) || (type ==PCI_EXP_TYPE_PCI_BRIDGE ))printf (" RCB %d bytes," , w &PCI_EXP_LNKCTL_RCB ?128 :64 ); - printf(" Disabled%c CommClk%c\n\t\t\tExtSynch%c ClockPM%c AutWidDis%c BWInt%c AutBWInt%c\n", + printf(" LnkDisable%c CommClk%c\n\t\t\tExtSynch%c ClockPM%c AutWidDis%c BWInt%c AutBWInt%c\n", FLAG(w, PCI_EXP_LNKCTL_DISABLE), FLAG(w, PCI_EXP_LNKCTL_CLOCK), FLAG(w, PCI_EXP_LNKCTL_XSYNCH),
Signature · 1 line
2.34.1
PATCH 6/8 lspci: Print PCIe Interrupt Message Numbers consistently
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Several Capabilities include MSI/MSI-X Interrupt Message Numbers, which were decoded in various ways:
- MSI %02x PCIe Capability - IntMsg %d AER Capability - INT Msg #%d DPC Capability - Interrupt Message Number %03x SR-IOV Capability - Interrupt Message Number %03x DOE Capability
Print them all using the same format:
+ IntMsgNum %d
This better matches the "Interrupt Message Number" terminology used in the spec, e.g., PCIe r6.0, sec 7.5.3.2.
--- ls-caps.c | 2 +- ls-ecaps.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
ls-caps.c +1 -1
@@ -1436,7 +1436,7 @@ cap_express(struct device *d, int where, int cap)default :printf ("Unknown type %d" , type); } -printf (", MSI %02x\n" , (cap &PCI_EXP_FLAGS_IRQ ) >>9 ); +printf (", IntMsgNum %d\n" , (cap &PCI_EXP_FLAGS_IRQ ) >>9 );if (verbose <2 )return type;
ls-ecaps.c +4 -4
@@ -191,7 +191,7 @@ cap_aer(struct device *d, int where, int type) l =get_conf_long (d, where +PCI_ERR_ROOT_STATUS ); printf("\t\tRootSta: CERcvd%c MultCERcvd%c UERcvd%c MultUERcvd%c\n" - "\t\t\t FirstFatal%c NonFatalMsg%c FatalMsg%c IntMsg %d\n", + "\t\t\t FirstFatal%c NonFatalMsg%c FatalMsg%c IntMsgNum %d\n", FLAG(l, PCI_ERR_ROOT_COR_RCV), FLAG(l, PCI_ERR_ROOT_MULTI_COR_RCV), FLAG(l, PCI_ERR_ROOT_UNCOR_RCV),
@@ -221,7 +221,7 @@ static void cap_dpc(struct device *d, int where)return ; l =get_conf_word (d, where +PCI_DPC_CAP ); -printf ("\t\tDpcCap:\tINT Msg #%d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n" , +printf ("\t\tDpcCap:\tIntMsgNum %d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n" ,PCI_DPC_CAP_INT_MSG (l),FLAG (l,PCI_DPC_CAP_RP_EXT ),FLAG (l,PCI_DPC_CAP_TLP_BLOCK ),FLAG (l,PCI_DPC_CAP_SW_TRIGGER ),PCI_DPC_CAP_RP_LOG (l),FLAG (l,PCI_DPC_CAP_DL_ACT_ERR ));
@@ -371,7 +371,7 @@ cap_sriov(struct device *d, int where)return ; l =get_conf_long (d, where +PCI_IOV_CAP ); -printf ("\t\tIOVCap:\tMigration%c 10BitTagReq%c Interrupt Message Number: %03x\n" , +printf ("\t\tIOVCap:\tMigration%c 10BitTagReq%c IntMsgNum %d\n" ,FLAG (l,PCI_IOV_CAP_VFM ),FLAG (l,PCI_IOV_CAP_VF_10BIT_TAG_REQ ),PCI_IOV_CAP_IMN (l)); w =get_conf_word (d, where +PCI_IOV_CTRL ); printf("\t\tIOVCtl:\tEnable%c Migration%c Interrupt%c MSE%c ARIHierarchy%c 10BitTagReq%c\n",
@@ -1394,7 +1394,7 @@ cap_doe(struct device *d, int where)printf ("\t\tDOECap: IntSup%c\n" ,FLAG (l,PCI_DOE_CAP_INT_SUPP ));if (l &PCI_DOE_CAP_INT_SUPP ) -printf ("\t\t\tInterrupt Message Number %03x\n" , +printf ("\t\t\tIntMsgNum %d\n" ,PCI_DOE_CAP_INT_MSG (l)); l =get_conf_long (d, where +PCI_DOE_CTL );
Signature · 1 line
2.34.1
PATCH 7/8 lspci: Remove spurious colon (':') from PCIe PTM decoding
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
Remove spurious colon from PTM decoding to match other enabled/disabled decoding.
--- ls-ecaps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ls-ecaps.c +2 -2
@@ -1245,7 +1245,7 @@ cap_ptm(struct device *d, int where) buff =get_conf_long (d, where +4 );printf ("\t\tPTMCap: " ); -printf ("Requester:%c Responder:%c Root:%c\n" , +printf ("Requester%c Responder%c Root%c\n" ,FLAG (buff,0x1 ),FLAG (buff,0x2 ),FLAG (buff,0x4 ));
@@ -1266,7 +1266,7 @@ cap_ptm(struct device *d, int where) buff =get_conf_long (d, where +8 );printf ("\t\tPTMControl: " ); -printf ("Enabled:%c RootSelected:%c\n" , +printf ("Enabled%c RootSelected%c\n" ,FLAG (buff,0x1 ),FLAG (buff,0x2 ));
Signature · 1 line
2.34.1
PATCH 8/8 setpci: Fix man page typo
In reply to Bjorn HelgaasFrom: Bjorn Helgaas <[email protected]>
"Several ways how to identity a register" doesn't read correctly and misspells "identify". Reword as "several ways to identify a register".
--- setpci.man | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
setpci.man +1 -1
@@ -135,7 +135,7 @@ are hexadecimal numbers. In the latter case, only the bits corresponding to bina ones in the \fImask\fP are changed (technically, this is a read-modify-write operation). .PP -There are several ways how to identity a register: +There are several ways to identify a register: .IP \(bu Tell its address in hexadecimal. .IP \(bu
Signature · 1 line
2.34.1
Martin Mareš
AppliedHi!
Quoted 12 lines
Decode several more DevCtl2 fields and show Interrupt Message Numbers more consistently.
Bjorn Helgaas (8):
lspci: Reorder PCIe DevCtl2 fields to match spec
lspci: Decode PCIe DevCtl2 ID-Based Ordering Enables
lspci: Decode PCIe DevCtl2 Emergency Power Reduction Request
lspci: Decode PCIe DevCtl2 End-to-End TLP Prefix Blocking
lspci: Decode PCIe LnkCtl Link Disable as 'LnkDisable'
lspci: Print PCIe Interrupt Message Numbers consistently
lspci: Remove spurious colon (':') from PCIe PTM decoding
setpci: Fix man page typo
Thanks, applied.
Martin