Skip to content

Commit 1f4f816

Browse files
shijujose4davejiang
authored andcommitted
cxl/events: Update Common Event Record to CXL spec rev 3.2
CXL spec 3.2 section 8.2.10.2.1 Table 8-55, Common Event Record format defined new fields LD-ID and Head ID. LD-ID: ID of logical device from where the event originated, which is valid only if LD-ID valid flag is set to 1. CXL spec 3.2 Section 2.4 describes, a Type 3 Multi-Logical Device (MLD) can partition its resources into up to 16 isolated Logical Devices. Each Logical Device is identified by a Logical Device Identifier (LD-ID) in CXL.mem and CXL.io protocols. LD-ID is a 16-bit Logical Device identifier applicable for CXL.io and CXL.mem requests and responses. CXL.mem supports only the lower 4 bits of LD-ID and therefore can support up to 16 unique LD-ID values over the link. Requests and responses forwarded over an MLD Port are tagged with LD-ID. Head ID: ID of the device head, from where the event originated, which is valid only if head valid flag is set to 1. Add updates for the above spec changes in the CXL events record and CXL common trace event implementation. Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Shiju Jose <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent d0b3b7b commit 1f4f816

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

drivers/cxl/core/trace.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,16 @@ TRACE_EVENT(cxl_overflow,
214214
#define CXL_EVENT_RECORD_FLAG_PERF_DEGRADED BIT(4)
215215
#define CXL_EVENT_RECORD_FLAG_HW_REPLACE BIT(5)
216216
#define CXL_EVENT_RECORD_FLAG_MAINT_OP_SUB_CLASS_VALID BIT(6)
217+
#define CXL_EVENT_RECORD_FLAG_LD_ID_VALID BIT(7)
218+
#define CXL_EVENT_RECORD_FLAG_HEAD_ID_VALID BIT(8)
217219
#define show_hdr_flags(flags) __print_flags(flags, " | ", \
218220
{ CXL_EVENT_RECORD_FLAG_PERMANENT, "PERMANENT_CONDITION" }, \
219221
{ CXL_EVENT_RECORD_FLAG_MAINT_NEEDED, "MAINTENANCE_NEEDED" }, \
220222
{ CXL_EVENT_RECORD_FLAG_PERF_DEGRADED, "PERFORMANCE_DEGRADED" }, \
221223
{ CXL_EVENT_RECORD_FLAG_HW_REPLACE, "HARDWARE_REPLACEMENT_NEEDED" }, \
222-
{ CXL_EVENT_RECORD_FLAG_MAINT_OP_SUB_CLASS_VALID, "MAINT_OP_SUB_CLASS_VALID" } \
224+
{ CXL_EVENT_RECORD_FLAG_MAINT_OP_SUB_CLASS_VALID, "MAINT_OP_SUB_CLASS_VALID" }, \
225+
{ CXL_EVENT_RECORD_FLAG_LD_ID_VALID, "LD_ID_VALID" }, \
226+
{ CXL_EVENT_RECORD_FLAG_HEAD_ID_VALID, "HEAD_ID_VALID" } \
223227
)
224228

225229
/*
@@ -247,7 +251,9 @@ TRACE_EVENT(cxl_overflow,
247251
__field(u64, hdr_timestamp) \
248252
__field(u8, hdr_length) \
249253
__field(u8, hdr_maint_op_class) \
250-
__field(u8, hdr_maint_op_sub_class)
254+
__field(u8, hdr_maint_op_sub_class) \
255+
__field(u16, hdr_ld_id) \
256+
__field(u8, hdr_head_id)
251257

252258
#define CXL_EVT_TP_fast_assign(cxlmd, l, hdr) \
253259
__assign_str(memdev); \
@@ -260,18 +266,22 @@ TRACE_EVENT(cxl_overflow,
260266
__entry->hdr_related_handle = le16_to_cpu((hdr).related_handle); \
261267
__entry->hdr_timestamp = le64_to_cpu((hdr).timestamp); \
262268
__entry->hdr_maint_op_class = (hdr).maint_op_class; \
263-
__entry->hdr_maint_op_sub_class = (hdr).maint_op_sub_class
269+
__entry->hdr_maint_op_sub_class = (hdr).maint_op_sub_class; \
270+
__entry->hdr_ld_id = le16_to_cpu((hdr).ld_id); \
271+
__entry->hdr_head_id = (hdr).head_id
264272

265273
#define CXL_EVT_TP_printk(fmt, ...) \
266274
TP_printk("memdev=%s host=%s serial=%lld log=%s : time=%llu uuid=%pUb " \
267275
"len=%d flags='%s' handle=%x related_handle=%x " \
268-
"maint_op_class=%u maint_op_sub_class=%u : " fmt, \
276+
"maint_op_class=%u maint_op_sub_class=%u " \
277+
"ld_id=%x head_id=%x : " fmt, \
269278
__get_str(memdev), __get_str(host), __entry->serial, \
270279
cxl_event_log_type_str(__entry->log), \
271280
__entry->hdr_timestamp, &__entry->hdr_uuid, __entry->hdr_length,\
272281
show_hdr_flags(__entry->hdr_flags), __entry->hdr_handle, \
273282
__entry->hdr_related_handle, __entry->hdr_maint_op_class, \
274283
__entry->hdr_maint_op_sub_class, \
284+
__entry->hdr_ld_id, __entry->hdr_head_id, \
275285
##__VA_ARGS__)
276286

277287
TRACE_EVENT(cxl_generic_event,

include/cxl/event.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ struct cxl_event_record_hdr {
1919
__le64 timestamp;
2020
u8 maint_op_class;
2121
u8 maint_op_sub_class;
22-
u8 reserved[14];
22+
__le16 ld_id;
23+
u8 head_id;
24+
u8 reserved[11];
2325
} __packed;
2426

2527
struct cxl_event_media_hdr {

0 commit comments

Comments
 (0)