FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
xlate.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /*---------------------------------------------------------------------------
16  * from gdp_logical_qos.h
17  *---------------------------------------------------------------------------
18  */
19 
20 #ifndef __included_xlate_h__
21 #define __included_xlate_h__
22 
23 #include <vnet/policer/police.h>
24 
25 /*
26  * edt: * enum sse2_qos_policer_type_en
27  * Defines type of policer to be allocated
28  */
30 {
38 
39 /*
40  * edt: * enum
41  * Enum used to define type of rounding used when calculating policer values
42  */
43 typedef enum
44 {
50 
51 /*
52  * edt: * enum
53  * Enum used to define type of rate for configuration, either pps or kbps.
54  * If kbps, then burst is in bytes, if pps, then burst is in ms.
55  *
56  * Default of zero is kbps, which is inline with how it is programmed
57  * in actual hardware. However, the warning is that this is reverse logic
58  * of units_in_bits field in sse2_static_policer_parameters_st, which is
59  * inline with sse_punt_drop.h.
60  */
61 typedef enum
62 {
67 
68 /*
69  * edt: * enum
70  * Defines type of policer actions.
71  */
72 typedef enum
73 {
78 
79 /*
80  * edt * struct sse2_qos_pol_action_params_st
81  * This structure is used to hold user configured police action parameters.
82  *
83  * element: action_type
84  * Action type (see sse2_qos_action_type_en).
85  * element: dscp
86  * DSCP value to set when action is SSE2_QOS_ACTION_MARK_AND_TRANSMIT.
87  */
89 {
93 
94 /*
95  * edt: * struct sse2_qos_pol_cfg_params_st
96  *
97  * Description:
98  * This structure is used to hold user configured policing parameters.
99  *
100  * element: cir_kbps
101  * CIR in kbps.
102  * element: eir_kbps
103  * EIR or PIR in kbps.
104  * element: cb_bytes
105  * Committed Burst in bytes.
106  * element: eb_bytes
107  * Excess or Peak Burst in bytes.
108  * element: cir_pps
109  * CIR in pps.
110  * element: eir_pps
111  * EIR or PIR in pps.
112  * element: cb_ms
113  * Committed Burst in milliseconds.
114  * element: eb_ms
115  * Excess or Peak Burst in milliseconds.
116  * element: rate_type
117  * Indicates the union if in kbps/bytes or pps/ms.
118  * element: rfc
119  * Policer algorithm - 1R2C, 1R3C (2697), 2R3C (2698) or 2R3C (4115). See
120  * sse_qos_policer_type_en
121  * element: rnd_type
122  * Rounding type (see sse_qos_round_type_en). Needed when policer values
123  * need to be rounded. Caller can decide on type of rounding used
124  */
126 {
127  union
128  {
129  struct
130  {
135  } kbps;
136  struct
137  {
142  } pps;
143  } rb; /* rate burst config */
144  u8 rate_type; /* sse2_qos_rate_type_en */
145  u8 rnd_type; /* sse2_qos_round_type_en */
146  u8 rfc; /* sse2_qos_policer_type_en */
148  u8 overwrite_bucket; /* for debugging purposes */
149  u32 current_bucket; /* for debugging purposes */
150  u32 extended_bucket; /* for debugging purposes */
155 
156 
158 {
171 
172 
173 int
176 
177 
178 #endif /* __included_xlate_h__ */
179 
180 /*
181  * fd.io coding-style-patch-verification: ON
182  *
183  * Local Variables:
184  * eval: (c-set-style "gnu")
185  * End:
186  */
sse2_qos_pol_action_params_st conform_action
Definition: xlate.h:151
struct sse2_qos_pol_hw_params_st_ sse2_qos_pol_hw_params_st
unsigned long u64
Definition: types.h:89
unsigned char u8
Definition: types.h:56
unsigned int u32
Definition: types.h:88
int sse2_pol_logical_2_physical(sse2_qos_pol_cfg_params_st *cfg, policer_read_response_type_st *phys)
Definition: xlate.c:1171
sse2_qos_policer_type_en_
Definition: xlate.h:29
enum sse2_qos_policer_type_en_ sse2_qos_policer_type_en
sse2_qos_rate_type_en
Definition: xlate.h:61
unsigned short u16
Definition: types.h:57
sse2_qos_pol_action_params_st violate_action
Definition: xlate.h:153
sse2_qos_pol_action_params_st exceed_action
Definition: xlate.h:152
struct sse2_qos_pol_cfg_params_st_ sse2_qos_pol_cfg_params_st
struct sse2_qos_pol_action_params_st_ sse2_qos_pol_action_params_st
sse2_qos_round_type_en
Definition: xlate.h:43
sse2_qos_action_type_en
Definition: xlate.h:72