diff options
author | John Fastabend <john.r.fastabend@intel.com> | 2010-02-25 18:15:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-26 05:10:11 -0500 |
commit | c85a26189660e1cfd1f50989468313c544487950 (patch) | |
tree | 57e66d2461ca7dec9ac38f289dca5d14f4feebd2 /drivers/net/ixgbe/ixgbe_main.c | |
parent | a922afb64d2e71115f122e04346163cb8c8453e3 (diff) |
ixgbe: Do not allocate too many netdev txqueues
Instead of allocating 128 struct netdev_queue per device, use the
minimum value between 128 and the number of possible txq's, to
reduce ram usage and "tc -s -d class shod dev .." output.
This patch fixes Eric Dumazet's patch to set the TX queues to
the correct minimum.
Signed-off-by: John Fastabend <john.r.fastabend@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/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 4a0102218d39..a961da2f98c0 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -5996,6 +5996,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5996 | const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data]; | 5996 | const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data]; |
5997 | static int cards_found; | 5997 | static int cards_found; |
5998 | int i, err, pci_using_dac; | 5998 | int i, err, pci_using_dac; |
5999 | unsigned int indices = num_possible_cpus(); | ||
5999 | #ifdef IXGBE_FCOE | 6000 | #ifdef IXGBE_FCOE |
6000 | u16 device_caps; | 6001 | u16 device_caps; |
6001 | #endif | 6002 | #endif |
@@ -6034,7 +6035,18 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6034 | pci_set_master(pdev); | 6035 | pci_set_master(pdev); |
6035 | pci_save_state(pdev); | 6036 | pci_save_state(pdev); |
6036 | 6037 | ||
6037 | netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), MAX_TX_QUEUES); | 6038 | if (ii->mac == ixgbe_mac_82598EB) |
6039 | indices = min_t(unsigned int, indices, IXGBE_MAX_RSS_INDICES); | ||
6040 | else | ||
6041 | indices = min_t(unsigned int, indices, IXGBE_MAX_FDIR_INDICES); | ||
6042 | |||
6043 | indices = max_t(unsigned int, indices, IXGBE_MAX_DCB_INDICES); | ||
6044 | #ifdef IXGBE_FCOE | ||
6045 | indices += min_t(unsigned int, num_possible_cpus(), | ||
6046 | IXGBE_MAX_FCOE_INDICES); | ||
6047 | #endif | ||
6048 | indices = min_t(unsigned int, indices, MAX_TX_QUEUES); | ||
6049 | netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices); | ||
6038 | if (!netdev) { | 6050 | if (!netdev) { |
6039 | err = -ENOMEM; | 6051 | err = -ENOMEM; |
6040 | goto err_alloc_etherdev; | 6052 | goto err_alloc_etherdev; |