diff options
author | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2009-05-17 08:34:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-18 00:04:13 -0400 |
commit | 70b77628d8d943b27cc0f72002b5884028aee38c (patch) | |
tree | 2ec860afd630101664f3cdafd4a32ece4e4d9f60 /drivers/net | |
parent | 63f39bd17aa700595fa3e34a61c5c07551dd1b7d (diff) |
ixgbe: Set Priority Flow Control low water threshhold for DCB
This sets the low water threshhold for priority flow control for 82598
and 82599 controllers in DCB mode.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index af392758b2b4..530da909dc7a 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -1589,6 +1589,13 @@ s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
1589 | u32 mflcn_reg; | 1589 | u32 mflcn_reg; |
1590 | u32 fccfg_reg; | 1590 | u32 fccfg_reg; |
1591 | u32 reg; | 1591 | u32 reg; |
1592 | u32 rx_pba_size; | ||
1593 | |||
1594 | #ifdef CONFIG_DCB | ||
1595 | if (hw->fc.requested_mode == ixgbe_fc_pfc) | ||
1596 | goto out; | ||
1597 | |||
1598 | #endif /* CONFIG_DCB */ | ||
1592 | 1599 | ||
1593 | mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN); | 1600 | mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN); |
1594 | mflcn_reg &= ~(IXGBE_MFLCN_RFCE | IXGBE_MFLCN_RPFCE); | 1601 | mflcn_reg &= ~(IXGBE_MFLCN_RFCE | IXGBE_MFLCN_RPFCE); |
@@ -1651,21 +1658,40 @@ s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
1651 | IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); | 1658 | IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); |
1652 | IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); | 1659 | IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); |
1653 | 1660 | ||
1654 | /* Set up and enable Rx high/low water mark thresholds, enable XON. */ | 1661 | reg = IXGBE_READ_REG(hw, IXGBE_MTQC); |
1655 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) { | 1662 | /* Thresholds are different for link flow control when in DCB mode */ |
1656 | if (hw->fc.send_xon) | 1663 | if (reg & IXGBE_MTQC_RT_ENA) { |
1657 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(packetbuf_num), | 1664 | rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(packetbuf_num)); |
1658 | (hw->fc.low_water | IXGBE_FCRTL_XONE)); | ||
1659 | else | ||
1660 | IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(packetbuf_num), | ||
1661 | hw->fc.low_water); | ||
1662 | 1665 | ||
1663 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), | 1666 | /* Always disable XON for LFC when in DCB mode */ |
1664 | (hw->fc.high_water | IXGBE_FCRTH_FCEN)); | 1667 | reg = (rx_pba_size >> 2) & 0xFFE0; |
1668 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) | ||
1669 | reg |= IXGBE_FCRTH_FCEN; | ||
1670 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), reg); | ||
1671 | } else { | ||
1672 | /* | ||
1673 | * Set up and enable Rx high/low water mark thresholds, | ||
1674 | * enable XON. | ||
1675 | */ | ||
1676 | if (hw->fc.current_mode & ixgbe_fc_tx_pause) { | ||
1677 | if (hw->fc.send_xon) { | ||
1678 | IXGBE_WRITE_REG(hw, | ||
1679 | IXGBE_FCRTL_82599(packetbuf_num), | ||
1680 | (hw->fc.low_water | | ||
1681 | IXGBE_FCRTL_XONE)); | ||
1682 | } else { | ||
1683 | IXGBE_WRITE_REG(hw, | ||
1684 | IXGBE_FCRTL_82599(packetbuf_num), | ||
1685 | hw->fc.low_water); | ||
1686 | } | ||
1687 | |||
1688 | IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), | ||
1689 | (hw->fc.high_water | IXGBE_FCRTH_FCEN)); | ||
1690 | } | ||
1665 | } | 1691 | } |
1666 | 1692 | ||
1667 | /* Configure pause time (2 TCs per register) */ | 1693 | /* Configure pause time (2 TCs per register) */ |
1668 | reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num)); | 1694 | reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num / 2)); |
1669 | if ((packetbuf_num & 1) == 0) | 1695 | if ((packetbuf_num & 1) == 0) |
1670 | reg = (reg & 0xFFFF0000) | hw->fc.pause_time; | 1696 | reg = (reg & 0xFFFF0000) | hw->fc.pause_time; |
1671 | else | 1697 | else |