7
7
#include "xe_device.h"
8
8
#include "xe_gt_sriov_pf_config.h"
9
9
#include "xe_gt_sriov_pf_control.h"
10
+ #include "xe_guc_engine_activity.h"
10
11
#include "xe_pci_sriov.h"
11
12
#include "xe_pm.h"
12
13
#include "xe_sriov.h"
@@ -111,6 +112,20 @@ static void pf_link_vfs(struct xe_device *xe, int num_vfs)
111
112
}
112
113
}
113
114
115
+ static void pf_engine_activity_stats (struct xe_device * xe , unsigned int num_vfs , bool enable )
116
+ {
117
+ struct xe_gt * gt ;
118
+ unsigned int id ;
119
+ int ret = 0 ;
120
+
121
+ for_each_gt (gt , xe , id ) {
122
+ ret = xe_guc_engine_activity_function_stats (& gt -> uc .guc , num_vfs , enable );
123
+ if (ret )
124
+ xe_sriov_info (xe , "Failed to %s engine activity function stats (%pe)\n" ,
125
+ str_enable_disable (enable ), ERR_PTR (ret ));
126
+ }
127
+ }
128
+
114
129
static int pf_enable_vfs (struct xe_device * xe , int num_vfs )
115
130
{
116
131
struct pci_dev * pdev = to_pci_dev (xe -> drm .dev );
@@ -145,6 +160,9 @@ static int pf_enable_vfs(struct xe_device *xe, int num_vfs)
145
160
146
161
xe_sriov_info (xe , "Enabled %u of %u VF%s\n" ,
147
162
num_vfs , total_vfs , str_plural (total_vfs ));
163
+
164
+ pf_engine_activity_stats (xe , num_vfs , true);
165
+
148
166
return num_vfs ;
149
167
150
168
failed :
@@ -168,6 +186,8 @@ static int pf_disable_vfs(struct xe_device *xe)
168
186
if (!num_vfs )
169
187
return 0 ;
170
188
189
+ pf_engine_activity_stats (xe , num_vfs , false);
190
+
171
191
pci_disable_sriov (pdev );
172
192
173
193
pf_reset_vfs (xe , num_vfs );
0 commit comments