FreeBSD kernel IXGBE device code
ixgbe_dcb.h File Reference
#include "ixgbe_type.h"
Include dependency graph for ixgbe_dcb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ixgbe_dcb_support
 
struct  ixgbe_dcb_tc_path
 
struct  ixgbe_dcb_tc_config
 
struct  ixgbe_dcb_num_tcs
 
struct  ixgbe_dcb_config
 

Macros

#define IXGBE_DCB_CREDIT_QUANTUM   64
 
#define IXGBE_DCB_MAX_CREDIT_REFILL   200 /* 200 * 64B = 12800B */
 
#define IXGBE_DCB_MAX_TSO_SIZE   (32 * 1024) /* Max TSO pkt size in DCB*/
 
#define IXGBE_DCB_MAX_CREDIT   (2 * IXGBE_DCB_MAX_CREDIT_REFILL)
 
#define IXGBE_DCB_MIN_TSO_CREDIT    ((IXGBE_DCB_MAX_TSO_SIZE / IXGBE_DCB_CREDIT_QUANTUM) + 1)
 
#define IXGBE_DCB_MAX_USER_PRIORITY   8
 
#define IXGBE_DCB_MAX_BW_GROUP   8
 
#define IXGBE_DCB_BW_PERCENT   100
 
#define IXGBE_DCB_TX_CONFIG   0
 
#define IXGBE_DCB_RX_CONFIG   1
 
#define IXGBE_DCB_PG_SUPPORT   0x00000001
 
#define IXGBE_DCB_PFC_SUPPORT   0x00000002
 
#define IXGBE_DCB_BCN_SUPPORT   0x00000004
 
#define IXGBE_DCB_UP2TC_SUPPORT   0x00000008
 
#define IXGBE_DCB_GSP_SUPPORT   0x00000010
 

Enumerations

enum  ixgbe_dcb_tsa { ixgbe_dcb_tsa_ets = 0 , ixgbe_dcb_tsa_group_strict_cee , ixgbe_dcb_tsa_strict }
 
enum  ixgbe_dcb_pfc { ixgbe_dcb_pfc_disabled = 0 , ixgbe_dcb_pfc_enabled , ixgbe_dcb_pfc_enabled_txonly , ixgbe_dcb_pfc_enabled_rxonly }
 
enum  ixgbe_dcb_pba { ixgbe_dcb_pba_equal = PBA_STRATEGY_EQUAL , ixgbe_dcb_pba_80_48 = PBA_STRATEGY_WEIGHTED }
 

Functions

s32 ixgbe_dcb_check_config_cee (struct ixgbe_dcb_config *)
 
s32 ixgbe_dcb_calculate_tc_credits (u8 *, u16 *, u16 *, int)
 
s32 ixgbe_dcb_calculate_tc_credits_cee (struct ixgbe_hw *, struct ixgbe_dcb_config *, u32, u8)
 
s32 ixgbe_dcb_config_pfc (struct ixgbe_hw *, u8, u8 *)
 
s32 ixgbe_dcb_config_pfc_cee (struct ixgbe_hw *, struct ixgbe_dcb_config *)
 
s32 ixgbe_dcb_config_tc_stats (struct ixgbe_hw *)
 
s32 ixgbe_dcb_get_tc_stats (struct ixgbe_hw *, struct ixgbe_hw_stats *, u8)
 
s32 ixgbe_dcb_get_pfc_stats (struct ixgbe_hw *, struct ixgbe_hw_stats *, u8)
 
s32 ixgbe_dcb_config_tx_desc_arbiter_cee (struct ixgbe_hw *, struct ixgbe_dcb_config *)
 
s32 ixgbe_dcb_config_tx_data_arbiter_cee (struct ixgbe_hw *, struct ixgbe_dcb_config *)
 
s32 ixgbe_dcb_config_rx_arbiter_cee (struct ixgbe_hw *, struct ixgbe_dcb_config *)
 
void ixgbe_dcb_unpack_pfc_cee (struct ixgbe_dcb_config *, u8 *, u8 *)
 
void ixgbe_dcb_unpack_refill_cee (struct ixgbe_dcb_config *, int, u16 *)
 
void ixgbe_dcb_unpack_max_cee (struct ixgbe_dcb_config *, u16 *)
 
void ixgbe_dcb_unpack_bwgid_cee (struct ixgbe_dcb_config *, int, u8 *)
 
void ixgbe_dcb_unpack_tsa_cee (struct ixgbe_dcb_config *, int, u8 *)
 
