Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/ixgbe_dcb.c
Show All 39 Lines | |||||
#include "ixgbe_dcb_82599.h" | #include "ixgbe_dcb_82599.h" | ||||
/** | /** | ||||
* ixgbe_dcb_calculate_tc_credits - This calculates the ieee traffic class | * ixgbe_dcb_calculate_tc_credits - This calculates the ieee traffic class | ||||
* credits from the configured bandwidth percentages. Credits | * credits from the configured bandwidth percentages. Credits | ||||
* are the smallest unit programmable into the underlying | * are the smallest unit programmable into the underlying | ||||
* hardware. The IEEE 802.1Qaz specification do not use bandwidth | * hardware. The IEEE 802.1Qaz specification do not use bandwidth | ||||
* groups so this is much simplified from the CEE case. | * groups so this is much simplified from the CEE case. | ||||
* @bw: bandwidth index by traffic class | |||||
* @refill: refill credits index by traffic class | |||||
* @max: max credits by traffic class | |||||
* @max_frame_size: maximum frame size | |||||
*/ | */ | ||||
s32 ixgbe_dcb_calculate_tc_credits(u8 *bw, u16 *refill, u16 *max, | s32 ixgbe_dcb_calculate_tc_credits(u8 *bw, u16 *refill, u16 *max, | ||||
int max_frame_size) | int max_frame_size) | ||||
{ | { | ||||
int min_percent = 100; | int min_percent = 100; | ||||
int min_credit, multiplier; | int min_credit, multiplier; | ||||
int i; | int i; | ||||
Show All 18 Lines | for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { | ||||
max[i] = bw[i] ? (bw[i]*IXGBE_DCB_MAX_CREDIT)/100 : min_credit; | max[i] = bw[i] ? (bw[i]*IXGBE_DCB_MAX_CREDIT)/100 : min_credit; | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_dcb_calculate_tc_credits_cee - Calculates traffic class credits | * ixgbe_dcb_calculate_tc_credits_cee - Calculates traffic class credits | ||||
* @ixgbe_dcb_config: Struct containing DCB settings. | * @hw: pointer to hardware structure | ||||
* @direction: Configuring either Tx or Rx. | * @dcb_config: Struct containing DCB settings | ||||
* @max_frame_size: Maximum frame size | |||||
* @direction: Configuring either Tx or Rx | |||||
* | * | ||||
* This function calculates the credits allocated to each traffic class. | * This function calculates the credits allocated to each traffic class. | ||||
* It should be called only after the rules are checked by | * It should be called only after the rules are checked by | ||||
* ixgbe_dcb_check_config_cee(). | * ixgbe_dcb_check_config_cee(). | ||||
*/ | */ | ||||
s32 ixgbe_dcb_calculate_tc_credits_cee(struct ixgbe_hw *hw, | s32 ixgbe_dcb_calculate_tc_credits_cee(struct ixgbe_hw *hw, | ||||
struct ixgbe_dcb_config *dcb_config, | struct ixgbe_dcb_config *dcb_config, | ||||
u32 max_frame_size, u8 direction) | u32 max_frame_size, u8 direction) | ||||
▲ Show 20 Lines • Show All 663 Lines • Show Last 20 Lines |