sum.h (3611B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCM_SUM_H__ 14 #define __BCM_SUM_H__ 15 16 #include <bcm/types.h> 17 18 /* SUM counter types */ 19 typedef enum bcm_sum_type_e { 20 bcmSumTypeTxPktCnt = 0, /* SUM monitors Tx packet counters. */ 21 bcmSumTypeRxPktCnt = 1, /* SUM monitors Rx packet counters. */ 22 bcmSumTypeTxByteCnt = 2, /* SUM monitors Tx byte counters. */ 23 bcmSumTypeRxByteCnt = 3, /* SUM monitors Rx byte counters. */ 24 bcmSumTypeTxPktByteCnt = 4, /* SUM monitors Tx packet, Tx byte counters. */ 25 bcmSumTypeRxPktByteCnt = 5, /* SUM monitors Rx packet, Rx byte counters. */ 26 bcmSumTypeRxTxPktCnt = 6, /* SUM monitors Tx/Rx packet counters. */ 27 bcmSumTypeRxTxByteCnt = 7, /* SUM monitors Tx/Rx byte counters. */ 28 bcmSumTypeTxRxPktByteCnt = 8, /* SUM monitors all Tx packet, Tx byte, Rx 29 packet, Rx byte counters. */ 30 bcmSumTypeMax = 9 /* Maximum Counter Type. */ 31 } bcm_sum_type_t; 32 33 /* SUM stats information types */ 34 typedef enum bcm_sum_stat_type_e { 35 bcmSumPeakUsageInfo = 0, /* SUM Peak usage information. */ 36 bcmSumMinimumUsageInfo = 1, /* SUM Minimum usage information. */ 37 bcmSumUsageInfo = 2 /* SUM user requested number, of usage history. */ 38 } bcm_sum_stat_type_t; 39 40 /* SUM Configuration information. */ 41 typedef struct bcm_sum_config_s { 42 uint32 usec_sample_interval; /* sample data interval */ 43 uint32 max_history; /* maximum samples number of history */ 44 bcm_sum_type_t sum_type; /* sum type */ 45 } bcm_sum_config_t; 46 47 /* SUM stats data. */ 48 typedef struct bcm_sum_stat_info_s { 49 uint64 sequence_num; /* This is running global number update for 50 every entry for unique identification. */ 51 uint64 time_stamp; /* Sample time stamp. */ 52 uint64 tx_pkt_count; /* Tx packet count. */ 53 uint64 rx_pkt_count; /* Rx packet count. */ 54 uint64 tx_byte_count; /* Tx byte count. */ 55 uint64 rx_byte_count; /* Rx byte count. */ 56 bcm_sum_type_t sum_type; /* sum type */ 57 } bcm_sum_stat_info_t; 58 59 #ifndef BCM_HIDE_DISPATCHABLE 60 61 /* Initialize the Switch Utilization Monitor SUM subsystem. */ 62 extern int bcm_sum_init( 63 int unit); 64 65 /* Shut Down the Switch Utilization Monitor SUM subsystem. */ 66 extern int bcm_sum_detach( 67 int unit); 68 69 #endif /* BCM_HIDE_DISPATCHABLE */ 70 71 /* Initialize SUM configuration information structure. */ 72 extern void bcm_sum_config_t_init( 73 bcm_sum_config_t *config_data); 74 75 /* Initialize SUM usage information structure. */ 76 extern void bcm_sum_stat_info_t_init( 77 bcm_sum_stat_info_t *stat_data); 78 79 #ifndef BCM_HIDE_DISPATCHABLE 80 81 /* Add SUM - configuration information */ 82 extern int bcm_sum_config_set( 83 int unit, 84 bcm_sum_config_t *config_data, 85 bcm_pbmp_t pbmp); 86 87 /* Get SUM - configuration information */ 88 extern int bcm_sum_config_get( 89 int unit, 90 bcm_sum_config_t *config_data, 91 bcm_pbmp_t *pbmp); 92 93 /* Get SUM - stats information */ 94 extern int bcm_sum_stat_get( 95 int unit, 96 uint32 max_samples, 97 bcm_sum_stat_info_t *stats_data, 98 uint32 *num_samples, 99 bcm_sum_stat_type_t stat_type, 100 uint32 usec_sample_period); 101 102 #endif /* BCM_HIDE_DISPATCHABLE */ 103 104 #endif /* __BCM_SUM_H__ */