mirror of
https://github.com/torvalds/linux.git
synced 2026-10-04 10:19:02 +02:00
We currently have a mixture of styles for our RTP tables with respect of
how we define the number of entries:
* xe_rtp_process_to_sr() expects to receive the number of entries as
arguments;
* xe_rtp_process() expects the array to have a sentinel at the end of
the array;
* in xe_rtp_test.c, even though xe_rtp_process_to_sr() does not
require a sentinel value, we need to rely on that technique to be
able to count xe_rtp_entry_sr entries because simply using
ARRAY_SIZE() is not possible.
The style used by xe_rtp_process_to_sr() makes it hard to share the
tables with other compilation units (e.g. kunit tests), since the number
of entries is calculated with ARRAY_SIZE(), which is done at compile
time.
Since we use the size of the tables to create some bitmasks, using a
sentinel style doesn't seem great either.
A way to reconcile things into a single style is to have a struct type
that would hold the entries array and the number of entries. Since we
have xe_rtp_entry and xe_rtp_entry_sr, we would have one type for each.
The advantage of the proposed approach is that now we have a nice way to
share the tables directly to kunit tests with information about their
size.
v6:
- Removed sentinels that are not needed
v5:
- Removed added code from conflict resolution issues
v4:
- Removed conflicts with main branch
v3:
- No changes
v2:
- Add compatibility with new xe_rtp_table_sr format for
"bad-mcr-reg-forced-to-regular" and
"bad-regular-reg-forced-to-mcr"
Fixes:
|
||
|---|---|---|
| .. | ||
| Makefile | ||
| xe_args_test.c | ||
| xe_bo.c | ||
| xe_dma_buf.c | ||
| xe_gt_sriov_pf_config_kunit.c | ||
| xe_guc_buf_kunit.c | ||
| xe_guc_db_mgr_test.c | ||
| xe_guc_g2g_test.c | ||
| xe_guc_id_mgr_test.c | ||
| xe_guc_relay_test.c | ||
| xe_kunit_helpers.c | ||
| xe_kunit_helpers.h | ||
| xe_live_test_mod.c | ||
| xe_lmtt_test.c | ||
| xe_migrate.c | ||
| xe_mocs.c | ||
| xe_pci_test.c | ||
| xe_pci_test.h | ||
| xe_pci.c | ||
| xe_rtp_test.c | ||
| xe_rtp_test.h | ||
| xe_rtp.c | ||
| xe_sriov_pf_service_kunit.c | ||
| xe_test_mod.c | ||
| xe_test.h | ||
| xe_wa_test.c | ||