Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315395
b: refs/heads/master
c: df0676d
h: refs/heads/master
i:
  315393: 9e8ca66
  315391: 759ec0d
v: v3
  • Loading branch information
Alexander Duyck authored and Jeff Kirsher committed Jul 14, 2012
1 parent 2a71eb5 commit 4c9b5d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 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: 15cbc70ea2b8a43ba3f0dc858299ed1c5b295b71
refs/heads/master: df0676d1bddf085c4cc4aca39b18f9fcbd08d83d
47 changes: 22 additions & 25 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,55 +180,52 @@ s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_hw *hw,

void ixgbe_dcb_unpack_pfc(struct ixgbe_dcb_config *cfg, u8 *pfc_en)
{
int i;
struct tc_configuration *tc_config = &cfg->tc_config[0];
int tc;

*pfc_en = 0;
for (i = 0; i < MAX_TRAFFIC_CLASS; i++)
*pfc_en |= !!(cfg->tc_config[i].dcb_pfc & 0xF) << i;
for (*pfc_en = 0, tc = 0; tc < MAX_TRAFFIC_CLASS; tc++) {
if (tc_config[tc].dcb_pfc != pfc_disabled)
*pfc_en |= 1 << tc;
}
}

void ixgbe_dcb_unpack_refill(struct ixgbe_dcb_config *cfg, int direction,
u16 *refill)
{
struct tc_bw_alloc *p;
int i;
struct tc_configuration *tc_config = &cfg->tc_config[0];
int tc;

for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
p = &cfg->tc_config[i].path[direction];
refill[i] = p->data_credits_refill;
}
for (tc = 0; tc < MAX_TRAFFIC_CLASS; tc++)
refill[tc] = tc_config[tc].path[direction].data_credits_refill;
}

void ixgbe_dcb_unpack_max(struct ixgbe_dcb_config *cfg, u16 *max)
{
int i;
struct tc_configuration *tc_config = &cfg->tc_config[0];
int tc;

for (i = 0; i < MAX_TRAFFIC_CLASS; i++)
max[i] = cfg->tc_config[i].desc_credits_max;
for (tc = 0; tc < MAX_TRAFFIC_CLASS; tc++)
max[tc] = tc_config[tc].desc_credits_max;
}

void ixgbe_dcb_unpack_bwgid(struct ixgbe_dcb_config *cfg, int direction,
u8 *bwgid)
{
struct tc_bw_alloc *p;
int i;
struct tc_configuration *tc_config = &cfg->tc_config[0];
int tc;

for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
p = &cfg->tc_config[i].path[direction];
bwgid[i] = p->bwg_id;
}
for (tc = 0; tc < MAX_TRAFFIC_CLASS; tc++)
bwgid[tc] = tc_config[tc].path[direction].bwg_id;
}

void ixgbe_dcb_unpack_prio(struct ixgbe_dcb_config *cfg, int direction,
u8 *ptype)
{
struct tc_bw_alloc *p;
int i;
struct tc_configuration *tc_config = &cfg->tc_config[0];
int tc;

for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
p = &cfg->tc_config[i].path[direction];
ptype[i] = p->prio_type;
}
for (tc = 0; tc < MAX_TRAFFIC_CLASS; tc++)
ptype[tc] = tc_config[tc].path[direction].prio_type;
}

static u8 ixgbe_dcb_get_tc_from_up(struct ixgbe_dcb_config *cfg,
Expand Down

0 comments on commit 4c9b5d8

Please sign in to comment.