FD.io VPP  v16.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/policer/fix_types.h>
24 #include <vnet/policer/police.h>
25 
26 /*
27  * edt: * enum sse2_qos_policer_type_en
28  * Defines type of policer to be allocated
29  */
38 
39 /*
40  * edt: * enum
41  * Enum used to define type of rounding used when calculating policer values
42  */
43 typedef enum {
49 
50 /*
51  * edt: * enum
52  * Enum used to define type of rate for configuration, either pps or kbps.
53  * If kbps, then burst is in bytes, if pps, then burst is in ms.
54  *
55  * Default of zero is kbps, which is inline with how it is programmed
56  * in actual hardware. However, the warning is that this is reverse logic
57  * of units_in_bits field in sse2_static_policer_parameters_st, which is
58  * inline with sse_punt_drop.h.
59  */
60 typedef enum {
65 
66 /*
67  * edt: * struct sse2_qos_pol_cfg_params_st
68  *
69  * Description:
70  * This structure is used to hold user configured policing parameters.
71  *
72  * element: cir_kbps
73  * CIR in kbps.
74  * element: eir_kbps
75  * EIR or PIR in kbps.
76  * element: cb_bytes
77  * Committed Burst in bytes.
78  * element: eb_bytes
79  * Excess or Peak Burst in bytes.
80  * element: cir_pps
81  * CIR in pps.
82  * element: eir_pps
83  * EIR or PIR in pps.
84  * element: cb_ms
85  * Committed Burst in milliseconds.
86  * element: eb_ms
87  * Excess or Peak Burst in milliseconds.
88  * element: rate_type
89  * Indicates the union if in kbps/bytes or pps/ms.
90  * element: rfc
91  * Policer algorithm - 1R2C, 1R3C (2697), 2R3C (2698) or 2R3C (4115). See
92  * sse_qos_policer_type_en
93  * element: rnd_type
94  * Rounding type (see sse_qos_round_type_en). Needed when policer values
95  * need to be rounded. Caller can decide on type of rounding used
96  */
98  union {
99  struct {
102  uint64_t cb_bytes;
103  uint64_t eb_bytes;
104  } PACKED kbps;
105  struct {
108  uint64_t cb_ms;
109  uint64_t eb_ms;
110  } PACKED pps;
111  } PACKED rb; /* rate burst config */
112  uint8_t rate_type; /* sse2_qos_rate_type_en */
113  uint8_t rnd_type; /* sse2_qos_round_type_en */
114  uint8_t rfc; /* sse2_qos_policer_type_en */
115  uint8_t overwrite_bucket; /* for debugging purposes */
116  uint32_t current_bucket; /* for debugging purposes */
117  uint32_t extended_bucket; /* for debugging purposes */
119 
120 
134 
135 
139 
140 
141 #endif /* __included_xlate_h__ */
unsigned int uint32_t
Definition: fix_types.h:29
struct sse2_qos_pol_hw_params_st_ sse2_qos_pol_hw_params_st
uint8_t comm_bkt_limit_man
Definition: xlate.h:128
union sse2_qos_pol_cfg_params_st_::@153 rb
#define trans_layer_rc
Definition: fix_types.h:20
uint8_t extd_bkt_limit_exp
Definition: xlate.h:129
unsigned char uint8_t
Definition: fix_types.h:27
uint8_t comm_bkt_limit_exp
Definition: xlate.h:127
sse2_qos_policer_type_en_
Definition: xlate.h:30
enum sse2_qos_policer_type_en_ sse2_qos_policer_type_en
sse2_qos_rate_type_en
Definition: xlate.h:60
unsigned short int uint16_t
Definition: fix_types.h:28
struct sse2_qos_pol_cfg_params_st_::@153::@154 kbps
struct sse2_qos_pol_cfg_params_st_::@153::@155 pps
struct sse2_qos_pol_cfg_params_st_ sse2_qos_pol_cfg_params_st
uint8_t extd_bkt_limit_man
Definition: xlate.h:130
#define PACKED
Definition: fix_types.h:23
trans_layer_rc sse2_pol_logical_2_physical(sse2_qos_pol_cfg_params_st *cfg, policer_read_response_type_st *phys)
Definition: xlate.c:1089
sse2_qos_round_type_en
Definition: xlate.h:43