Skip to content

Commit 8166675

Browse files
shijujose4davejiang
authored andcommitted
cxl/events: Add Component Identifier formatting for CXL spec rev 3.1
Add Component Identifier formatting for CXL spec rev 3.1, Section 8.2.9.2.1, Table 8-44. Examples for Component Identifier format in trace log, validity_flags='CHANNEL|RANK|DEVICE|COMPONENT|COMPONENT PLDM FORMAT' \ comp_id=03 74 c5 08 9a 1a 0b fc d2 7e 2f 31 9b 3c 81 4d \ comp_id_pldm_valid_flags='PLDM Entity ID | Resource ID' \ pldm_entity_id=74 c5 08 9a 1a 0b pldm_resource_id=fc d2 7e 2f \ validity_flags='COMPONENT|COMPONENT PLDM FORMAT' \ comp_id=02 74 c5 08 9a 1a 0b fc d2 7e 2f 31 9b 3c 81 4d \ comp_id_pldm_valid_flags='Resource ID' \ pldm_entity_id=0x00 pldm_resource_id=fc d2 7e 2f If the validity flags for component ID/component ID format or PLDM ID or resource ID are not set, then pldm_entity_id=0x00 or pldm_resource_id=0x00 would be printed. Component identifier formatting is used in the subsequent patches. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Shiju Jose <shiju.jose@huawei.com> Link: https://patch.msgid.link/20250111091756.1682-3-shiju.jose@huawei.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 5e31e34 commit 8166675

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/cxl/core/trace.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,28 @@ TRACE_EVENT(cxl_generic_event,
268268
{ CXL_DPA_NOT_REPAIRABLE, "NOT_REPAIRABLE" } \
269269
)
270270

271+
/*
272+
* Component ID Format
273+
* CXL 3.1 section 8.2.9.2.1; Table 8-44
274+
*/
275+
#define CXL_PLDM_COMPONENT_ID_ENTITY_VALID BIT(0)
276+
#define CXL_PLDM_COMPONENT_ID_RES_VALID BIT(1)
277+
278+
#define show_comp_id_pldm_flags(flags) __print_flags(flags, " | ", \
279+
{ CXL_PLDM_COMPONENT_ID_ENTITY_VALID, "PLDM Entity ID" }, \
280+
{ CXL_PLDM_COMPONENT_ID_RES_VALID, "Resource ID" } \
281+
)
282+
283+
#define show_pldm_entity_id(flags, valid_comp_id, valid_id_format, comp_id) \
284+
(flags & valid_comp_id && flags & valid_id_format) ? \
285+
(comp_id[0] & CXL_PLDM_COMPONENT_ID_ENTITY_VALID) ? \
286+
__print_hex(&comp_id[1], 6) : "0x00" : "0x00"
287+
288+
#define show_pldm_resource_id(flags, valid_comp_id, valid_id_format, comp_id) \
289+
(flags & valid_comp_id && flags & valid_id_format) ? \
290+
(comp_id[0] & CXL_PLDM_COMPONENT_ID_RES_VALID) ? \
291+
__print_hex(&comp_id[7], 4) : "0x00" : "0x00"
292+
271293
/*
272294
* General Media Event Record - GMER
273295
* CXL rev 3.0 Section 8.2.9.2.1.1; Table 8-43

0 commit comments

Comments
 (0)