@@ -162,30 +162,18 @@ __gnet_stats_copy_basic(const seqcount_t *running,
162162}
163163EXPORT_SYMBOL (__gnet_stats_copy_basic );
164164
165- /**
166- * gnet_stats_copy_basic - copy basic statistics into statistic TLV
167- * @running: seqcount_t pointer
168- * @d: dumping handle
169- * @cpu: copy statistic per cpu
170- * @b: basic statistics
171- *
172- * Appends the basic statistics to the top level TLV created by
173- * gnet_stats_start_copy().
174- *
175- * Returns 0 on success or -1 with the statistic lock released
176- * if the room in the socket buffer was not sufficient.
177- */
178165int
179- gnet_stats_copy_basic (const seqcount_t * running ,
180- struct gnet_dump * d ,
181- struct gnet_stats_basic_cpu __percpu * cpu ,
182- struct gnet_stats_basic_packed * b )
166+ ___gnet_stats_copy_basic (const seqcount_t * running ,
167+ struct gnet_dump * d ,
168+ struct gnet_stats_basic_cpu __percpu * cpu ,
169+ struct gnet_stats_basic_packed * b ,
170+ int type )
183171{
184172 struct gnet_stats_basic_packed bstats = {0 };
185173
186174 __gnet_stats_copy_basic (running , & bstats , cpu , b );
187175
188- if (d -> compat_tc_stats ) {
176+ if (d -> compat_tc_stats && type == TCA_STATS_BASIC ) {
189177 d -> tc_stats .bytes = bstats .bytes ;
190178 d -> tc_stats .packets = bstats .packets ;
191179 }
@@ -196,13 +184,60 @@ gnet_stats_copy_basic(const seqcount_t *running,
196184 memset (& sb , 0 , sizeof (sb ));
197185 sb .bytes = bstats .bytes ;
198186 sb .packets = bstats .packets ;
199- return gnet_stats_copy (d , TCA_STATS_BASIC , & sb , sizeof (sb ),
187+ return gnet_stats_copy (d , type , & sb , sizeof (sb ),
200188 TCA_STATS_PAD );
201189 }
202190 return 0 ;
203191}
192+
193+ /**
194+ * gnet_stats_copy_basic - copy basic statistics into statistic TLV
195+ * @running: seqcount_t pointer
196+ * @d: dumping handle
197+ * @cpu: copy statistic per cpu
198+ * @b: basic statistics
199+ *
200+ * Appends the basic statistics to the top level TLV created by
201+ * gnet_stats_start_copy().
202+ *
203+ * Returns 0 on success or -1 with the statistic lock released
204+ * if the room in the socket buffer was not sufficient.
205+ */
206+ int
207+ gnet_stats_copy_basic (const seqcount_t * running ,
208+ struct gnet_dump * d ,
209+ struct gnet_stats_basic_cpu __percpu * cpu ,
210+ struct gnet_stats_basic_packed * b )
211+ {
212+ return ___gnet_stats_copy_basic (running , d , cpu , b ,
213+ TCA_STATS_BASIC );
214+ }
204215EXPORT_SYMBOL (gnet_stats_copy_basic );
205216
217+ /**
218+ * gnet_stats_copy_basic_hw - copy basic hw statistics into statistic TLV
219+ * @running: seqcount_t pointer
220+ * @d: dumping handle
221+ * @cpu: copy statistic per cpu
222+ * @b: basic statistics
223+ *
224+ * Appends the basic statistics to the top level TLV created by
225+ * gnet_stats_start_copy().
226+ *
227+ * Returns 0 on success or -1 with the statistic lock released
228+ * if the room in the socket buffer was not sufficient.
229+ */
230+ int
231+ gnet_stats_copy_basic_hw (const seqcount_t * running ,
232+ struct gnet_dump * d ,
233+ struct gnet_stats_basic_cpu __percpu * cpu ,
234+ struct gnet_stats_basic_packed * b )
235+ {
236+ return ___gnet_stats_copy_basic (running , d , cpu , b ,
237+ TCA_STATS_BASIC_HW );
238+ }
239+ EXPORT_SYMBOL (gnet_stats_copy_basic_hw );
240+
206241/**
207242 * gnet_stats_copy_rate_est - copy rate estimator statistics into statistics TLV
208243 * @d: dumping handle
0 commit comments