Fix reorder count after reset
[samplevnf.git] / common / vnf_common / thread.h
1 /*
2 // Copyright (c) 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 THREAD_H_
18 #define THREAD_H_
19
20 #include "app.h"
21 #include "pipeline_be.h"
22
23 enum thread_msg_req_type {
24         THREAD_MSG_REQ_PIPELINE_ENABLE = 0,
25         THREAD_MSG_REQ_PIPELINE_DISABLE,
26         THREAD_MSG_REQ_HEADROOM_READ,
27         THREAD_MSG_REQS
28 };
29
30 struct thread_msg_req {
31         enum thread_msg_req_type type;
32 };
33
34 struct thread_msg_rsp {
35         int status;
36 };
37
38 /*
39  * PIPELINE ENABLE
40  */
41 struct thread_pipeline_enable_msg_req {
42         enum thread_msg_req_type type;
43
44         uint32_t pipeline_id;
45         void *be;
46         pipeline_be_op_run f_run;
47         pipeline_be_op_timer f_timer;
48         uint64_t timer_period;
49 };
50
51 struct thread_pipeline_enable_msg_rsp {
52         int status;
53 };
54
55 /*
56  * PIPELINE DISABLE
57  */
58 struct thread_pipeline_disable_msg_req {
59         enum thread_msg_req_type type;
60
61         uint32_t pipeline_id;
62 };
63
64 struct thread_pipeline_disable_msg_rsp {
65         int status;
66 };
67
68 /*
69  * THREAD HEADROOM
70  */
71 struct thread_headroom_read_msg_req {
72         enum thread_msg_req_type type;
73 };
74
75 struct thread_headroom_read_msg_rsp {
76         int status;
77
78         double headroom_ratio;
79 };
80
81 #endif /* THREAD_H_ */