FreeBSD kernel IXGBE device code
ixgbe_dcb.c File Reference
#include "ixgbe_type.h"
#include "ixgbe_dcb.h"
#include "ixgbe_dcb_82598.h"
#include "ixgbe_dcb_82599.h"
Include dependency graph for ixgbe_dcb.c:

Go to the source code of this file.

Functions

s32 ixgbe_dcb_calculate_tc_credits (u8 *bw, u16 *refill, u16 *max, int max_frame_size)
 
s32 ixgbe_dcb_calculate_tc_credits_cee (struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config, u32 max_frame_size, u8 direction)
 
void ixgbe_dcb_unpack_pfc_cee (struct ixgbe_dcb_config *cfg, u8 *map, u8 *pfc_up)
 
void ixgbe_dcb_unpack_refill_cee (struct ixgbe_dcb_config *cfg, int direction, u16 *refill)
 
void ixgbe_dcb_unpack_max_cee (struct ixgbe_dcb_config *cfg, u16 *max)
 
void ixgbe_dcb_unpack_bwgid_cee (struct ixgbe_dcb_config *cfg, int direction, u8 *bwgid)
 
void ixgbe_dcb_unpack_tsa_cee (struct ixgbe_dcb_config *cfg, int direction, u8 *tsa)
 
u8 ixgbe_dcb_get_tc_from_up (struct ixgbe_dcb_config *cfg, int direction, u8 up)
 
void ixgbe_dcb_unpack_map_cee (struct ixgbe_dcb_config *cfg, int direction, u8 *map)
 
s32 ixgbe_dcb_check_config_cee (struct ixgbe_dcb_config *dcb_config)
 
