summaryrefslogtreecommitdiff
path: root/usr/src/test/os-tests/tests/zen_umc/zen_umc_test.h
blob: 261b4405a2cedf4da5889322d02c5412266287eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * This file and its contents are supplied under the terms of the
 * Common Development and Distribution License ("CDDL"), version 1.0.
 * You may only use this file in accordance with the terms of version
 * 1.0 of the CDDL.
 *
 * A full copy of the text of the CDDL should have accompanied this
 * source.  A copy of the CDDL is also available via the Internet at
 * http://www.illumos.org/license/CDDL.
 */

/*
 * Copyright 2022 Oxide Computer Company
 */

#ifndef _ZEN_UMC_TEST_H
#define	_ZEN_UMC_TEST_H

/*
 * Common definitions for testing the pieces of zen_umc(4D).
 */

#include "zen_umc.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Fabric ID Composition / Decomposition tests
 */
typedef struct umc_fabric_test {
	const char			*uft_desc;
	const df_fabric_decomp_t	*uft_decomp;
	/*
	 * If uft_compose is true, we will take the socket/die/comp and try to
	 * create a fabric id from it (and then round trip through it again). If
	 * it is false, we will start with the fabric id, decompose, and then
	 * round trip back.
	 */
	boolean_t			uft_compose;
	/*
	 * If uft_valid is not set, we expect that either the fabric id or the
	 * sock/die/comp is invalid based on uft_compose. This will only perform
	 * the initial validity checks instead.
	 */
	boolean_t			uft_valid;
	uint32_t			uft_fabric_id;
	uint32_t			uft_sock_id;
	uint32_t			uft_die_id;
	uint32_t			uft_comp_id;
} umc_fabric_test_t;

/*
 * Test cases for actual decoding!
 */
typedef struct umc_decode_test {
	const char			*udt_desc;
	const zen_umc_t			*udt_umc;
	uint64_t			udt_pa;
	boolean_t			udt_pass;
	/*
	 * When udt_pass is set to B_FALSE, then the following member will be
	 * checked to ensure that we got the right thing. Otherwise it'll be
	 * skipped.
	 */
	zen_umc_decode_failure_t	udt_fail;
	/*
	 * When udt_pass is set to true, the following will all be checked. If
	 * you wish to skip one, set it to its corresponding UINTXX_MAX.
	 */
	uint64_t			udt_norm_addr;
	uint8_t				udt_sock;
	uint8_t				udt_die;
	uint8_t				udt_comp;
	uint32_t			udt_dimm_no;
	uint32_t			udt_dimm_col;
	uint32_t			udt_dimm_row;
	uint8_t				udt_dimm_bank;
	uint8_t				udt_dimm_bank_group;
	uint8_t				udt_dimm_subchan;
	uint8_t				udt_dimm_rm;
	uint8_t				udt_dimm_cs;
} umc_decode_test_t;

extern const umc_fabric_test_t zen_umc_test_fabric_ids[];

extern const umc_decode_test_t zen_umc_test_basics[];
extern const umc_decode_test_t zen_umc_test_chans[];
extern const umc_decode_test_t zen_umc_test_cod[];
extern const umc_decode_test_t zen_umc_test_errors[];
extern const umc_decode_test_t zen_umc_test_hole[];
extern const umc_decode_test_t zen_umc_test_ilv[];
extern const umc_decode_test_t zen_umc_test_multi[];
extern const umc_decode_test_t zen_umc_test_nps[];
extern const umc_decode_test_t zen_umc_test_remap[];

#ifdef __cplusplus
}
#endif

#endif /* _ZEN_UMC_TEST_H */