Skip to content

Commit f6d78eb

Browse files
SapthagiriPchetan-rathore
authored andcommitted
feat: Switch skip-dp-nic-ms skips to WARN with explicit guidance
- Treat skip-dp-nic-ms filtered PCIe cases as WARN instead of SKIP so they surface in results. - Emit a short, wrapped warning message directing users to rerun without --skip-dp-nic-ms. - Track skip_due_to_flag in PCIe tests to differentiate flag-driven skips from missing devices Signed-off-by: sapthagiri padmanabhan <sapthagiri.padmanabhan@arm.com> Change-Id: I3691aa72275b95a55beb10436fc9cf560ac6a2f1
1 parent 9afbe36 commit f6d78eb

7 files changed

Lines changed: 128 additions & 33 deletions

File tree

test_pool/pcie/p030.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ payload(void)
106106
uint32_t base_cc;
107107
uint32_t test_fails;
108108
uint32_t test_skip = 1;
109+
bool skip_due_to_flag = false;
110+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
109111
uint64_t bar_base;
110112
uint32_t status;
111113
uint32_t timeout;
@@ -159,9 +161,10 @@ payload(void)
159161
val_pcie_read_cfg(bdf, TYPE01_RIDR, &reg_value);
160162
val_print(DEBUG, "\n Class code is 0x%x", reg_value);
161163
base_cc = reg_value >> TYPE01_BCC_SHIFT;
162-
if (acs_policy_get_pcie_skip_dp_nic_ms() &&
164+
if (skip_flag &&
163165
((base_cc == UNCLAS_CC) || (base_cc == CNTRL_CC)
164166
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC))) {
167+
skip_due_to_flag = true;
165168
val_print(DEBUG, "\n Skipping for BDF 0x%x", bdf);
166169
continue;
167170
}
@@ -228,8 +231,19 @@ payload(void)
228231
bar_data = 0;
229232
}
230233

231-
if (test_skip == 1)
232-
val_set_status(pe_index, RESULT_SKIP(1));
234+
if (test_skip == 1) {
235+
if (skip_flag && skip_due_to_flag) {
236+
val_print(WARN,
237+
"\n DP/NIC/MAS/RES devices are skipped.");
238+
val_print(WARN,
239+
"\n Please individually run the test without");
240+
val_print(WARN,
241+
"\n --skip-dp-nic-ms to check the compliance.");
242+
val_set_status(pe_index, RESULT_WARNING(1));
243+
} else {
244+
val_set_status(pe_index, RESULT_SKIP(1));
245+
}
246+
}
233247
else if (test_fails)
234248
val_set_status(pe_index, RESULT_FAIL(test_fails));
235249
else

