FD.io VPP  v21.06
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/ip/ip_packet.h>
24 #include <vnet/policer/police.h>
25 
26 /*
27  * edt: * enum qos_policer_type_en
28  * Defines type of policer to be allocated
29  */
31 {
38 } __clib_packed qos_policer_type_en;
39 
40 /*
41  * edt: * enum
42  * Enum used to define type of rounding used when calculating policer values
43  */
44 typedef enum
45 {
50 } __clib_packed qos_round_type_en;
51 
52 /*
53  * edt: * enum
54  * Enum used to define type of rate for configuration, either pps or kbps.
55  * If kbps, then burst is in bytes, if pps, then burst is in ms.
56  *
57  * Default of zero is kbps, which is inline with how it is programmed
58  * in actual hardware. However, the warning is that this is reverse logic
59  * of units_in_bits field in static_policer_parameters_st, which is
60  * inline with sse_punt_drop.h.
61  */
62 typedef enum
63 {
67 } __clib_packed qos_rate_type_en;
68 
69 /*
70  * edt * struct qos_pol_action_params_st
71  * This structure is used to hold user configured police action parameters.
72  *
73  * element: action_type
74  * Action type (see qos_action_type_en).
75  * element: dscp
76  * DSCP value to set when action is QOS_ACTION_MARK_AND_TRANSMIT.
77  */
79 {
80  qos_action_type_en action_type;
83 
84 /*
85  * edt: * struct qos_pol_cfg_params_st
86  *
87  * Description:
88  * This structure is used to hold user configured policing parameters.
89  *
90  * element: cir_kbps
91  * CIR in kbps.
92  * element: eir_kbps
93  * EIR or PIR in kbps.
94  * element: cb_bytes
95  * Committed Burst in bytes.
96  * element: eb_bytes
97  * Excess or Peak Burst in bytes.
98  * element: cir_pps
99  * CIR in pps.
100  * element: eir_pps
101  * EIR or PIR in pps.
102  * element: cb_ms
103  * Committed Burst in milliseconds.
104  * element: eb_ms
105  * Excess or Peak Burst in milliseconds.
106  * element: rate_type
107  * Indicates the union if in kbps/bytes or pps/ms.
108  * element: rfc
109  * Policer algorithm - 1R2C, 1R3C (2697), 2R3C (2698) or 2R3C (4115). See
110  * qos_policer_type_en
111  * element: rnd_type
112  * Rounding type (see qos_round_type_en). Needed when policer values
113  * need to be rounded. Caller can decide on type of rounding used
114  */
116 {
117  union
118  {
119  struct
120  {
125  } kbps;
126  struct
127  {
132  } pps;
133  } rb; /* rate burst config */
134  qos_rate_type_en rate_type;
135  qos_round_type_en rnd_type;
138  u8 overwrite_bucket; /* for debugging purposes */
139  u32 current_bucket; /* for debugging purposes */
140  u32 extended_bucket; /* for debugging purposes */
145 
146 typedef struct qos_pol_hw_params_st_
147 {
160 
162 
163 #endif /* __included_xlate_h__ */
164 
165 /*
166  * fd.io coding-style-patch-verification: ON
167  *
168  * Local Variables:
169  * eval: (c-set-style "gnu")
170  * End:
171  */
qos_pol_action_params_st exceed_action
Definition: xlate.h:142
unsigned long u64
Definition: types.h:89
qos_round_type_en rnd_type
Definition: xlate.h:135
struct qos_pol_action_params_st_ qos_pol_action_params_st
unsigned char u8
Definition: types.h:56
qos_action_type_en action_type
Definition: xlate.h:80
unsigned int u32
Definition: types.h:88
qos_policer_type_en_
Definition: xlate.h:30
qos_rate_type_en rate_type
Definition: xlate.h:134
unsigned short u16
Definition: types.h:57
struct qos_pol_hw_params_st_ qos_pol_hw_params_st
qos_pol_action_params_st conform_action
Definition: xlate.h:141
enum qos_policer_type_en_ qos_policer_type_en
enum ip_dscp_t_ ip_dscp_t
int pol_logical_2_physical(qos_pol_cfg_params_st *cfg, policer_t *phys)
Definition: xlate.c:1061
struct qos_pol_cfg_params_st_ qos_pol_cfg_params_st
qos_policer_type_en rfc
Definition: xlate.h:136
qos_pol_action_params_st violate_action
Definition: xlate.h:143