Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134961
b: refs/heads/master
c: 235ea82
h: refs/heads/master
i:
  134959: 01c8548
v: v3
  • Loading branch information
PJ Waskiewicz authored and David S. Miller committed Mar 1, 2009
1 parent 1021f20 commit ea7b070
Show file tree
Hide file tree
Showing 6 changed files with 645 additions and 220 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11afc1b1fd802c11dc0fa986c210602c177f1e21
refs/heads/master: 235ea828a1640ed493562a5fe08aa666ff84fbc4
17 changes: 17 additions & 0 deletions trunk/drivers/net/ixgbe/ixgbe_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "ixgbe_type.h"
#include "ixgbe_dcb.h"
#include "ixgbe_dcb_82598.h"
#include "ixgbe_dcb_82599.h"

/**
* ixgbe_dcb_config - Struct containing DCB settings.
Expand Down Expand Up @@ -215,6 +216,8 @@ s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_get_tc_stats_82598(hw, stats, tc_count);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_get_tc_stats_82599(hw, stats, tc_count);
return ret;
}

Expand All @@ -232,6 +235,8 @@ s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_get_pfc_stats_82598(hw, stats, tc_count);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_get_pfc_stats_82599(hw, stats, tc_count);
return ret;
}

Expand All @@ -248,6 +253,8 @@ s32 ixgbe_dcb_config_rx_arbiter(struct ixgbe_hw *hw,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_config_rx_arbiter_82598(hw, dcb_config);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_config_rx_arbiter_82599(hw, dcb_config);
return ret;
}

Expand All @@ -264,6 +271,8 @@ s32 ixgbe_dcb_config_tx_desc_arbiter(struct ixgbe_hw *hw,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_config_tx_desc_arbiter_82598(hw, dcb_config);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_config_tx_desc_arbiter_82599(hw, dcb_config);
return ret;
}

Expand All @@ -280,6 +289,8 @@ s32 ixgbe_dcb_config_tx_data_arbiter(struct ixgbe_hw *hw,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_config_tx_data_arbiter_82598(hw, dcb_config);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_config_tx_data_arbiter_82599(hw, dcb_config);
return ret;
}

Expand All @@ -296,6 +307,8 @@ s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *hw,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_config_pfc_82598(hw, dcb_config);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_config_pfc_82599(hw, dcb_config);
return ret;
}

Expand All @@ -311,6 +324,8 @@ s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *hw)
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_config_tc_stats_82598(hw);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_config_tc_stats_82599(hw);
return ret;
}

Expand All @@ -327,6 +342,8 @@ s32 ixgbe_dcb_hw_config(struct ixgbe_hw *hw,
s32 ret = 0;
if (hw->mac.type == ixgbe_mac_82598EB)
ret = ixgbe_dcb_hw_config_82598(hw, dcb_config);
else if (hw->mac.type == ixgbe_mac_82599EB)
ret = ixgbe_dcb_hw_config_82599(hw, dcb_config);
return ret;
}

54 changes: 27 additions & 27 deletions trunk/drivers/net/ixgbe/ixgbe_dcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ enum strict_prio_type {
prio_link
};

/* DCB capability definitions */
#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

#define IXGBE_DCB_8_TC_SUPPORT 0x80

struct dcb_support {
/* DCB capabilities */
u32 capabilities;

/* Each bit represents a number of TCs configurable in the hw.
* If 8 traffic classes can be configured, the value is 0x80.
*/
u8 traffic_classes;
u8 pfc_traffic_classes;
};

/* Traffic class bandwidth allocation per direction */
struct tc_bw_alloc {
u8 bwg_id; /* Bandwidth Group (BWG) ID */
Expand Down Expand Up @@ -108,38 +128,18 @@ enum dcb_rx_pba_cfg {
pba_80_48 /* PBA[0-3] each use 80KB, PBA[4-7] each use 48KB */
};

/*
* This structure contains many values encoded as fixed-point
* numbers, meaning that some of bits are dedicated to the
* magnitude and others to the fraction part. In the comments
* this is shown as f=n, where n is the number of fraction bits.
* These fraction bits are always the low-order bits. The size
* of the magnitude is not specified.
*/
struct bcn_config {
u32 rp_admin_mode[MAX_TRAFFIC_CLASS]; /* BCN enabled, per TC */
u32 bcna_option[2]; /* BCNA Port + MAC Addr */
u32 rp_w; /* Derivative Weight, f=3 */
u32 rp_gi; /* Increase Gain, f=12 */
u32 rp_gd; /* Decrease Gain, f=12 */
u32 rp_ru; /* Rate Unit */
u32 rp_alpha; /* Max Decrease Factor, f=12 */
u32 rp_beta; /* Max Increase Factor, f=12 */
u32 rp_ri; /* Initial Rate */
u32 rp_td; /* Drift Interval Timer */
u32 rp_rd; /* Drift Increase */
u32 rp_tmax; /* Severe Congestion Backoff Timer Range */
u32 rp_rmin; /* Severe Congestion Restart Rate */
u32 rp_wrtt; /* RTT Moving Average Weight */
struct dcb_num_tcs {
u8 pg_tcs;
u8 pfc_tcs;
};

struct ixgbe_dcb_config {
struct bcn_config bcn;

struct dcb_support support;
struct dcb_num_tcs num_tcs;
struct tc_configuration tc_config[MAX_TRAFFIC_CLASS];
u8 bw_percentage[2][MAX_BW_GROUP]; /* One each for Tx/Rx */

bool round_robin_enable;
bool pfc_mode_enable;
bool round_robin_enable;

enum dcb_rx_pba_cfg rx_pba_cfg;

Expand Down
Loading

0 comments on commit ea7b070

Please sign in to comment.