| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
mami4ubmem: add enabled-port-mask interface Add the mami4ubmem_get_enabled_port_mask function pointer to the compat header and the loader module, mirroring the existing query APIs. The UB firmware may disable physical ports at boot time that the hardware exposes. A disabled port has no sysfs directory and the UB bus controller sysfs renumbers the remaining (enabled) ports densely from 0 in ascending physical-port order. This interface returns a per-die bitmask that lets callers distinguish the static physical port IDs (used by the contract and ini files) from the firmware-enabled port IDs (used by sysfs and MAMI). The guard returns EOPNOTSUPP until the real libmami4ubmem ships the symbol, so the framework links standalone with no behavior change. | 2 个月前 | |
tests: remove param_filter_func field and hardcoded datapath_spec entries - Remove the param_filter_func field from struct test_case in include/framework/obmm_test.h. The field was added in commit 2e5257c but the framework never read it: the orchestrator only checked test_func != NULL, and the conductor dispatched via test_func() directly. The field was purely test-side shared state with a duplicated invocation pattern across 8 consumer sites in tests/obmm/consistency/. Each consumer now calls its local *_param_filter() function directly, which is the pattern the field was hinting at without ever providing. The three _PARAM registration macros drop the .param_filter_func = NULL initializer. - Remove the UBMEM_DATAPATH_SYMMETRIC_PORT_TO_PORT_INIT macro from include/utils/datapath.h. The macro wrapped a 14-line compound designated initializer into a 14-line compound designated initializer — it saved no lines and added one level of indirection. All 8 call sites that used the macro with identical args (0,1,0,0,1) are replaced by dropping the hardcoded datapath_spec entirely and relying on the runtime select_datapath() call the tests already make. The one parameterized site in share_rr_remap.c now uses dp_sel directly (the full select_datapath() output) instead of rebuilding a struct with hardcoded package_id=0, die_id=0. - Remove all hardcoded datapath_spec arrays from the consistency test family (atomic, lock, producer_consumer, producer_consumer_wo, notify_round_trip_nc, notify_round_trip_ccnc, share_rr_remap, flush_range_test). Each test_case's datapath_spec is now {.items = NULL, .count = 0}. The orchestrator's pre-validation is sacrificed (it can no longer skip tests whose declared links are not connected), but the runtime select_datapath() call provides a clear failure if no link exists. This is the correct trade-off: hardcoded port/die IDs in datapath_spec were a source of false negatives on hardware with different link geometry. Concretely, tests the orchestrator previously skipped via LOG_WARN on missing links now fail at runtime via select_datapath(); CI dashboards and timeout accounting will see different surface behavior on hosts without the declared topology. - Add align_up_size() and align_down_size() to include/utils/sizes.h (next to the existing gcd_size and lcm_size helpers). Remove the 5 test-local copies (align_up, pc_align_up, rr_align_up, nrt_align_up, align_up_size) from the consistency test files and rename all callers to the shared name. All 6 affected files already include utils/sizes.h. The shared helpers' @param contract acknowledges the align == 0 passthrough (matching the originals); callers in share_rr_remap.c that previously relied on the uintptr_t-typed local helper now narrow through an explicit (size_t) cast for visibility. | 2 个月前 | |
style: apply clang-format Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 2 个月前 | |
ub_sysfs: resolve physical port IDs in load_controller_ports load_controller_ports now owns the full port-storage lifecycle: it queries mami4ubmem_get_enabled_port_mask for the controller's die, scans the UB bus controller sysfs, and converts each scanned entry from its firmware-enabled (sysfs-facing) port ID to its static physical port ID in-place before caching it. This keeps all mask handling inside one function instead of splitting the scan and the relabel across load_controller_info and load_controller_state. load_controller_state queries the UB die version once and resolves the static physical port count from the contract spec via the new ubmem_physical_ports_per_die helper (summing ports_per_decoder[]), passing it into load_controller_ports. The spec is now the source of truth for the physical port count, including boot-time-disabled ports, rather than deriving it from the enabled-port mask. This fixes the conflation bug where a boot-time-disabled physical port caused sysfs to renumber the remaining ports densely from 0, and the cached view silently treated the renumbered (enabled) IDs as physical IDs -- producing wrong decoder/UMMU resolution and wrong port CNAs once any port was disabled. With the in-place conversion, get_ub_controller_port_cna and get_ub_controller_physical_port_count speak physical IDs externally, and resolve_controller_and_validate_port inherits the fix unchanged via the spec-derived count. When the mask query returns EOPNOTSUPP (real libmami4ubmem has not shipped the symbol yet, or MAMI does not support it on this host), the conversion is identity and the cached view is unchanged, preserving the legacy behavior. When the die version or spec is unavailable, the scanned count is used as the degraded physical port count. The bijection formulas are exposed as the static-inline ub_port_id_physical_to_enabled and ub_port_id_enabled_to_physical helpers in ub_sysfs.h. | 2 个月前 |