FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
xlate.c File Reference
+ Include dependency graph for xlate.c:

Go to the source code of this file.

Macros

#define QOS_DEBUG_ERROR(msg, args...)   vlib_log_err (vnet_policer_main.log_class, msg, ##args);
 
#define QOS_DEBUG_INFO(msg, args...)   vlib_log_info (vnet_policer_main.log_class, msg, ##args);
 
#define MIN(x, y)   (((x)<(y))?(x):(y))
 
#define MAX(x, y)   (((x)>(y))?(x):(y))
 
#define IPE_POLICER_FULL_WRITE_REQUEST_M40AH_OFFSET   0
 
#define IPE_POLICER_FULL_WRITE_REQUEST_M40AH_MASK   8
 
#define IPE_POLICER_FULL_WRITE_REQUEST_M40AH_SHIFT   24
 
#define IPE_POLICER_FULL_WRITE_REQUEST_TYPE_OFFSET   2
 
#define IPE_POLICER_FULL_WRITE_REQUEST_TYPE_MASK   2
 
#define IPE_POLICER_FULL_WRITE_REQUEST_TYPE_SHIFT   10
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CMD_OFFSET   3
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CMD_MASK   2
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CMD_SHIFT   0
 
#define IPE_POLICER_FULL_WRITE_REQUEST_M40AL_OFFSET   4
 
#define IPE_POLICER_FULL_WRITE_REQUEST_M40AL_MASK   32
 
#define IPE_POLICER_FULL_WRITE_REQUEST_M40AL_SHIFT   0
 
#define IPE_POLICER_FULL_WRITE_REQUEST_RFC_OFFSET   8
 
#define IPE_POLICER_FULL_WRITE_REQUEST_RFC_MASK   2
 
#define IPE_POLICER_FULL_WRITE_REQUEST_RFC_SHIFT   30
 
#define IPE_POLICER_FULL_WRITE_REQUEST_AN_OFFSET   8
 
#define IPE_POLICER_FULL_WRITE_REQUEST_AN_MASK   1
 
#define IPE_POLICER_FULL_WRITE_REQUEST_AN_SHIFT   29
 
#define IPE_POLICER_FULL_WRITE_REQUEST_REXP_OFFSET   8
 
#define IPE_POLICER_FULL_WRITE_REQUEST_REXP_MASK   4
 
#define IPE_POLICER_FULL_WRITE_REQUEST_REXP_SHIFT   22
 
#define IPE_POLICER_FULL_WRITE_REQUEST_ARM_OFFSET   9
 
#define IPE_POLICER_FULL_WRITE_REQUEST_ARM_MASK   11
 
#define IPE_POLICER_FULL_WRITE_REQUEST_ARM_SHIFT   11
 
#define IPE_POLICER_FULL_WRITE_REQUEST_PRM_OFFSET   10
 
#define IPE_POLICER_FULL_WRITE_REQUEST_PRM_MASK   11
 
#define IPE_POLICER_FULL_WRITE_REQUEST_PRM_SHIFT   0
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CBLE_OFFSET   12
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CBLE_MASK   5
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CBLE_SHIFT   27
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CBLM_OFFSET   12
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CBLM_MASK   7
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CBLM_SHIFT   20
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EBLE_OFFSET   13
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EBLE_MASK   5
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EBLE_SHIFT   15
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EBLM_OFFSET   14
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EBLM_MASK   7
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EBLM_SHIFT   8
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CB_OFFSET   16
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CB_MASK   31
 
#define IPE_POLICER_FULL_WRITE_REQUEST_CB_SHIFT   0
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EB_OFFSET   20
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EB_MASK   31
 
#define IPE_POLICER_FULL_WRITE_REQUEST_EB_SHIFT   0
 
#define IPE_RFC_RFC2697   0x00000000
 
#define IPE_RFC_RFC2698   0x00000001
 
#define IPE_RFC_RFC4115   0x00000002
 
#define IPE_RFC_MEF5CF1   0x00000003
 
#define QOS_POLICER_FIXED_PKT_SIZE   256
 
#define QOS_POL_TICKS_PER_SEC   1000LL /* 1 tick = 1 ms */
 
#define QOS_POL_DEF_BURST_BYTE   100
 
#define QOS_POL_MIN_BURST_BYTE   9 * 1024
 
#define QOS_POL_ALLOW_NEGATIVE   1
 
#define QOS_POL_COMM_BKT_MAX   (1 << IPE_POLICER_FULL_WRITE_REQUEST_CB_MASK)
 
