Skip to content

Commit 9a07186

Browse files
committed
Bulk Stats Capability flags and Bulk Stats Clear API
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
1 parent fed534c commit 9a07186

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

inc/saiobject.h

+27-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ sai_status_t sai_query_stats_capability(
259259
* @param[in] number_of_counters Number of counters in the array
260260
* @param[in] counter_ids Specifies the array of counter ids
261261
* @param[in] mode Statistics mode
262-
* @param[out] counters Array of resulting counter values
262+
* @param[out] status Array of status for each object. Length of the array should be object_count. Should be looked only if API return is not SAI_STATUS_SUCCESS.
263+
* @param[out] counters Array of resulting counter values.
263264
*
264265
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
265266
*/
@@ -271,8 +272,33 @@ typedef sai_status_t (*sai_bulk_object_get_stats_fn)(
271272
_In_ uint32_t number_of_counters,
272273
_In_ const sai_stat_id_t *counter_ids,
273274
_In_ sai_stats_mode_t mode,
275+
_Out_ sai_status_t *status,
274276
_Out_ uint64_t *counters);
275277

278+
/**
279+
* @brief Bulk objects clear statistics.
280+
*
281+
* @param[in] switch_id SAI Switch object id
282+
* @param[in] object_type Object type
283+
* @param[in] object_count Number of objects to get the stats
284+
* @param[in] object_key List of object keys
285+
* @param[in] number_of_counters Number of counters in the array
286+
* @param[in] counter_ids Specifies the array of counter ids
287+
* @param[in] mode Statistics mode
288+
* @param[out] status Array of status for each object. Length of the array should be object_count. Should be looked only if API return is not SAI_STATUS_SUCCESS.
289+
*
290+
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
291+
*/
292+
typedef sai_status_t (*sai_bulk_object_clear_stats_fn)(
293+
_In_ sai_object_id_t switch_id,
294+
_In_ sai_object_type_t object_type,
295+
_In_ uint32_t object_count,
296+
_In_ const sai_object_key_t *object_key,
297+
_In_ uint32_t number_of_counters,
298+
_In_ const sai_stat_id_t *counter_ids,
299+
_In_ sai_stats_mode_t mode,
300+
_Out_ sai_status_t *status);
301+
276302
/**
277303
* @}
278304
*/

inc/saitypes.h

+15
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,21 @@ typedef enum _sai_stats_mode_t
14281428
* @brief Read and clear after reading
14291429
*/
14301430
SAI_STATS_MODE_READ_AND_CLEAR = 1 << 1,
1431+
1432+
/**
1433+
* @brief Build read statistics
1434+
*/
1435+
SAI_STATS_MODE_BULK_READ = 1 << 2,
1436+
1437+
/**
1438+
* @brief Build clear statistics
1439+
*/
1440+
SAI_STATS_MODE_BULK_CLEAR = 1 << 3,
1441+
1442+
/**
1443+
* @brief Bulk read and clear after reading
1444+
*/
1445+
SAI_STATS_MODE_BULK_READ_AND_CLEAR = 1 << 4,
14311446
} sai_stats_mode_t;
14321447

14331448
typedef struct _sai_stat_capability_t

meta/style.pm

+1
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ sub CheckStatsFunction
206206
return if $fname eq "sai_clear_port_all_stats_fn"; # exception
207207
return if $fname eq "sai_get_tam_snapshot_stats_fn"; # exception
208208
return if $fname eq "sai_bulk_object_get_stats_fn"; # exception
209+
return if $fname eq "sai_bulk_object_clear_stats_fn"; # exception
209210

210211
if (not $fname =~ /^sai_((get|clear)_(\w+)_stats|get_\w+_stats_ext)_fn$/)
211212
{

0 commit comments

Comments
 (0)