X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fstats%2Fstats.h;h=fd1ab271f78af00901d18d3785f04d7b9ba9691a;hb=048a4e5a000017d0d632ebf02dcc23d9bf9ccf72;hp=042bcb65801a1e59e3bdc8f69d35be0cde022f3c;hpb=831fb59f2eba1abbd1e49fc7dce58172f0842258;p=vpp.git diff --git a/src/vpp/stats/stats.h b/src/vpp/stats/stats.h index 042bcb65801..fd1ab271f78 100644 --- a/src/vpp/stats/stats.h +++ b/src/vpp/stats/stats.h @@ -22,10 +22,12 @@ #include #include #include +#include #include #include -#include #include +#include +#include typedef struct { @@ -41,36 +43,14 @@ typedef struct * */ /* from .../vnet/vnet/ip/lookup.c. Yuck */ +/* *INDENT-OFF* */ typedef CLIB_PACKED (struct - { - ip4_address_t address; -u32 address_length: 6; -u32 index: 26; - }) ip4_route_t; - -/* see interface.api */ -typedef struct { - u32 sw_if_index; - u64 drop; - u64 punt; - u64 rx_ip4; - u64 rx_ip6; - u64 rx_no_buffer; - u64 rx_miss; - u64 rx_error; - u64 tx_error; - u64 rx_mpls; -} vnet_simple_counter_t; - -typedef struct -{ - u32 sw_if_index; - u64 rx_packets; /**< packet counter */ - u64 rx_bytes; /**< byte counter */ - u64 tx_packets; /**< packet counter */ - u64 tx_bytes; /**< byte counter */ -} vnet_combined_counter_t; + ip4_address_t address; + u32 address_length: 6; + u32 index: 26; +}) ip4_route_t; +/* *INDENT-ON* */ typedef struct { @@ -79,12 +59,13 @@ typedef struct u32 index; } ip6_route_t; - typedef struct { ip4_route_t *ip4routes; ip6_route_t *ip6routes; + mfib_prefix_t *mroutes; fib_table_t **fibs; + mfib_table_t **mfibs; hash_pair_t **pvec; uword *results; } do_ip46_fibs_t; @@ -177,6 +158,15 @@ typedef struct vpe_client_stats_registration_t **regs_tmp; vpe_client_registration_t **clients_tmp; + /* statistics segment */ + ssvm_private_t stat_segment; + uword *counter_vector_by_name; + clib_spinlock_t *stat_segment_lockp; + + /* Pointers to scalar stats maintained by the stat segment process */ + f64 *input_rate_ptr; + f64 *vector_rate_ptr; + /* convenience */ vlib_main_t *vlib_main; vnet_main_t *vnet_main; @@ -184,10 +174,26 @@ typedef struct api_main_t *api_main; } stats_main_t; -stats_main_t stats_main; +extern stats_main_t stats_main; + +#define STAT_SEGMENT_OPAQUE_LOCK 0 +#define STAT_SEGMENT_OPAQUE_DIR 1 +#define STAT_SEGMENT_OPAQUE_EPOCH 2 -void dslock (stats_main_t * sm, int release_hint, int tag); -void dsunlock (stats_main_t * sm); +typedef enum +{ + STAT_DIR_TYPE_ILLEGAL = 0, + STAT_DIR_TYPE_SCALAR_POINTER, + STAT_DIR_TYPE_VECTOR_POINTER, + STAT_DIR_TYPE_COUNTER_VECTOR, + STAT_DIR_TYPE_ERROR_INDEX, +} stat_directory_type_t; + +typedef struct +{ + stat_directory_type_t type; + void *value; +} stat_segment_directory_entry_t; #endif /* __included_stats_h__ */