#define QOS_POL_EXTD_BKT_MAX   (1 << IPE_POLICER_FULL_WRITE_REQUEST_EB_MASK)
 
#define QOS_POL_RATE_EXP_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_REXP_MASK)
 
#define QOS_POL_RATE_EXP_MAX   ((1 << QOS_POL_RATE_EXP_SIZE) - 1)
 
#define QOS_POL_AVG_RATE_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_ARM_MASK)
 
#define QOS_POL_AVG_RATE_MANT_MAX   ((1 << QOS_POL_AVG_RATE_MANT_SIZE) - 1)
 
#define QOS_POL_AVG_RATE_MAX   (QOS_POL_AVG_RATE_MANT_MAX << QOS_POL_RATE_EXP_MAX)
 
#define QOS_POL_PEAK_RATE_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_PRM_MASK)
 
#define QOS_POL_PEAK_RATE_MANT_MAX   ((1 << QOS_POL_PEAK_RATE_MANT_SIZE) - 1)
 
#define QOS_POL_PEAK_RATE_MAX   (QOS_POL_PEAK_RATE_MANT_MAX << QOS_POL_RATE_EXP_MAX)
 
#define QOS_POL_COMM_BKT_LIMIT_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_CBLM_MASK)
 
#define QOS_POL_COMM_BKT_LIMIT_MANT_MAX   ((1 << QOS_POL_COMM_BKT_LIMIT_MANT_SIZE) - 1)
 
#define QOS_POL_COMM_BKT_LIMIT_EXP_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_CBLE_MASK)
 
#define QOS_POL_COMM_BKT_LIMIT_EXP_MAX   ((1 << QOS_POL_COMM_BKT_LIMIT_EXP_SIZE) - 1)
 
#define QOS_POL_COMM_BKT_LIMIT_MAX
 
#define QOS_POL_EXTD_BKT_LIMIT_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_EBLM_MASK)
 
#define QOS_POL_EXTD_BKT_LIMIT_MANT_MAX   ((1 << QOS_POL_EXTD_BKT_LIMIT_MANT_SIZE) - 1)
 
#define QOS_POL_EXTD_BKT_LIMIT_EXP_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_EBLE_MASK)
 
#define QOS_POL_EXTD_BKT_LIMIT_EXP_MAX   ((1 << QOS_POL_EXTD_BKT_LIMIT_EXP_SIZE) - 1)
 
#define QOS_POL_EXT_BKT_LIMIT_MAX
 
#define RATE256   (256114688000LL / 8LL / QOS_POL_TICKS_PER_SEC)
 
#define RATE128   (128057344000LL / 8LL / QOS_POL_TICKS_PER_SEC)
 
#define RATE64   (64028672000LL / 8LL / QOS_POL_TICKS_PER_SEC)
 
#define RATE_OVER256_UNIT   8LL
 
#define RATE_128TO256_UNIT   4LL
 
#define RATE_64TO128_UNIT   2LL
 
#define MAX_RATE_SHIFT   10
 

Functions

static int qos_pol_round (u64 numerator, u64 denominator, u64 *rounded_value, qos_round_type_en round_type)
 
static int pol_validate_cfg_params (qos_pol_cfg_params_st *cfg)
 
static void qos_convert_value_to_exp_mant_fmt (u64 value, u16 max_exp_value, u16 max_mant_value, qos_round_type_en type, u8 *exp, u32 *mant)
 
static int pol_convert_cfg_rates_to_hw (qos_pol_cfg_params_st *cfg, qos_pol_hw_params_st *hw)
 
u64 pol_get_bkt_max (u64 rate_hw, u64 bkt_max)
 
u64 pol_get_bkt_value (u64 rate_hw, u64 byte_value)
 
static void pol_rnd_burst_byte_fmt (u64 cfg_burst, u16 max_exp_value, u16 max_mant_value, u32 max_bkt_value, u32 rate_hw, u8 *exp, u32 *mant, u32 *bkt_value)
 
static int pol_convert_cfg_burst_to_hw (qos_pol_cfg_params_st *cfg, qos_pol_hw_params_st *hw)
 
static int pol_convert_cfg_to_hw_params (qos_pol_cfg_params_st *cfg, qos_pol_hw_params_st *hw)
 
u32 qos_convert_pps_to_kbps (u32 rate_pps)
 
u32 qos_convert_burst_ms_to_bytes (u32 burst_ms, u32 rate_kbps)
 