void ixgbe_dcb_unpack_map_cee (struct ixgbe_dcb_config *, int, u8 *)
 
u8 ixgbe_dcb_get_tc_from_up (struct ixgbe_dcb_config *, int, u8)
 
s32 ixgbe_dcb_hw_config (struct ixgbe_hw *, u16 *, u16 *, u8 *, u8 *, u8 *)
 
s32 ixgbe_dcb_hw_config_cee (struct ixgbe_hw *, struct ixgbe_dcb_config *)
 

Macro Definition Documentation

◆ IXGBE_DCB_BCN_SUPPORT

#define IXGBE_DCB_BCN_SUPPORT   0x00000004

Definition at line 63 of file ixgbe_dcb.h.

◆ IXGBE_DCB_BW_PERCENT

#define IXGBE_DCB_BW_PERCENT   100

Definition at line 55 of file ixgbe_dcb.h.

◆ IXGBE_DCB_CREDIT_QUANTUM

#define IXGBE_DCB_CREDIT_QUANTUM   64

Definition at line 43 of file ixgbe_dcb.h.

◆ IXGBE_DCB_GSP_SUPPORT

#define IXGBE_DCB_GSP_SUPPORT   0x00000010

Definition at line 65 of file ixgbe_dcb.h.

◆ IXGBE_DCB_MAX_BW_GROUP

#define IXGBE_DCB_MAX_BW_GROUP   8

Definition at line 54 of file ixgbe_dcb.h.

◆ IXGBE_DCB_MAX_CREDIT

#define IXGBE_DCB_MAX_CREDIT   (2 * IXGBE_DCB_MAX_CREDIT_REFILL)

Definition at line 46 of file ixgbe_dcb.h.

◆ IXGBE_DCB_MAX_CREDIT_REFILL

#define IXGBE_DCB_MAX_CREDIT_REFILL   200 /* 200 * 64B = 12800B */

Definition at line 44 of file ixgbe_dcb.h.

◆ IXGBE_DCB_MAX_TSO_SIZE

#define IXGBE_DCB_MAX_TSO_SIZE   (32 * 1024) /* Max TSO pkt size in DCB*/

Definition at line 45 of file ixgbe_dcb.h.

◆ IXGBE_DCB_MAX_USER_PRIORITY

#define IXGBE_DCB_MAX_USER_PRIORITY   8

Definition at line 53 of file ixgbe_dcb.h.

◆ IXGBE_DCB_MIN_TSO_CREDIT

#define IXGBE_DCB_MIN_TSO_CREDIT    ((IXGBE_DCB_MAX_TSO_SIZE / IXGBE_DCB_CREDIT_QUANTUM) + 1)

Definition at line 49 of file ixgbe_dcb.h.

◆ IXGBE_DCB_PFC_SUPPORT

#define IXGBE_DCB_PFC_SUPPORT   0x00000002

Definition at line 62 of file ixgbe_dcb.h.

◆ IXGBE_DCB_PG_SUPPORT

#define IXGBE_DCB_PG_SUPPORT   0x00000001

Definition at line 61 of file ixgbe_dcb.h.

◆ IXGBE_DCB_RX_CONFIG

#define IXGBE_DCB_RX_CONFIG   1

Definition at line 58 of file ixgbe_dcb.h.

◆ IXGBE_DCB_TX_CONFIG

#define IXGBE_DCB_TX_CONFIG   0

Definition at line 57 of file ixgbe_dcb.h.

◆ IXGBE_DCB_UP2TC_SUPPORT

#define IXGBE_DCB_UP2TC_SUPPORT   0x00000008

Definition at line 64 of file ixgbe_dcb.h.

Enumeration Type Documentation

◆ ixgbe_dcb_pba

Enumerator
ixgbe_dcb_pba_equal 
ixgbe_dcb_pba_80_48 

Definition at line 110 of file ixgbe_dcb.h.

◆ ixgbe_dcb_pfc

Enumerator
ixgbe_dcb_pfc_disabled 
ixgbe_dcb_pfc_enabled 
ixgbe_dcb_pfc_enabled_txonly 
ixgbe_dcb_pfc_enabled_rxonly 

Definition at line 94 of file ixgbe_dcb.h.

◆ ixgbe_dcb_tsa

Enumerator
ixgbe_dcb_tsa_ets 
ixgbe_dcb_tsa_group_strict_cee 
ixgbe_dcb_tsa_strict 

Definition at line 76 of file ixgbe_dcb.h.

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 
)