test_pool/pcie/p035.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ payload(void)
6666
uint32_t base_cc;
6767
uint32_t test_fails;
6868
uint32_t test_skip = 1;
69+
bool skip_due_to_flag = false;
70+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
6971
uint32_t idx;
7072
uint32_t timeout;
7173
uint32_t status;
@@ -92,10 +94,11 @@ payload(void)
9294
* init can get corrupted when FLR is done */
9395
val_pcie_read_cfg(bdf, TYPE01_RIDR, &reg_value);
9496
base_cc = reg_value >> TYPE01_BCC_SHIFT;
95-
if (acs_policy_get_pcie_skip_dp_nic_ms() &&
97+
if (skip_flag &&
9698
((base_cc == UNCLAS_CC) || (base_cc == MAS_CC)
9799
|| (base_cc == CNTRL_CC) || (base_cc == DP_CNTRL_CC)))
98100
{
101+
skip_due_to_flag = true;
99102
val_print(DEBUG, "\n Skipping for BDF - 0x%x ", bdf);
100103
val_print(DEBUG, " Classcode is : 0x%x ", base_cc);
101104
continue;
@@ -206,9 +209,19 @@ payload(void)
206209
}
207210

208211
if (test_skip == 1) {
209-
val_print(DEBUG,
210-
"\n No EP type device found with PCIe Express Cap support. Skipping test");
211-
val_set_status(pe_index, RESULT_SKIP(1));
212+
if (skip_flag && skip_due_to_flag) {
213+
val_print(WARN,
214+
"\n DP/NIC/MAS/RES devices are skipped.");
215+
val_print(WARN,
216+
"\n Please individually run the test without");
217+
val_print(WARN,
218+
"\n --skip-dp-nic-ms to check the compliance.");
219+
val_set_status(pe_index, RESULT_WARNING(1));
220+
} else {
221+
val_print(DEBUG,
222+
"\n No EP type device found with PCIe Express Cap support. Skipping test");
223+
val_set_status(pe_index, RESULT_SKIP(1));
224+
}
212225
}
213226
else if (test_fails)
214227
val_set_status(pe_index, RESULT_FAIL(test_fails));

test_pool/pcie/p045.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ payload(void)
6363
char *baseptr;
6464
uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid());
6565
uint32_t test_skip = 1;
66+
bool skip_due_to_flag = false;
67+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
6668
uint32_t test_warn = 1;
6769
uint32_t test_fail = 0;
6870
uint64_t offset;
@@ -110,9 +112,10 @@ payload(void)
110112
val_print(DEBUG, "\n Class code is 0x%x", reg_value);
111113
base_cc = reg_value >> TYPE01_BCC_SHIFT;
112114

113-
if (acs_policy_get_pcie_skip_dp_nic_ms() &&
115+
if (skip_flag &&
114116
((base_cc == UNCLAS_CC) || (base_cc == CNTRL_CC)
115117
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC))) {
118+
skip_due_to_flag = true;
116119
val_print(DEBUG, "\n Skipping BDF 0x%x", bdf);
117120
tbl_index++;
118121
goto next_bdf;
@@ -256,10 +259,20 @@ payload(void)
256259
}
257260

258261
test_status:
259-
if (test_skip)
260-
val_set_status(index, RESULT_SKIP(1));
261-
else if (test_warn) {
262-
val_set_status(index, RESULT_WARNING(1));
262+
if (test_skip) {
263+
if (skip_flag && skip_due_to_flag) {
264+
val_print(WARN,
265+
"\n DP/NIC/MAS/RES devices are skipped.");
266+
val_print(WARN,
267+
"\n Please individually run the test without");
268+
val_print(WARN,
269+
"\n --skip-dp-nic-ms to check the compliance.");
270+
val_set_status(index, RESULT_WARNING(1));
271+
} else {
272+
val_set_status(index, RESULT_SKIP(1));
273+
}
274+
} else if (test_warn) {
275+
val_set_status(index, RESULT_WARNING(1));
263276
} else if (test_fail)
264277
val_set_status(index, RESULT_FAIL(test_fail));
265278
else

test_pool/pcie/p058.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ payload(void *arg)
118118
uint32_t base_cc;
119119
uint32_t test_fails;
120120
uint32_t test_skip = 1;
121+
bool skip_due_to_flag = false;
122+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
121123
uint64_t bar_base;
122124
uint32_t dp_type;
123125
uint32_t status;
@@ -198,9 +200,10 @@ payload(void *arg)
198200
val_pcie_read_cfg(bdf, TYPE01_RIDR, &reg_value);
199201
val_print(DEBUG, "\n Class code is 0x%x", reg_value);
200202
base_cc = reg_value >> TYPE01_BCC_SHIFT;
201-
if (acs_policy_get_pcie_skip_dp_nic_ms() &&
203+
if (skip_flag &&
202204
((base_cc == UNCLAS_CC) || (base_cc == CNTRL_CC)
203205
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC))) {
206+
skip_due_to_flag = true;
204207
val_print(DEBUG, "\n Skipping for BDF 0x%x", bdf);
205208
continue;
206209
}
@@ -268,9 +271,19 @@ payload(void *arg)
268271
}
269272