int pol_compute_hw_params (qos_pol_cfg_params_st *cfg, qos_pol_hw_params_st *hw)
 
static u64 get_tsc_hz (void)
 
static int compute_policer_params (u64 hz, u64 cir_rate, u64 pir_rate, u32 *current_limit, u32 *extended_limit, u32 *cir_bytes_per_period, u32 *pir_bytes_per_period, u32 *scale)
 
int x86_pol_compute_hw_params (qos_pol_cfg_params_st *cfg, policer_t *hw)
 
int pol_logical_2_physical (qos_pol_cfg_params_st *cfg, policer_t *phys)
 
static void qos_convert_pol_bucket_to_hw_fmt (policer_t *bkt, qos_pol_hw_params_st *hw_fmt)
 
static int pol_convert_hw_to_cfg_params (qos_pol_hw_params_st *hw, qos_pol_cfg_params_st *cfg)
 
u32 qos_convert_kbps_to_pps (u32 rate_kbps)
 
u32 qos_convert_burst_bytes_to_ms (u64 burst_bytes, u32 rate_kbps)
 
int pol_physical_2_logical (policer_t *phys, qos_pol_cfg_params_st *cfg)
 

Macro Definition Documentation

◆ IPE_POLICER_FULL_WRITE_REQUEST_AN_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_AN_MASK   1

Definition at line 63 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_AN_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_AN_OFFSET   8

Definition at line 62 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_AN_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_AN_SHIFT   29

Definition at line 64 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_ARM_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_ARM_MASK   11

Definition at line 71 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_ARM_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_ARM_OFFSET   9

Definition at line 70 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_ARM_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_ARM_SHIFT   11

Definition at line 72 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CB_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_CB_MASK   31

Definition at line 95 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CB_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_CB_OFFSET   16

Definition at line 94 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CB_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_CB_SHIFT   0

Definition at line 96 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CBLE_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_CBLE_MASK   5

Definition at line 79 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CBLE_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_CBLE_OFFSET   12

Definition at line 78 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CBLE_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_CBLE_SHIFT   27

Definition at line 80 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CBLM_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_CBLM_MASK   7

Definition at line 83 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CBLM_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_CBLM_OFFSET   12

Definition at line 82 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CBLM_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_CBLM_SHIFT   20

Definition at line 84 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CMD_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_CMD_MASK   2

Definition at line 51 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CMD_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_CMD_OFFSET   3

Definition at line 50 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_CMD_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_CMD_SHIFT   0

Definition at line 52 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EB_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_EB_MASK   31

Definition at line 99 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EB_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_EB_OFFSET   20

Definition at line 98 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EB_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_EB_SHIFT   0

Definition at line 100 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EBLE_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_EBLE_MASK   5

Definition at line 87 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EBLE_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_EBLE_OFFSET   13

Definition at line 86 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EBLE_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_EBLE_SHIFT   15

Definition at line 88 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EBLM_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_EBLM_MASK   7

Definition at line 91 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EBLM_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_EBLM_OFFSET   14

Definition at line 90 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_EBLM_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_EBLM_SHIFT   8

Definition at line 92 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_M40AH_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_M40AH_MASK   8

Definition at line 43 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_M40AH_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_M40AH_OFFSET   0

Definition at line 42 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_M40AH_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_M40AH_SHIFT   24

Definition at line 44 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_M40AL_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_M40AL_MASK   32

Definition at line 55 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_M40AL_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_M40AL_OFFSET   4

Definition at line 54 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_M40AL_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_M40AL_SHIFT   0

Definition at line 56 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_PRM_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_PRM_MASK   11

Definition at line 75 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_PRM_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_PRM_OFFSET   10

Definition at line 74 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_PRM_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_PRM_SHIFT   0

Definition at line 76 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_REXP_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_REXP_MASK   4

Definition at line 67 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_REXP_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_REXP_OFFSET   8

Definition at line 66 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_REXP_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_REXP_SHIFT   22

Definition at line 68 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_RFC_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_RFC_MASK   2

Definition at line 59 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_RFC_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_RFC_OFFSET   8

Definition at line 58 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_RFC_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_RFC_SHIFT   30

Definition at line 60 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_TYPE_MASK

#define IPE_POLICER_FULL_WRITE_REQUEST_TYPE_MASK   2

Definition at line 47 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_TYPE_OFFSET

#define IPE_POLICER_FULL_WRITE_REQUEST_TYPE_OFFSET   2

Definition at line 46 of file xlate.c.

◆ IPE_POLICER_FULL_WRITE_REQUEST_TYPE_SHIFT

