Skip to content

Commit c12238b

Browse files
committed
pqos: Show L3CA/MBA COS definitions per L3 cluster on AMD and Hygon
AMD and Hygon Platform QoS allocation configuration is per L3 cluster (or Core Complex - CCX). Each L3 cluster (CCX) has one L3 cluster ID which is used for both CAT and MBA ids. Show L3CA/MBA COS definitions per L3 cluster instead of per socket on AMD and Hygon platforms. The output of "pqos -s" looks like: $ pqos -s L3CA/MBA COS definitions for L3 Cluster (or Core Complex) 0: L3CA COS0 => MASK 0xffff ... L3CA COS15 => MASK 0xffff MBA COS0 => 2048 available ... MBA COS15 => 2048 available L3CA/MBA COS definitions for L3 Cluster (or Core Complex) N: ... Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
1 parent 06ae1cb commit c12238b

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

pqos/alloc.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,6 +2175,7 @@ alloc_print_config(const struct pqos_capability *cap_mon,
21752175
int ret;
21762176
unsigned i;
21772177
unsigned sock_count, *sockets = NULL;
2178+
unsigned l3c_count, *l3_clusters = NULL;
21782179

21792180
if (!sys) {
21802181
printf("Error: 'sys' (pqos_sysconfig) is not available!\n");
@@ -2187,8 +2188,26 @@ alloc_print_config(const struct pqos_capability *cap_mon,
21872188
return;
21882189
}
21892190

2190-
print_per_socket_config(cap_l3ca, cap_mba, cap_smba, sys->cpu,
2191-
sock_count, sockets);
2191+
l3_clusters = pqos_cpu_get_l3_clusters(sys->cpu, &l3c_count);
2192+
if (l3_clusters == NULL) {
2193+
printf("Error retrieving information for L3 clusters\n");
2194+
return;
2195+
}
2196+
2197+
/**
2198+
* AMD and Hygon Platform QoS allocation configuration is
2199+
* per L3 cluster (or Core Complex - CCX).
2200+
*
2201+
* Each L3 cluster (CCX) has one L3 cluster ID (l3_id)
2202+
* which is used for both CAT and MBA ids.
2203+
*/
2204+
if (sys->cpu->vendor == PQOS_VENDOR_AMD ||
2205+
sys->cpu->vendor == PQOS_VENDOR_HYGON)
2206+
print_per_l3_cluster_config(cap_l3ca, cap_mba, cap_smba,
2207+
sys->cpu, l3c_count, l3_clusters);
2208+
else
2209+
print_per_socket_config(cap_l3ca, cap_mba, cap_smba, sys->cpu,
2210+
sock_count, sockets);
21922211

21932212
if (cap_l2ca != NULL) {
21942213
/* Print L2 CAT class definitions per L2 cluster */
@@ -2299,6 +2318,9 @@ alloc_print_config(const struct pqos_capability *cap_mon,
22992318
free_and_return:
23002319
if (sockets)
23012320
free(sockets);
2321+
2322+
if (l3_clusters)
2323+
free(l3_clusters);
23022324
}
23032325

23042326
static void

0 commit comments

Comments
 (0)