270273
if (test_skip == 1) {
271-
val_print(DEBUG,
272-
"\n Found no target device type with MMIO BAR. Skipping test.");
273-
val_set_status(pe_index, RESULT_SKIP(01));
274+
if (skip_flag && skip_due_to_flag) {
275+
val_print(WARN,
276+
"\n DP/NIC/MAS/RES devices are skipped.");
277+
val_print(WARN,
278+
"\n Please individually run the test without");
279+
val_print(WARN,
280+
"\n --skip-dp-nic-ms to check the compliance.");
281+
val_set_status(pe_index, RESULT_WARNING(01));
282+
} else {
283+
val_print(DEBUG,
284+
"\n Found no target device type with MMIO BAR. Skipping test.");
285+
val_set_status(pe_index, RESULT_SKIP(01));
286+
}
274287
}
275288
else if (test_fails)
276289
val_set_status(pe_index, RESULT_FAIL(test_fails));

test_pool/pcie/p063.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ payload(void)
6767
uint32_t base_cc;
6868
uint32_t test_fails;
6969
bool test_skip = 1;
70+
bool skip_due_to_flag = false;
71+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
7072
uint32_t idx;
7173
uint32_t timeout;
7274
uint32_t status;
@@ -93,10 +95,11 @@ payload(void)
9395
* init can get corrupted when FLR is done */
9496
val_pcie_read_cfg(bdf, TYPE01_RIDR, &reg_value);
9597
base_cc = reg_value >> TYPE01_BCC_SHIFT;
96-
if (acs_policy_get_pcie_skip_dp_nic_ms() &&
98+
if (skip_flag &&
9799
((base_cc == UNCLAS_CC) || (base_cc == MAS_CC)
98100
|| (base_cc == CNTRL_CC) || (base_cc == DP_CNTRL_CC)))
99101
{
102+
skip_due_to_flag = true;
100103
val_print(DEBUG, "\n Skipping for BDF - 0x%x ", bdf);
101104
val_print(DEBUG, " Classcode is : 0x%x ", base_cc);
102105
continue;
@@ -202,9 +205,19 @@ payload(void)
202205
}
203206

204207
if (test_skip == 1) {
205-
val_print(DEBUG,
206-
"\n No target device type with FLR Cap found. Skipping test");
207-
val_set_status(pe_index, RESULT_SKIP(01));
208+
if (skip_flag && skip_due_to_flag) {
209+
val_print(WARN,
210+
"\n DP/NIC/MAS/RES devices are skipped.");
211+
val_print(WARN,
212+
"\n Please individually run the test without");
213+
val_print(WARN,
214+
"\n --skip-dp-nic-ms to check the compliance.");
215+
val_set_status(pe_index, RESULT_WARNING(01));
216+
} else {
217+
val_print(DEBUG,
218+
"\n No target device type with FLR Cap found. Skipping test");
219+
val_set_status(pe_index, RESULT_SKIP(01));
220+
}
208221
}
209222
else if (test_fails)
210223
val_set_status(pe_index, RESULT_FAIL(test_fails));

test_pool/pcie/p094.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ payload(void)
6666
uint32_t test_skip = 1;
6767
uint32_t test_warn = 1;
6868
uint32_t test_fail = 0;
69+
bool skip_due_to_flag = false;
70+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
6971
uint64_t offset;
7072
uint64_t base;
7173
pcie_device_bdf_table *bdf_tbl_ptr;
@@ -111,9 +113,10 @@ payload(void)
111113
val_print(DEBUG, "\n Class code is 0x%x", reg_value);
112114
base_cc = reg_value >> TYPE01_BCC_SHIFT;
113115

114-
if (acs_policy_get_pcie_skip_dp_nic_ms() &&
116+
if (skip_flag &&
115117
((base_cc == UNCLAS_CC) || (base_cc == CNTRL_CC)
116118
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC))) {
119+
skip_due_to_flag = true;
117120
val_print(DEBUG, "\n Skipping BDF 0x%x", bdf);
118121
tbl_index++;
119122
goto next_bdf;
@@ -274,10 +277,20 @@ payload(void)
274277
}
275278

276279
test_status:
277-
if (test_skip)
278-
val_set_status(index, RESULT_SKIP(1));
279-
else if (test_warn) {
280-
val_set_status(index, RESULT_WARNING(1));
280+
if (test_skip) {
281+
if (skip_flag && skip_due_to_flag) {
282+
val_print(WARN,
283+
"\n DP/NIC/MAS/RES devices are skipped.");
284+
val_print(WARN,
285+
"\n Please individually run the test without");
286+
val_print(WARN,
287+
"\n --skip-dp-nic-ms to check the compliance.");
288+
val_set_status(index, RESULT_WARNING(1));
289+
} else {
290+
val_set_status(index, RESULT_SKIP(1));
291+
}
292+
} else if (test_warn) {
293+
val_set_status(index, RESULT_WARNING(1));
281294
} else if (test_fail)
282295
val_set_status(index, RESULT_FAIL(test_fail));
283296
else

test_pool/pcie/p097.c

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ payload (void)
121121
uint64_t current_dev_bdf;
122122
uint64_t next_dev_bdf;
123123
uint32_t test_skip = 1;
124+
bool skip_due_to_flag = false;
125+
bool skip_flag = acs_policy_get_pcie_skip_dp_nic_ms();
124126
pcie_device_bdf_table *bdf_tbl_ptr;
125127
uint32_t tbl_index = 0;
126128
uint32_t tbl_index_next = 0;
@@ -146,11 +148,13 @@ payload (void)
146148
* descriptors is causing an exception and for the devices
147149
* with base class codes greater than 13h as they
148150
* are reserved */
149-
if ((acs_policy_get_pcie_skip_dp_nic_ms() &&
151+
bool skip_by_flag = (skip_flag &&
150152
((base_cc == UNCLAS_CC) || (base_cc == CNTRL_CC)
151-
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC)))
152-
|| (base_cc > RES_CC))
153+
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC)));
154+
if (skip_by_flag || (base_cc > RES_CC))
153155
{
156+
if (skip_by_flag)
157+
skip_due_to_flag = true;
154158
tbl_index++;
155159
val_print(DEBUG, "\n Skipping DP/NIC/MAS/RES device.");
156160
continue;
@@ -191,11 +195,13 @@ payload (void)
191195
* descriptors is causing an exception and for the devices
192196
* with base class codes greater than 13h as they
193197
* are reserved */
194-
if ((acs_policy_get_pcie_skip_dp_nic_ms() &&
198+
skip_by_flag = (skip_flag &&
195199
((base_cc == UNCLAS_CC) || (base_cc == CNTRL_CC)
196-
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC)))
197-
|| (base_cc > RES_CC))
200+
|| (base_cc == DP_CNTRL_CC) || (base_cc == MAS_CC)));
201+
if (skip_by_flag || (base_cc > RES_CC))
198202
{
203+
if (skip_by_flag)
204+
skip_due_to_flag = true;
199205
val_print(DEBUG, "\n Skipping DP/NIC/MAS/RES device.");
200206
tbl_index_next++;
201207
continue;
@@ -247,8 +253,18 @@ payload (void)
247253
}
248254

249255
if (test_skip) {
250-
val_print(ERROR, "\n No MSI vectors found ");;
251-
val_set_status (index, RESULT_SKIP(01));
256+
if (skip_flag && skip_due_to_flag) {
257+
val_print(WARN,
258+
"\n DP/NIC/MAS/RES devices are skipped.");
259+
val_print(WARN,
260+
"\n Please individually run the test without");
261+
val_print(WARN,
262+
"\n --skip-dp-nic-ms to check the compliance.");
263+
val_set_status (index, RESULT_WARNING(01));
264+
} else {
265+
val_print(ERROR, "\n No MSI vectors found ");
266+
val_set_status (index, RESULT_SKIP(01));
267+
}
252268
} else if (!status) {
253269
val_set_status (index, RESULT_PASS);
254270
}

0 commit comments

Comments
 (0)