#define IPE_POLICER_FULL_WRITE_REQUEST_TYPE_SHIFT   10

Definition at line 48 of file xlate.c.

◆ IPE_RFC_MEF5CF1

#define IPE_RFC_MEF5CF1   0x00000003

Definition at line 105 of file xlate.c.

◆ IPE_RFC_RFC2697

#define IPE_RFC_RFC2697   0x00000000

Definition at line 102 of file xlate.c.

◆ IPE_RFC_RFC2698

#define IPE_RFC_RFC2698   0x00000001

Definition at line 103 of file xlate.c.

◆ IPE_RFC_RFC4115

#define IPE_RFC_RFC4115   0x00000002

Definition at line 104 of file xlate.c.

◆ MAX

#define MAX (   x,
 
)    (((x)>(y))?(x):(y))

Definition at line 39 of file xlate.c.

◆ MAX_RATE_SHIFT

#define MAX_RATE_SHIFT   10

◆ MIN

#define MIN (   x,
 
)    (((x)<(y))?(x):(y))

Definition at line 35 of file xlate.c.

◆ QOS_DEBUG_ERROR

#define QOS_DEBUG_ERROR (   msg,
  args... 
)    vlib_log_err (vnet_policer_main.log_class, msg, ##args);

Definition at line 28 of file xlate.c.

◆ QOS_DEBUG_INFO

#define QOS_DEBUG_INFO (   msg,
  args... 
)    vlib_log_info (vnet_policer_main.log_class, msg, ##args);

Definition at line 31 of file xlate.c.

◆ QOS_POL_ALLOW_NEGATIVE

#define QOS_POL_ALLOW_NEGATIVE   1

Definition at line 128 of file xlate.c.

◆ QOS_POL_AVG_RATE_MANT_MAX

#define QOS_POL_AVG_RATE_MANT_MAX   ((1 << QOS_POL_AVG_RATE_MANT_SIZE) - 1)

Definition at line 138 of file xlate.c.

◆ QOS_POL_AVG_RATE_MANT_SIZE

#define QOS_POL_AVG_RATE_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_ARM_MASK)

Definition at line 137 of file xlate.c.

◆ QOS_POL_AVG_RATE_MAX

#define QOS_POL_AVG_RATE_MAX   (QOS_POL_AVG_RATE_MANT_MAX << QOS_POL_RATE_EXP_MAX)

Definition at line 139 of file xlate.c.

◆ QOS_POL_COMM_BKT_LIMIT_EXP_MAX

#define QOS_POL_COMM_BKT_LIMIT_EXP_MAX   ((1 << QOS_POL_COMM_BKT_LIMIT_EXP_SIZE) - 1)

Definition at line 153 of file xlate.c.

◆ QOS_POL_COMM_BKT_LIMIT_EXP_SIZE

#define QOS_POL_COMM_BKT_LIMIT_EXP_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_CBLE_MASK)

Definition at line 151 of file xlate.c.

◆ QOS_POL_COMM_BKT_LIMIT_MANT_MAX

#define QOS_POL_COMM_BKT_LIMIT_MANT_MAX   ((1 << QOS_POL_COMM_BKT_LIMIT_MANT_SIZE) - 1)

Definition at line 149 of file xlate.c.

◆ QOS_POL_COMM_BKT_LIMIT_MANT_SIZE

#define QOS_POL_COMM_BKT_LIMIT_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_CBLM_MASK)

Definition at line 147 of file xlate.c.

◆ QOS_POL_COMM_BKT_LIMIT_MAX

#define QOS_POL_COMM_BKT_LIMIT_MAX
Value:

Definition at line 155 of file xlate.c.

◆ QOS_POL_COMM_BKT_MAX

#define QOS_POL_COMM_BKT_MAX   (1 << IPE_POLICER_FULL_WRITE_REQUEST_CB_MASK)

Definition at line 132 of file xlate.c.

◆ QOS_POL_DEF_BURST_BYTE

#define QOS_POL_DEF_BURST_BYTE   100

Definition at line 117 of file xlate.c.

◆ QOS_POL_EXT_BKT_LIMIT_MAX

#define QOS_POL_EXT_BKT_LIMIT_MAX
Value:

Definition at line 167 of file xlate.c.

◆ QOS_POL_EXTD_BKT_LIMIT_EXP_MAX

#define QOS_POL_EXTD_BKT_LIMIT_EXP_MAX   ((1 << QOS_POL_EXTD_BKT_LIMIT_EXP_SIZE) - 1)

Definition at line 165 of file xlate.c.

◆ QOS_POL_EXTD_BKT_LIMIT_EXP_SIZE

#define QOS_POL_EXTD_BKT_LIMIT_EXP_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_EBLE_MASK)

Definition at line 163 of file xlate.c.

◆ QOS_POL_EXTD_BKT_LIMIT_MANT_MAX

#define QOS_POL_EXTD_BKT_LIMIT_MANT_MAX   ((1 << QOS_POL_EXTD_BKT_LIMIT_MANT_SIZE) - 1)

Definition at line 161 of file xlate.c.

◆ QOS_POL_EXTD_BKT_LIMIT_MANT_SIZE

#define QOS_POL_EXTD_BKT_LIMIT_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_EBLM_MASK)

Definition at line 159 of file xlate.c.

◆ QOS_POL_EXTD_BKT_MAX

#define QOS_POL_EXTD_BKT_MAX   (1 << IPE_POLICER_FULL_WRITE_REQUEST_EB_MASK)

Definition at line 133 of file xlate.c.

◆ QOS_POL_MIN_BURST_BYTE

#define QOS_POL_MIN_BURST_BYTE   9 * 1024

Definition at line 122 of file xlate.c.

◆ QOS_POL_PEAK_RATE_MANT_MAX

#define QOS_POL_PEAK_RATE_MANT_MAX   ((1 << QOS_POL_PEAK_RATE_MANT_SIZE) - 1)

Definition at line 143 of file xlate.c.

◆ QOS_POL_PEAK_RATE_MANT_SIZE

#define QOS_POL_PEAK_RATE_MANT_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_PRM_MASK)

Definition at line 142 of file xlate.c.

◆ QOS_POL_PEAK_RATE_MAX

#define QOS_POL_PEAK_RATE_MAX   (QOS_POL_PEAK_RATE_MANT_MAX << QOS_POL_RATE_EXP_MAX)

Definition at line 144 of file xlate.c.

◆ QOS_POL_RATE_EXP_MAX

#define QOS_POL_RATE_EXP_MAX   ((1 << QOS_POL_RATE_EXP_SIZE) - 1)

Definition at line 136 of file xlate.c.

◆ QOS_POL_RATE_EXP_SIZE

#define QOS_POL_RATE_EXP_SIZE   (IPE_POLICER_FULL_WRITE_REQUEST_REXP_MASK)

Definition at line 135 of file xlate.c.

◆ QOS_POL_TICKS_PER_SEC

#define QOS_POL_TICKS_PER_SEC   1000LL /* 1 tick = 1 ms */

Definition at line 112 of file xlate.c.

◆ QOS_POLICER_FIXED_PKT_SIZE

#define QOS_POLICER_FIXED_PKT_SIZE   256

Definition at line 110 of file xlate.c.

◆ RATE128

#define RATE128   (128057344000LL / 8LL / QOS_POL_TICKS_PER_SEC)

Definition at line 181 of file xlate.c.

◆ RATE256

#define RATE256   (256114688000LL / 8LL / QOS_POL_TICKS_PER_SEC)

Definition at line 180 of file xlate.c.

◆ RATE64

#define RATE64   (64028672000LL / 8LL / QOS_POL_TICKS_PER_SEC)

Definition at line 182 of file xlate.c.

◆ RATE_128TO256_UNIT

#define RATE_128TO256_UNIT   4LL

Definition at line 185 of file xlate.c.

◆ RATE_64TO128_UNIT

#define RATE_64TO128_UNIT   2LL

Definition at line 186 of file xlate.c.

◆ RATE_OVER256_UNIT

#define RATE_OVER256_UNIT   8LL

Definition at line 184 of file xlate.c.

Function Documentation

◆ compute_policer_params()

static int compute_policer_params ( u64  hz,
u64  cir_rate,
u64  pir_rate,
u32 current_limit,
u32 extended_limit,
u32 cir_bytes_per_period,
u32 pir_bytes_per_period,
u32 scale 
)
static

Definition at line 864 of file xlate.c.

+ Here is the caller graph for this function:

◆ get_tsc_hz()

static u64 get_tsc_hz ( void  )
static

Definition at line 851 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pol_compute_hw_params()

int pol_compute_hw_params ( qos_pol_cfg_params_st cfg,
qos_pol_hw_params_st hw 
)

Definition at line 810 of file xlate.c.

+ Here is the call graph for this function:

◆ pol_convert_cfg_burst_to_hw()

static int pol_convert_cfg_burst_to_hw ( qos_pol_cfg_params_st cfg,
qos_pol_hw_params_st hw 
)
static

Definition at line 642 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pol_convert_cfg_rates_to_hw()

static int pol_convert_cfg_rates_to_hw ( qos_pol_cfg_params_st cfg,
qos_pol_hw_params_st hw 
)
static

Definition at line 357 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pol_convert_cfg_to_hw_params()

static int pol_convert_cfg_to_hw_params ( qos_pol_cfg_params_st cfg,
qos_pol_hw_params_st hw 
)
static

Definition at line 728 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pol_convert_hw_to_cfg_params()

static int pol_convert_hw_to_cfg_params ( qos_pol_hw_params_st hw,
qos_pol_cfg_params_st cfg 
)
static

Definition at line 1143 of file xlate.c.

+ Here is the caller graph for this function:

◆ pol_get_bkt_max()

u64 pol_get_bkt_max ( u64  rate_hw,
u64  bkt_max 
)

Definition at line 532 of file xlate.c.

+ Here is the caller graph for this function:

◆ pol_get_bkt_value()

u64 pol_get_bkt_value ( u64  rate_hw,
u64  byte_value 
)

Definition at line 570 of file xlate.c.

+ Here is the caller graph for this function:

◆ pol_logical_2_physical()

int pol_logical_2_physical ( qos_pol_cfg_params_st cfg,
policer_t phys 
)

Definition at line 1061 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pol_physical_2_logical()

int pol_physical_2_logical ( policer_t phys,
qos_pol_cfg_params_st cfg 
)

Definition at line 1261 of file xlate.c.

+ Here is the call graph for this function:

◆ pol_rnd_burst_byte_fmt()

static void pol_rnd_burst_byte_fmt ( u64  cfg_burst,
u16  max_exp_value,
u16  max_mant_value,
u32  max_bkt_value,
u32  rate_hw,
u8 exp,
u32 mant,
u32 bkt_value 
)
static

Definition at line 589 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pol_validate_cfg_params()

static int pol_validate_cfg_params ( qos_pol_cfg_params_st cfg)
static

Definition at line 228 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_convert_burst_bytes_to_ms()

u32 qos_convert_burst_bytes_to_ms ( u64  burst_bytes,
u32  rate_kbps 
)

Definition at line 1243 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_convert_burst_ms_to_bytes()

u32 qos_convert_burst_ms_to_bytes ( u32  burst_ms,
u32  rate_kbps 
)

Definition at line 792 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_convert_kbps_to_pps()

u32 qos_convert_kbps_to_pps ( u32  rate_kbps)

Definition at line 1230 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_convert_pol_bucket_to_hw_fmt()

static void qos_convert_pol_bucket_to_hw_fmt ( policer_t bkt,
qos_pol_hw_params_st hw_fmt 
)
static

Definition at line 1132 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_convert_pps_to_kbps()

u32 qos_convert_pps_to_kbps ( u32  rate_pps)

Definition at line 781 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_convert_value_to_exp_mant_fmt()

static void qos_convert_value_to_exp_mant_fmt ( u64  value,
u16  max_exp_value,
u16  max_mant_value,
qos_round_type_en  type,
u8 exp,
u32 mant 
)
static

Definition at line 313 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qos_pol_round()

static int qos_pol_round ( u64  numerator,
u64  denominator,
u64 rounded_value,
qos_round_type_en  round_type 
)
static

Definition at line 189 of file xlate.c.

+ Here is the caller graph for this function:

◆ x86_pol_compute_hw_params()

int x86_pol_compute_hw_params ( qos_pol_cfg_params_st cfg,
policer_t hw 
)

Definition at line 949 of file xlate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
QOS_POL_EXTD_BKT_LIMIT_EXP_MAX
#define QOS_POL_EXTD_BKT_LIMIT_EXP_MAX
Definition: xlate.c:165
u64
unsigned long u64
Definition: types.h:89
QOS_POL_COMM_BKT_LIMIT_MANT_MAX
#define QOS_POL_COMM_BKT_LIMIT_MANT_MAX
Definition: xlate.c:149
QOS_POL_EXTD_BKT_LIMIT_MANT_MAX
#define QOS_POL_EXTD_BKT_LIMIT_MANT_MAX
Definition: xlate.c:161
QOS_POL_COMM_BKT_LIMIT_EXP_MAX
#define QOS_POL_COMM_BKT_LIMIT_EXP_MAX
Definition: xlate.c:153