s32 ixgbe_dcb_get_tc_stats (struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
 
s32 ixgbe_dcb_get_pfc_stats (struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats, u8 tc_count)
 
s32 ixgbe_dcb_config_rx_arbiter_cee (struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
 
s32 ixgbe_dcb_config_tx_desc_arbiter_cee (struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
 
s32 ixgbe_dcb_config_tx_data_arbiter_cee (struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
 
s32 ixgbe_dcb_config_pfc_cee (struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config)
 
s32 ixgbe_dcb_config_tc_stats (struct ixgbe_hw *hw)
 
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)
 

Function Documentation

◆ ixgbe_dcb_calculate_tc_credits()

s32 ixgbe_dcb_calculate_tc_credits ( u8 bw,
u16 refill,
u16 max,
int  max_frame_size 
)

ixgbe_dcb_calculate_tc_credits - This calculates the ieee traffic class credits from the configured bandwidth percentages. Credits are the smallest unit programmable into the underlying hardware. The IEEE 802.1Qaz specification do not use bandwidth 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

Definition at line 53 of file ixgbe_dcb.c.

References IXGBE_DCB_CREDIT_QUANTUM, IXGBE_DCB_MAX_CREDIT, IXGBE_DCB_MAX_CREDIT_REFILL, IXGBE_DCB_MAX_TRAFFIC_CLASS, and max_frame_size.

◆ ixgbe_dcb_calculate_tc_credits_cee()

s32 ixgbe_dcb_calculate_tc_credits_cee ( struct ixgbe_hw hw,
struct ixgbe_dcb_config dcb_config,
u32  max_frame_size,
u8  direction 
)

ixgbe_dcb_calculate_tc_credits_cee - Calculates traffic class credits @hw: pointer to hardware structure @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. It should be called only after the rules are checked by ixgbe_dcb_check_config_cee().

Definition at line 95 of file ixgbe_dcb.c.

References ixgbe_dcb_config::bw_percentage, ixgbe_dcb_tc_path::bwg_id, ixgbe_dcb_tc_path::bwg_percent, ixgbe_dcb_tc_path::data_credits_max, ixgbe_dcb_tc_path::data_credits_refill, ixgbe_dcb_tc_config::desc_credits_max, IXGBE_DCB_CREDIT_QUANTUM, IXGBE_DCB_MAX_CREDIT, IXGBE_DCB_MAX_CREDIT_REFILL, IXGBE_DCB_MAX_TRAFFIC_CLASS, IXGBE_DCB_MIN_TSO_CREDIT, IXGBE_DCB_TX_CONFIG, IXGBE_ERR_CONFIG, ixgbe_mac_82598EB, IXGBE_SUCCESS, ixgbe_dcb_tc_path::link_percent, ixgbe_hw::mac, max_frame_size, ixgbe_dcb_tc_config::path, ixgbe_dcb_config::tc_config, and ixgbe_mac_info::type.

◆ ixgbe_dcb_check_config_cee()

s32 ixgbe_dcb_check_config_cee ( struct ixgbe_dcb_config dcb_config)

ixgbe_dcb_config - Struct containing DCB settings. @dcb_config: Pointer to DCB config structure

This function checks DCB rules for DCB settings. The following rules are checked:

  1. The sum of bandwidth percentages of all Bandwidth Groups must total 100%.
  2. The sum of bandwidth percentages of all Traffic Classes within a Bandwidth Group must total 100.
  3. A Traffic Class should not be set to both Link Strict Priority and Group Strict Priority.
  4. Link strict Bandwidth Groups can only have link strict traffic classes with zero bandwidth.

Definition at line 310 of file ixgbe_dcb.c.

References ixgbe_dcb_config::bw_percentage, ixgbe_dcb_tc_path::bwg_id, ixgbe_dcb_tc_path::bwg_percent, DEBUGOUT2, IXGBE_DCB_BW_PERCENT, IXGBE_DCB_MAX_BW_GROUP, IXGBE_DCB_MAX_TRAFFIC_CLASS, ixgbe_dcb_tsa_strict, IXGBE_DCB_TX_CONFIG, IXGBE_ERR_CONFIG, IXGBE_SUCCESS, ixgbe_dcb_tc_config::path, ixgbe_dcb_config::tc_config, and ixgbe_dcb_tc_path::tsa.

◆ ixgbe_dcb_config_pfc()

s32 ixgbe_dcb_config_pfc ( struct ixgbe_hw hw,
u8  pfc_en,
u8 map 
)

Definition at line 692 of file ixgbe_dcb.c.

References ixgbe_dcb_config_pfc_82598(), ixgbe_dcb_config_pfc_82599(), IXGBE_ERR_PARAM, ixgbe_mac_82598EB, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, ixgbe_hw::mac, and ixgbe_mac_info::type.

Referenced by ixgbe_dcb_hw_config_cee().

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

◆ ixgbe_dcb_config_pfc_cee()

s32 ixgbe_dcb_config_pfc_cee ( struct ixgbe_hw hw,
struct ixgbe_dcb_config dcb_config 
)

ixgbe_dcb_config_pfc_cee - Config priority flow control @hw: pointer to hardware structure @dcb_config: pointer to ixgbe_dcb_config structure

Configure Priority Flow Control for each traffic class.

Definition at line 580 of file ixgbe_dcb.c.

References ixgbe_dcb_config_pfc_82598(), ixgbe_dcb_config_pfc_82599(), IXGBE_DCB_MAX_USER_PRIORITY, IXGBE_DCB_TX_CONFIG, ixgbe_dcb_unpack_map_cee(), ixgbe_dcb_unpack_pfc_cee(), ixgbe_mac_82598EB, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, IXGBE_NOT_IMPLEMENTED, ixgbe_hw::mac, and ixgbe_mac_info::type.

Here is the call graph for this function:

◆ ixgbe_dcb_config_rx_arbiter_cee()

s32 ixgbe_dcb_config_rx_arbiter_cee ( struct ixgbe_hw hw,
struct ixgbe_dcb_config dcb_config 
)

◆ ixgbe_dcb_config_tc_stats()

s32 ixgbe_dcb_config_tc_stats ( struct ixgbe_hw hw)

ixgbe_dcb_config_tc_stats - Config traffic class statistics @hw: pointer to hardware structure

Configure queue statistics registers, all queues belonging to same traffic class uses a single set of queue statistics counters.

Definition at line 614 of file ixgbe_dcb.c.

References ixgbe_dcb_config_tc_stats_82598(), ixgbe_dcb_config_tc_stats_82599(), ixgbe_mac_82598EB, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, IXGBE_NOT_IMPLEMENTED, ixgbe_hw::mac, and ixgbe_mac_info::type.

Here is the call graph for this function:

◆ ixgbe_dcb_config_tx_data_arbiter_cee()

s32 ixgbe_dcb_config_tx_data_arbiter_cee ( struct ixgbe_hw hw,
struct ixgbe_dcb_config dcb_config 
)

◆ ixgbe_dcb_config_tx_desc_arbiter_cee()

s32 ixgbe_dcb_config_tx_desc_arbiter_cee ( struct ixgbe_hw hw,
struct ixgbe_dcb_config dcb_config 
)

ixgbe_dcb_config_tx_desc_arbiter_cee - Config Tx Desc arbiter @hw: pointer to hardware structure @dcb_config: pointer to ixgbe_dcb_config structure

Configure Tx Descriptor Arbiter and credits for each traffic class.

Definition at line 497 of file ixgbe_dcb.c.

References ixgbe_dcb_config_tx_desc_arbiter_82598(), ixgbe_dcb_config_tx_desc_arbiter_82599(), IXGBE_DCB_MAX_TRAFFIC_CLASS, IXGBE_DCB_TX_CONFIG, ixgbe_dcb_unpack_bwgid_cee(), ixgbe_dcb_unpack_max_cee(), ixgbe_dcb_unpack_refill_cee(), ixgbe_dcb_unpack_tsa_cee(), ixgbe_mac_82598EB, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, IXGBE_NOT_IMPLEMENTED, ixgbe_hw::mac, ixgbe_dcb_tc_path::tsa, and ixgbe_mac_info::type.

Here is the call graph for this function:

◆ ixgbe_dcb_get_pfc_stats()

s32 ixgbe_dcb_get_pfc_stats ( struct ixgbe_hw hw,
struct ixgbe_hw_stats stats,
u8  tc_count 
)

ixgbe_dcb_get_pfc_stats - Returns CBFC status of each traffic class @hw: pointer to hardware structure @stats: pointer to statistics structure @tc_count: Number of elements in bwg_array.

This function returns the CBFC status data for each of the Traffic Classes.

Definition at line 428 of file ixgbe_dcb.c.

References ixgbe_dcb_get_pfc_stats_82598(), ixgbe_dcb_get_pfc_stats_82599(), ixgbe_mac_82598EB, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, IXGBE_NOT_IMPLEMENTED, ixgbe_hw::mac, and ixgbe_mac_info::type.

Here is the call graph for this function:

◆ ixgbe_dcb_get_tc_from_up()

u8 ixgbe_dcb_get_tc_from_up ( struct ixgbe_dcb_config cfg,
int  direction,
u8  up 
)

Definition at line 264 of file ixgbe_dcb.c.

References ixgbe_dcb_config::num_tcs, ixgbe_dcb_tc_config::path, ixgbe_dcb_num_tcs::pg_tcs, ixgbe_dcb_tc_config::tc, and ixgbe_dcb_config::tc_config.

Referenced by ixgbe_dcb_unpack_map_cee().

Here is the caller graph for this function:

◆ ixgbe_dcb_get_tc_stats()

s32 ixgbe_dcb_get_tc_stats ( struct ixgbe_hw hw,
struct ixgbe_hw_stats stats,
u8  tc_count 
)

ixgbe_dcb_get_tc_stats - Returns status of each traffic class @hw: pointer to hardware structure @stats: pointer to statistics structure @tc_count: Number of elements in bwg_array.

This function returns the status data for each of the Traffic Classes in use.

Definition at line 399 of file ixgbe_dcb.c.

References ixgbe_dcb_get_tc_stats_82598(), ixgbe_dcb_get_tc_stats_82599(), ixgbe_mac_82598EB, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, IXGBE_NOT_IMPLEMENTED, ixgbe_hw::mac, and ixgbe_mac_info::type.

Here is the call graph for this function:

◆ ixgbe_dcb_hw_config()

◆ ixgbe_dcb_hw_config_cee()

◆ ixgbe_dcb_unpack_bwgid_cee()

void ixgbe_dcb_unpack_bwgid_cee ( struct ixgbe_dcb_config cfg,
int  direction,
u8 bwgid 
)

◆ ixgbe_dcb_unpack_map_cee()

void ixgbe_dcb_unpack_map_cee ( struct ixgbe_dcb_config cfg,
int  direction,
u8 map 
)

Definition at line 287 of file ixgbe_dcb.c.

References ixgbe_dcb_get_tc_from_up(), and IXGBE_DCB_MAX_USER_PRIORITY.

Referenced by ixgbe_dcb_config_pfc_cee(), ixgbe_dcb_config_rx_arbiter_cee(), ixgbe_dcb_config_tx_data_arbiter_cee(), and ixgbe_dcb_hw_config_cee().

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

◆ ixgbe_dcb_unpack_max_cee()

◆ ixgbe_dcb_unpack_pfc_cee()

void ixgbe_dcb_unpack_pfc_cee ( struct ixgbe_dcb_config cfg,
u8 map,
u8 pfc_up 
)

ixgbe_dcb_unpack_pfc_cee - Unpack dcb_config PFC info @cfg: dcb configuration to unpack into hardware consumable fields @map: user priority to traffic class map @pfc_up: u8 to store user priority PFC bitmask

This unpacks the dcb configuration PFC info which is stored per traffic class into a 8bit user priority bitmask that can be consumed by hardware routines. The priority to tc map must be updated before calling this routine to use current up-to maps.

Definition at line 210 of file ixgbe_dcb.c.

References IXGBE_DCB_MAX_USER_PRIORITY, ixgbe_dcb_pfc_disabled, ixgbe_dcb_tc_config::pfc, and ixgbe_dcb_config::tc_config.

Referenced by ixgbe_dcb_config_pfc_cee(), and ixgbe_dcb_hw_config_cee().

Here is the caller graph for this function:

◆ ixgbe_dcb_unpack_refill_cee()

void ixgbe_dcb_unpack_refill_cee ( struct ixgbe_dcb_config cfg,
int  direction,
u16 refill 
)

◆ ixgbe_dcb_unpack_tsa_cee()

void ixgbe_dcb_unpack_tsa_cee ( struct ixgbe_dcb_config cfg,
int  direction,
u8 tsa 
)