cxl/test: Enhance event testing
authorIra Weiny <ira.weiny@intel.com>
Tue, 2 Apr 2024 05:31:58 +0000 (22:31 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 30 Apr 2024 17:43:48 +0000 (10:43 -0700)
commit364ee9f3265e486772f445f437273a9c94b66d4b
tree3fe7d2c3ca82667881047a9dd48a6cc56e60ca8f
parent54e8dd59a76c031317eef61fef93f01d4e76fd3e
cxl/test: Enhance event testing

An issue was found in the processing of event logs when the output
buffer length was not reset.[1]

This bug was not caught with cxl-test for 2 reasons.  First, the test
harness mbox_send command [mock_get_event()] does not set the output
size based on the amount of data returned like the hardware command
does.  Second, the simplistic event log testing always returned the same
number of elements per-get command.

Enhance the simulation of the event log mailbox to better match the bug
found with real hardware to cover potential regressions.

NOTE: These changes will cause cxl-events.sh in ndctl to fail without
the fix from Kwangjin.  However, no changes to the user space test was
required.  Therefore ndctl itself will be compatible with old or new
kernels once both patches land in the new kernel.

Link: https://lore.kernel.org/all/20240401091057.1044-1-kwangjin.ko@sk.com/
Cc: Kwangjin Ko <kwangjin.ko@sk.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240401-enhance-event-test-v1-1-6669a524ed38@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
tools/testing/cxl/test/mem.c