FD.io VPP  v21.06-3-gbb25fbf28
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_hw_params_st_::extd_bkt
u32 extd_bkt
Definition: xlate.h:158
qos_pol_cfg_params_st_::extended_bucket
u32 extended_bucket
Definition: xlate.h:140
QOS_RATE_KBPS
@ QOS_RATE_KBPS
Definition: xlate.h:64
ip_dscp_t
enum ip_dscp_t_ ip_dscp_t
qos_pol_cfg_params_st_::color_aware
u8 color_aware
Definition: xlate.h:137
QOS_POLICER_TYPE_2R3C_RFC_4115
@ QOS_POLICER_TYPE_2R3C_RFC_4115
Definition: xlate.h:35
qos_pol_hw_params_st_::extd_bkt_limit_man
u8 extd_bkt_limit_man
Definition: xlate.h:156
QOS_POLICER_TYPE_2R3C_RFC_2698
@ QOS_POLICER_TYPE_2R3C_RFC_2698
Definition: xlate.h:34
qos_pol_hw_params_st_::peak_rate_man
u16 peak_rate_man
Definition: xlate.h:152
qos_pol_cfg_params_st_::eir_kbps
u32 eir_kbps
Definition: xlate.h:122
policer_t
Definition: police.h:73
qos_pol_cfg_params_st_::cir_kbps
u32 cir_kbps
Definition: xlate.h:121
u16
unsigned short u16
Definition: types.h:57
qos_pol_cfg_params_st_::rfc
qos_policer_type_en rfc
Definition: xlate.h:136
qos_pol_cfg_params_st_
Definition: xlate.h:115
QOS_POLICER_TYPE_1R3C_RFC_2697
@ QOS_POLICER_TYPE_1R3C_RFC_2697
Definition: xlate.h:33
qos_pol_action_params_st
struct qos_pol_action_params_st_ qos_pol_action_params_st
ip_packet.h
qos_pol_cfg_params_st_::conform_action
qos_pol_action_params_st conform_action
Definition: xlate.h:141
qos_pol_hw_params_st_::avg_rate_man
u16 avg_rate_man
Definition: xlate.h:151
qos_pol_action_params_st_
Definition: xlate.h:78
QOS_ROUND_INVALID
@ QOS_ROUND_INVALID
Definition: xlate.h:49
pol_logical_2_physical
int pol_logical_2_physical(qos_pol_cfg_params_st *cfg, policer_t *phys)
Definition: xlate.c:1061
qos_pol_hw_params_st
struct qos_pol_hw_params_st_ qos_pol_hw_params_st
qos_pol_cfg_params_st_::pps
struct qos_pol_cfg_params_st_::@490::@492 pps
QOS_POLICER_TYPE_1R2C
@ QOS_POLICER_TYPE_1R2C
Definition: xlate.h:32
qos_pol_action_params_st_::dscp
ip_dscp_t dscp
Definition: xlate.h:81
QOS_ROUND_TO_DOWN
@ QOS_ROUND_TO_DOWN
Definition: xlate.h:48
qos_pol_cfg_params_st_::exceed_action
qos_pol_action_params_st exceed_action
Definition: xlate.h:142
qos_pol_cfg_params_st_::rb
union qos_pol_cfg_params_st_::@490 rb
QOS_RATE_INVALID
@ QOS_RATE_INVALID
Definition: xlate.h:66
qos_policer_type_en
enum qos_policer_type_en_ qos_policer_type_en
qos_pol_cfg_params_st
struct qos_pol_cfg_params_st_ qos_pol_cfg_params_st
qos_pol_cfg_params_st_::eb_ms
u64 eb_ms
Definition: xlate.h:131
qos_pol_cfg_params_st_::current_bucket
u32 current_bucket
Definition: xlate.h:139
qos_pol_cfg_params_st_::cb_ms
u64 cb_ms
Definition: xlate.h:130
qos_pol_cfg_params_st_::rnd_type
qos_round_type_en rnd_type
Definition: xlate.h:135
qos_pol_cfg_params_st_::violate_action
qos_pol_action_params_st violate_action
Definition: xlate.h:143
qos_pol_hw_params_st_::extd_bkt_limit_exp
u8 extd_bkt_limit_exp
Definition: xlate.h:155
u64
unsigned long u64
Definition: types.h:89
police.h
u32
unsigned int u32
Definition: types.h:88
qos_pol_cfg_params_st_::rate_type
qos_rate_type_en rate_type
Definition: xlate.h:134
qos_pol_cfg_params_st_::eir_pps
u32 eir_pps
Definition: xlate.h:129
QOS_ROUND_TO_UP
@ QOS_ROUND_TO_UP
Definition: xlate.h:47
QOS_ROUND_TO_CLOSEST
@ QOS_ROUND_TO_CLOSEST
Definition: xlate.h:46
qos_pol_cfg_params_st_::overwrite_bucket
u8 overwrite_bucket
Definition: xlate.h:138
QOS_POLICER_TYPE_MAX
@ QOS_POLICER_TYPE_MAX
Definition: xlate.h:37
qos_pol_hw_params_st_::rate_exp
u8 rate_exp
Definition: xlate.h:150
qos_pol_hw_params_st_::comm_bkt_limit_exp
u8 comm_bkt_limit_exp
Definition: xlate.h:153
qos_pol_hw_params_st_::comm_bkt_limit_man
u8 comm_bkt_limit_man
Definition: xlate.h:154
u8
unsigned char u8
Definition: types.h:56
qos_pol_hw_params_st_::rfc
u8 rfc
Definition: xlate.h:148
QOS_RATE_PPS
@ QOS_RATE_PPS
Definition: xlate.h:65
qos_pol_cfg_params_st_::kbps
struct qos_pol_cfg_params_st_::@490::@491 kbps
qos_pol_action_params_st_::action_type
qos_action_type_en action_type
Definition: xlate.h:80
qos_pol_cfg_params_st_::eb_bytes
u64 eb_bytes
Definition: xlate.h:124
qos_pol_cfg_params_st_::cir_pps
u32 cir_pps
Definition: xlate.h:128
qos_pol_cfg_params_st_::cb_bytes
u64 cb_bytes
Definition: xlate.h:123
QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1
@ QOS_POLICER_TYPE_2R3C_RFC_MEF5CF1
Definition: xlate.h:36
qos_policer_type_en_
qos_policer_type_en_
Definition: xlate.h:30
qos_pol_hw_params_st_
Definition: xlate.h:146
qos_pol_hw_params_st_::comm_bkt
u32 comm_bkt
Definition: xlate.h:157
qos_pol_hw_params_st_::allow_negative
u8 allow_negative
Definition: xlate.h:149