]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/ixgbe/ixgbe_dcb_82599.c
ixgbe: DCB set PFC high and low water marks per data sheet specs
[net-next-2.6.git] / drivers / net / ixgbe / ixgbe_dcb_82599.c
index 05f224715073cf46e42e52db91a1b57fca226ddc..374e1f74d0f51c20bbfe6e245d8500f90a015dab 100644 (file)
@@ -251,19 +251,17 @@ s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw,
 
        /* Configure PFC Tx thresholds per TC */
        for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
-               if (dcb_config->rx_pba_cfg == pba_equal)
-                       rx_pba_size = IXGBE_RXPBSIZE_64KB;
-               else
-                       rx_pba_size = (i < 4) ? IXGBE_RXPBSIZE_80KB
-                                             : IXGBE_RXPBSIZE_48KB;
+               rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i));
+               rx_pba_size >>= IXGBE_RXPBSIZE_SHIFT;
+
+               reg = (rx_pba_size - hw->fc.low_water) << 10;
 
-               reg = ((rx_pba_size >> 5) & 0xFFE0);
                if (dcb_config->tc_config[i].dcb_pfc == pfc_enabled_full ||
                    dcb_config->tc_config[i].dcb_pfc == pfc_enabled_tx)
                        reg |= IXGBE_FCRTL_XONE;
                IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), reg);
 
-               reg = ((rx_pba_size >> 2) & 0xFFE0);
+               reg = (rx_pba_size - hw->fc.high_water) << 10;
                if (dcb_config->tc_config[i].dcb_pfc == pfc_enabled_full ||
                    dcb_config->tc_config[i].dcb_pfc == pfc_enabled_tx)
                        reg |= IXGBE_FCRTH_FCEN;