@@ -59,84 +59,99 @@ enum dpf_msg_type {
59
59
DPF_MSG_TUNING = 4 , // Tuning control
60
60
DPF_MSG_MSR_READ = 5 , // Read MSR values
61
61
DPF_MSG_PMU_READ = 6 , // Read PMU values
62
- DPF_MSG_DDR_CONFIG = 7 // DDR configuration
62
+ DPF_MSG_DDR_CONFIG = 7 , // DDR configuration
63
+ DPF_MSG_DDR_BW_READ = 8 //DDR BW READ
63
64
};
64
65
65
- // Message structures
66
+ // Common message header
66
67
struct dpf_msg_header {
67
68
__u32 type ; // Message type (from dpf_msg_type)
68
69
__u32 payload_size ; // Size of payload following the header
69
70
};
70
71
72
+ // Request structure for API version
71
73
struct dpf_req_init {
72
74
struct dpf_msg_header header ;
73
75
};
74
76
77
+ // Response structure for API version
75
78
struct dpf_resp_init {
76
79
struct dpf_msg_header header ;
77
80
__u32 version ; // Returned API version
78
81
};
79
82
83
+ // Request structure for core range
80
84
struct dpf_core_range {
81
85
struct dpf_msg_header header ;
82
86
__u32 core_start ; // First core in range
83
87
__u32 core_end ; // Last core in range
84
88
};
85
89
90
+ // Response structure for core range
86
91
struct dpf_resp_core_range {
87
92
struct dpf_msg_header header ;
88
93
__u32 core_start ; // Confirmed first core
89
94
__u32 core_end ; // Confirmed last core
90
95
__u32 thread_count ; // Number of threads (cores) in range
91
96
};
92
97
98
+ // Request structure for core weights
93
99
struct dpf_core_weight {
94
100
struct dpf_msg_header header ;
95
101
__u32 count ; // Number of weights
96
102
__u32 weights []; // Flexible array of core weights
97
103
};
98
104
105
+ // Response structure for core weights
99
106
struct dpf_resp_core_weight {
100
107
struct dpf_msg_header header ;
101
108
__u32 count ; // Number of confirmed weights
102
109
__u32 confirmed_weights []; // Flexible array of confirmed weights
103
110
};
104
111
112
+ // Request structure for tuning
105
113
struct dpf_req_tuning {
106
114
struct dpf_msg_header header ;
107
115
__u32 enable ; // Enable tuning (non-zero) or disable (0)
108
116
};
109
117
118
+ // Response structure for tuning
110
119
struct dpf_resp_tuning {
111
120
struct dpf_msg_header header ;
112
121
__u32 status ; // Tuning status (e.g., enabled/disabled)
113
122
};
114
123
124
+ // Request structure for DDR bandwidth setting
115
125
struct dpf_ddrbw_set {
116
126
struct dpf_msg_header header ;
117
127
__u32 set_value ; // DDR bandwidth value to set (MB/s)
118
128
};
119
129
130
+ // Response structure for DDR bandwidth setting
120
131
struct dpf_resp_ddrbw_set {
121
132
struct dpf_msg_header header ;
122
133
__u32 confirmed_value ; // Confirmed DDR bandwidth value
123
134
};
124
135
136
+ // Request structure for MSR read
125
137
struct dpf_msr_read {
126
138
struct dpf_msg_header header ;
127
139
__u32 core_id ; // Core ID to read MSRs from
128
140
};
129
141
142
+ // Response structure for MSR read
130
143
struct dpf_resp_msr_read {
131
144
struct dpf_msg_header header ;
132
145
__u64 msr_values [NR_OF_MSR ]; // Array of MSR values
133
146
};
134
147
148
+ // Request structure for PMU read
135
149
struct dpf_pmu_read {
136
150
struct dpf_msg_header header ;
137
151
__u32 core_id ; // Core ID to read PMU from
138
152
};
139
153
154
+ // Response structure for PMU read
140
155
struct dpf_resp_pmu_read {
141
156
struct dpf_msg_header header ;
142
157
__u64 pmu_values [PMU_COUNTERS ]; // Array of PMU counter values
@@ -147,6 +162,7 @@ struct dpf_ddr_config {
147
162
struct dpf_msg_header header ;
148
163
__u64 bar_address ; // BAR address for DDR config space
149
164
__u32 cpu_type ; // CPU type (e.g., DDR_CLIENT, DDR_GRR_SRF)
165
+ __u32 num_controllers ; // Number of DDR controllers
150
166
};
151
167
152
168
// Response structure for DDR configuration
@@ -156,6 +172,18 @@ struct dpf_resp_ddr_config {
156
172
__u32 confirmed_type ; // Confirmed CPU type
157
173
};
158
174
175
+ // Request structure for reading DDR bandwidth
176
+ struct dpf_ddr_bw_read {
177
+ struct dpf_msg_header header ;
178
+ };
179
+
180
+ // Response structure for reading DDR bandwidth
181
+ struct dpf_resp_ddr_bw_read {
182
+ struct dpf_msg_header header ;
183
+ uint64_t read_bw ;
184
+ uint64_t write_bw ;
185
+ };
186
+
159
187
// Core state structure
160
188
struct core_state_s {
161
189
uint64_t pmu_result [PMU_COUNTERS ]; // Delta since last PMU read (mapped to pmu_metrics)
@@ -175,6 +203,7 @@ int msr_load(int core_id);
175
203
int msr_update (int core_id );
176
204
int pmu_update (int core_id );
177
205
206
+ // Functions for reading and writing MSRs
178
207
int msr_set_l2xq (int core_id , int value );
179
208
int msr_get_l2xq (int core_id );
180
209
int msr_set_l3xq (int core_id , int value );
0 commit comments