Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Link: https://patch.msgid.link/20250717101817.2104-2-shiju.jose@huawei.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

authored by

Shiju Jose and committed by
Dave Jiang
1f4f8166 d0b3b7b2

+17 -5
+14 -4
drivers/cxl/core/trace.h
··· 214 214 #define CXL_EVENT_RECORD_FLAG_PERF_DEGRADED BIT(4) 215 215 #define CXL_EVENT_RECORD_FLAG_HW_REPLACE BIT(5) 216 216 #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) 217 219 #define show_hdr_flags(flags) __print_flags(flags, " | ", \ 218 220 { CXL_EVENT_RECORD_FLAG_PERMANENT, "PERMANENT_CONDITION" }, \ 219 221 { CXL_EVENT_RECORD_FLAG_MAINT_NEEDED, "MAINTENANCE_NEEDED" }, \ 220 222 { CXL_EVENT_RECORD_FLAG_PERF_DEGRADED, "PERFORMANCE_DEGRADED" }, \ 221 223 { 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" } \ 223 227 ) 224 228 225 229 /* ··· 251 247 __field(u64, hdr_timestamp) \ 252 248 __field(u8, hdr_length) \ 253 249 __field(u8, hdr_maint_op_class) \ 254 - __field(u8, hdr_maint_op_sub_class) 250 + __field(u8, hdr_maint_op_sub_class) \ 251 + __field(u16, hdr_ld_id) \ 252 + __field(u8, hdr_head_id) 255 253 256 254 #define CXL_EVT_TP_fast_assign(cxlmd, l, hdr) \ 257 255 __assign_str(memdev); \ ··· 266 260 __entry->hdr_related_handle = le16_to_cpu((hdr).related_handle); \ 267 261 __entry->hdr_timestamp = le64_to_cpu((hdr).timestamp); \ 268 262 __entry->hdr_maint_op_class = (hdr).maint_op_class; \ 269 - __entry->hdr_maint_op_sub_class = (hdr).maint_op_sub_class 263 + __entry->hdr_maint_op_sub_class = (hdr).maint_op_sub_class; \ 264 + __entry->hdr_ld_id = le16_to_cpu((hdr).ld_id); \ 265 + __entry->hdr_head_id = (hdr).head_id 270 266 271 267 #define CXL_EVT_TP_printk(fmt, ...) \ 272 268 TP_printk("memdev=%s host=%s serial=%lld log=%s : time=%llu uuid=%pUb " \ 273 269 "len=%d flags='%s' handle=%x related_handle=%x " \ 274 - "maint_op_class=%u maint_op_sub_class=%u : " fmt, \ 270 + "maint_op_class=%u maint_op_sub_class=%u " \ 271 + "ld_id=%x head_id=%x : " fmt, \ 275 272 __get_str(memdev), __get_str(host), __entry->serial, \ 276 273 cxl_event_log_type_str(__entry->log), \ 277 274 __entry->hdr_timestamp, &__entry->hdr_uuid, __entry->hdr_length,\ 278 275 show_hdr_flags(__entry->hdr_flags), __entry->hdr_handle, \ 279 276 __entry->hdr_related_handle, __entry->hdr_maint_op_class, \ 280 277 __entry->hdr_maint_op_sub_class, \ 278 + __entry->hdr_ld_id, __entry->hdr_head_id, \ 281 279 ##__VA_ARGS__) 282 280 283 281 TRACE_EVENT(cxl_generic_event,
+3 -1
include/cxl/event.h
··· 19 19 __le64 timestamp; 20 20 u8 maint_op_class; 21 21 u8 maint_op_sub_class; 22 - u8 reserved[14]; 22 + __le16 ld_id; 23 + u8 head_id; 24 + u8 reserved[11]; 23 25 } __packed; 24 26 25 27 struct cxl_event_media_hdr {