aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_82599.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-05-02 08:34:10 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-06-21 04:18:55 -0400
commit80605c6513207344d00b32e8d1e64bd34fdf1358 (patch)
tree865b63b591278b0b8abef0bbe0e4a4f4a48951b8 /drivers/net/ixgbe/ixgbe_82599.c
parent1fcd86b51179518f7e69164e37353fb59cd6301e (diff)
ixgbe: consolidate packet buffer allocation
Consolidate packet buffer allocation currently being done in the DCB path and main path. This allows the feature set and packet buffer requirements to be done once. This is prep work to allow DCB to coexist with other features namely, flow director. CC: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_82599.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 0d7bc915635..324a5051f81 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -1114,27 +1114,8 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw)
1114s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc) 1114s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc)
1115{ 1115{
1116 u32 fdirctrl = 0; 1116 u32 fdirctrl = 0;
1117 u32 pbsize;
1118 int i; 1117 int i;
1119 1118
1120 /*
1121 * Before enabling Flow Director, the Rx Packet Buffer size
1122 * must be reduced. The new value is the current size minus
1123 * flow director memory usage size.
1124 */
1125 pbsize = (1 << (IXGBE_FDIR_PBALLOC_SIZE_SHIFT + pballoc));
1126 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0),
1127 (IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) - pbsize));
1128
1129 /*
1130 * The defaults in the HW for RX PB 1-7 are not zero and so should be
1131 * initialized to zero for non DCB mode otherwise actual total RX PB
1132 * would be bigger than programmed and filter space would run into
1133 * the PB 0 region.
1134 */
1135 for (i = 1; i < 8; i++)
1136 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), 0);
1137
1138 /* Send interrupt when 64 filters are left */ 1119 /* Send interrupt when 64 filters are left */
1139 fdirctrl |= 4 << IXGBE_FDIRCTRL_FULL_THRESH_SHIFT; 1120 fdirctrl |= 4 << IXGBE_FDIRCTRL_FULL_THRESH_SHIFT;
1140 1121
@@ -1202,27 +1183,8 @@ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc)
1202s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc) 1183s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc)
1203{ 1184{
1204 u32 fdirctrl = 0; 1185 u32 fdirctrl = 0;
1205 u32 pbsize;
1206 int i; 1186 int i;
1207 1187
1208 /*
1209 * Before enabling Flow Director, the Rx Packet Buffer size
1210 * must be reduced. The new value is the current size minus
1211 * flow director memory usage size.
1212 */
1213 pbsize = (1 << (IXGBE_FDIR_PBALLOC_SIZE_SHIFT + pballoc));
1214 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0),
1215 (IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) - pbsize));
1216
1217 /*
1218 * The defaults in the HW for RX PB 1-7 are not zero and so should be
1219 * initialized to zero for non DCB mode otherwise actual total RX PB
1220 * would be bigger than programmed and filter space would run into
1221 * the PB 0 region.
1222 */
1223 for (i = 1; i < 8; i++)
1224 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), 0);
1225
1226 /* Send interrupt when 64 filters are left */ 1188 /* Send interrupt when 64 filters are left */
1227 fdirctrl |= 4 << IXGBE_FDIRCTRL_FULL_THRESH_SHIFT; 1189 fdirctrl |= 4 << IXGBE_FDIRCTRL_FULL_THRESH_SHIFT;
1228 1190
@@ -2146,6 +2108,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
2146 .read_analog_reg8 = &ixgbe_read_analog_reg8_82599, 2108 .read_analog_reg8 = &ixgbe_read_analog_reg8_82599,
2147 .write_analog_reg8 = &ixgbe_write_analog_reg8_82599, 2109 .write_analog_reg8 = &ixgbe_write_analog_reg8_82599,
2148 .setup_link = &ixgbe_setup_mac_link_82599, 2110 .setup_link = &ixgbe_setup_mac_link_82599,
2111 .set_rxpba = &ixgbe_set_rxpba_generic,
2149 .check_link = &ixgbe_check_mac_link_generic, 2112 .check_link = &ixgbe_check_mac_link_generic,
2150 .get_link_capabilities = &ixgbe_get_link_capabilities_82599, 2113 .get_link_capabilities = &ixgbe_get_link_capabilities_82599,
2151 .led_on = &ixgbe_led_on_generic, 2114 .led_on = &ixgbe_led_on_generic,