2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef _STATS_PORT_H_
18 #define _STATS_PORT_H_
33 struct port_stats_sample {
43 uint64_t tx_pkt_size[PKT_SIZE_COUNT];
47 struct port_stats_sample sample[2];
50 struct get_port_stats {
51 uint64_t no_mbufs_diff;
52 uint64_t ierrors_diff;
53 uint64_t imissed_diff;
54 uint64_t rx_bytes_diff;
55 uint64_t tx_bytes_diff;
56 uint64_t rx_pkts_diff;
57 uint64_t tx_pkts_diff;
60 uint64_t no_mbufs_tot;
67 int stats_port(uint8_t port_id, struct get_port_stats *ps);
68 void stats_port_init(void);
69 void stats_port_reset(void);
70 void stats_port_update(void);
71 uint64_t stats_port_get_ierrors(void);
72 uint64_t stats_port_get_imissed(void);
73 uint64_t stats_port_get_rx_packets(void);
74 uint64_t stats_port_get_tx_packets(void);
76 int stats_get_n_ports(void);
77 struct port_stats_sample *stats_get_port_stats_sample(uint32_t port_id, int l);
79 #endif /* _STATS_PORT_H_ */