Support packets in flight
[samplevnf.git] / VNFs / DPPD-PROX / stats_prio_task.h
1 /*
2 // Copyright (c) 2010-2017 Intel Corporation
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 */
16
17 #ifndef _STATS_PRIO_TASK_H_
18 #define _STATS_PRIO_TASK_H_
19
20 #include <inttypes.h>
21
22 #include "clock.h"
23
24 struct prio_task_stats_sample {
25         uint64_t tsc;
26         uint64_t drop_tx_fail_prio[8];
27         uint64_t rx_prio[8];
28 };
29
30 struct prio_task_rt_stats {
31         uint64_t drop_tx_fail_prio[8];
32         uint64_t rx_prio[8];
33 };
34
35 struct prio_task_stats {
36         uint64_t tot_drop_tx_fail_prio[8];
37         uint64_t tot_rx_prio[8];
38         uint8_t lcore_id;
39         uint8_t task_id;
40         struct prio_task_stats_sample sample[2];
41         struct prio_task_rt_stats *stats;
42 };
43
44 int stats_get_n_prio_tasks_tot(void);
45 void stats_prio_task_reset(void);
46 void stats_prio_task_post_proc(void);
47 void stats_prio_task_update(void);
48 void stats_prio_task_init(void);
49
50 struct prio_task_stats_sample *stats_get_prio_task_stats_sample(uint32_t task_id, int last);
51 struct prio_task_stats_sample *stats_get_prio_task_stats_sample_by_core_task(uint32_t lcore_id, uint32_t task_id, int last);
52 uint64_t stats_core_task_tot_drop_tx_fail_prio(uint8_t task_id, uint8_t prio);
53 uint64_t stats_core_task_tot_rx_prio(uint8_t task_id, uint8_t prio);
54
55 #endif /* _STATS_PRIO_TASK_H_ */