56 int min_percent = 100;
57 int min_credit, multiplier;
64 if (bw[i] < min_percent && bw[i])
68 multiplier = (min_credit / min_percent) + 1;
100 u32 min_multiplier = 0;
101 u16 min_percent = 100;
105 u32 credit_refill = 0;
107 u16 link_percentage = 0;
111 if (dcb_config == NULL) {
125 link_percentage = (link_percentage * bw_percent) / 100;
127 if (link_percentage && link_percentage < min_percent)
128 min_percent = link_percentage;
139 min_multiplier = (min_credit / min_percent) + 1;
148 link_percentage = (link_percentage * bw_percent) / 100;
156 credit_refill = min(link_percentage * min_multiplier,
160 if (credit_refill < min_credit)
161 credit_refill = min_credit;
173 if (credit_max < min_credit)
174 credit_max = min_credit;
183 if (credit_max && (credit_max <
232 refill[
tc] = tc_config[
tc].
path[direction].data_credits_refill;
251 bwgid[
tc] = tc_config[
tc].
path[direction].bwg_id;
261 tsa[
tc] = tc_config[
tc].
path[direction].tsa;
267 u8 prio_mask = 1 << up;
280 if (prio_mask & tc_config[
tc].
path[direction].up_to_tc_bitmap)
314 u8 i, j, bw = 0, bw_id;
318 memset(bw_sum, 0,
sizeof(bw_sum));
319 memset(link_strict, 0,
sizeof(link_strict));
322 for (i = 0; i < 2; i++) {
335 link_strict[i][bw_id] =
true;
349 bw_sum[i][bw_id] += bw;
362 if (link_strict[i][j]) {
385 DEBUGOUT2(
"DCB error code %d while checking %s settings.\n",
665 refill, max, bwgid,
tsa);
s32 ixgbe_dcb_hw_config_cee(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *hw, u8 pfc_en, u8 *map)
s32 ixgbe_dcb_hw_config(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa, u8 *map)
void ixgbe_dcb_unpack_bwgid_cee(struct ixgbe_dcb_config *cfg, int direction, u8 *bwgid)
s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
s32 ixgbe_dcb_config_pfc_cee(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
u8 ixgbe_dcb_get_tc_from_up(struct ixgbe_dcb_config *cfg, int direction, u8 up)
s32 ixgbe_dcb_calculate_tc_credits_cee(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config, u32 max_frame_size, u8 direction)
s32 ixgbe_dcb_check_config_cee(struct ixgbe_dcb_config *dcb_config)
s32 ixgbe_dcb_config_rx_arbiter_cee(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
void ixgbe_dcb_unpack_pfc_cee(struct ixgbe_dcb_config *cfg, u8 *map, u8 *pfc_up)
void ixgbe_dcb_unpack_map_cee(struct ixgbe_dcb_config *cfg, int direction, u8 *map)
s32 ixgbe_dcb_config_tx_data_arbiter_cee(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
void ixgbe_dcb_unpack_refill_cee(struct ixgbe_dcb_config *cfg, int direction, u16 *refill)
void ixgbe_dcb_unpack_tsa_cee(struct ixgbe_dcb_config *cfg, int direction, u8 *tsa)
s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *hw)
s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
s32 ixgbe_dcb_config_tx_desc_arbiter_cee(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
void ixgbe_dcb_unpack_max_cee(struct ixgbe_dcb_config *cfg, u16 *max)
s32 ixgbe_dcb_calculate_tc_credits(u8 *bw, u16 *refill, u16 *max, int max_frame_size)
#define IXGBE_DCB_MAX_USER_PRIORITY
#define IXGBE_DCB_CREDIT_QUANTUM
#define IXGBE_DCB_MAX_CREDIT
#define IXGBE_DCB_TX_CONFIG
#define IXGBE_DCB_BW_PERCENT
#define IXGBE_DCB_MAX_BW_GROUP
#define IXGBE_DCB_MIN_TSO_CREDIT
#define IXGBE_DCB_MAX_CREDIT_REFILL
s32 ixgbe_dcb_config_rx_arbiter_82598(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *tsa)
s32 ixgbe_dcb_get_pfc_stats_82598(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
s32 ixgbe_dcb_config_tc_stats_82598(struct ixgbe_hw *hw)
s32 ixgbe_dcb_hw_config_82598(struct ixgbe_hw *hw, int link_speed, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa)
s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *hw, u8 pfc_en)
s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa)
s32 ixgbe_dcb_config_tx_data_arbiter_82598(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa)
s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa)
s32 ixgbe_dcb_config_tc_stats_82599(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
s32 ixgbe_dcb_config_82599(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
s32 ixgbe_dcb_hw_config_82599(struct ixgbe_hw *hw, int link_speed, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa, u8 *map)
s32 ixgbe_dcb_get_tc_stats_82599(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
s32 ixgbe_dcb_get_pfc_stats_82599(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
s32 ixgbe_dcb_config_tx_data_arbiter_82599(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa, u8 *map)
s32 ixgbe_dcb_config_rx_arbiter_82599(struct ixgbe_hw *hw, u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa, u8 *map)
s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, u8 pfc_en, u8 *map)
#define DEBUGOUT2(S, A, B)
#define IXGBE_DCB_MAX_TRAFFIC_CLASS
#define IXGBE_NOT_IMPLEMENTED
u8 bw_percentage[2][IXGBE_DCB_MAX_BW_GROUP]
struct ixgbe_dcb_tc_config tc_config[IXGBE_DCB_MAX_TRAFFIC_CLASS]
enum ixgbe_dcb_pba rx_pba_cfg
struct ixgbe_dcb_num_tcs num_tcs
struct ixgbe_dcb_tc_path path[2]
struct ixgbe_mac_info mac
struct ixgbe_mac_operations ops
void(* setup_rxpba)(struct ixgbe_hw *, int, u32, int)