diff options
author | John Fastabend <john.r.fastabend@intel.com> | 2011-05-02 08:34:10 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-06-21 04:18:55 -0400 |
commit | 80605c6513207344d00b32e8d1e64bd34fdf1358 (patch) | |
tree | 865b63b591278b0b8abef0bbe0e4a4f4a48951b8 /drivers/net/ixgbe/ixgbe_82598.c | |
parent | 1fcd86b51179518f7e69164e37353fb59cd6301e (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_82598.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82598.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 8179e5060a18..bb417d746a16 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -1242,6 +1242,47 @@ static void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) | |||
1242 | } | 1242 | } |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | /** | ||
1246 | * ixgbe_set_rxpba_82598 - Configure packet buffers | ||
1247 | * @hw: pointer to hardware structure | ||
1248 | * @dcb_config: pointer to ixgbe_dcb_config structure | ||
1249 | * | ||
1250 | * Configure packet buffers. | ||
1251 | */ | ||
1252 | static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, u32 headroom, | ||
1253 | int strategy) | ||
1254 | { | ||
1255 | u32 rxpktsize = IXGBE_RXPBSIZE_64KB; | ||
1256 | u8 i = 0; | ||
1257 | |||
1258 | if (!num_pb) | ||
1259 | return; | ||
1260 | |||
1261 | /* Setup Rx packet buffer sizes */ | ||
1262 | switch (strategy) { | ||
1263 | case PBA_STRATEGY_WEIGHTED: | ||
1264 | /* Setup the first four at 80KB */ | ||
1265 | rxpktsize = IXGBE_RXPBSIZE_80KB; | ||
1266 | for (; i < 4; i++) | ||
1267 | IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); | ||
1268 | /* Setup the last four at 48KB...don't re-init i */ | ||
1269 | rxpktsize = IXGBE_RXPBSIZE_48KB; | ||
1270 | /* Fall Through */ | ||
1271 | case PBA_STRATEGY_EQUAL: | ||
1272 | default: | ||
1273 | /* Divide the remaining Rx packet buffer evenly among the TCs */ | ||
1274 | for (; i < IXGBE_MAX_PACKET_BUFFERS; i++) | ||
1275 | IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); | ||
1276 | break; | ||
1277 | } | ||
1278 | |||
1279 | /* Setup Tx packet buffer sizes */ | ||
1280 | for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) | ||
1281 | IXGBE_WRITE_REG(hw, IXGBE_TXPBSIZE(i), IXGBE_TXPBSIZE_40KB); | ||
1282 | |||
1283 | return; | ||
1284 | } | ||
1285 | |||
1245 | static struct ixgbe_mac_operations mac_ops_82598 = { | 1286 | static struct ixgbe_mac_operations mac_ops_82598 = { |
1246 | .init_hw = &ixgbe_init_hw_generic, | 1287 | .init_hw = &ixgbe_init_hw_generic, |
1247 | .reset_hw = &ixgbe_reset_hw_82598, | 1288 | .reset_hw = &ixgbe_reset_hw_82598, |
@@ -1257,6 +1298,7 @@ static struct ixgbe_mac_operations mac_ops_82598 = { | |||
1257 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82598, | 1298 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82598, |
1258 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82598, | 1299 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82598, |
1259 | .setup_link = &ixgbe_setup_mac_link_82598, | 1300 | .setup_link = &ixgbe_setup_mac_link_82598, |
1301 | .set_rxpba = &ixgbe_set_rxpba_82598, | ||
1260 | .check_link = &ixgbe_check_mac_link_82598, | 1302 | .check_link = &ixgbe_check_mac_link_82598, |
1261 | .get_link_capabilities = &ixgbe_get_link_capabilities_82598, | 1303 | .get_link_capabilities = &ixgbe_get_link_capabilities_82598, |
1262 | .led_on = &ixgbe_led_on_generic, | 1304 | .led_on = &ixgbe_led_on_generic, |