mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-01 23:01:29 +00:00
ixgbe: remove extra unused queues in DCB + FCoE case
With DCB and FCoE configured extra queues may be allocated and never used. After this patch we calculate the max correctly. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
95447461fa
commit
3f4a6f009f
@ -7048,6 +7048,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||||||
int i, err, pci_using_dac;
|
int i, err, pci_using_dac;
|
||||||
u8 part_str[IXGBE_PBANUM_LENGTH];
|
u8 part_str[IXGBE_PBANUM_LENGTH];
|
||||||
unsigned int indices = num_possible_cpus();
|
unsigned int indices = num_possible_cpus();
|
||||||
|
unsigned int dcb_max = 0;
|
||||||
#ifdef IXGBE_FCOE
|
#ifdef IXGBE_FCOE
|
||||||
u16 device_caps;
|
u16 device_caps;
|
||||||
#endif
|
#endif
|
||||||
@ -7097,15 +7098,16 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||||||
pci_save_state(pdev);
|
pci_save_state(pdev);
|
||||||
|
|
||||||
#ifdef CONFIG_IXGBE_DCB
|
#ifdef CONFIG_IXGBE_DCB
|
||||||
indices *= MAX_TRAFFIC_CLASS;
|
if (ii->mac == ixgbe_mac_82598EB)
|
||||||
|
dcb_max = min_t(unsigned int, indices * MAX_TRAFFIC_CLASS,
|
||||||
|
IXGBE_MAX_RSS_INDICES);
|
||||||
|
else
|
||||||
|
dcb_max = min_t(unsigned int, indices * MAX_TRAFFIC_CLASS,
|
||||||
|
IXGBE_MAX_FDIR_INDICES);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ii->mac == ixgbe_mac_82598EB)
|
if (ii->mac == ixgbe_mac_82598EB)
|
||||||
#ifdef CONFIG_IXGBE_DCB
|
|
||||||
indices = min_t(unsigned int, indices, MAX_TRAFFIC_CLASS * 4);
|
|
||||||
#else
|
|
||||||
indices = min_t(unsigned int, indices, IXGBE_MAX_RSS_INDICES);
|
indices = min_t(unsigned int, indices, IXGBE_MAX_RSS_INDICES);
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
indices = min_t(unsigned int, indices, IXGBE_MAX_FDIR_INDICES);
|
indices = min_t(unsigned int, indices, IXGBE_MAX_FDIR_INDICES);
|
||||||
|
|
||||||
@ -7113,6 +7115,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||||||
indices += min_t(unsigned int, num_possible_cpus(),
|
indices += min_t(unsigned int, num_possible_cpus(),
|
||||||
IXGBE_MAX_FCOE_INDICES);
|
IXGBE_MAX_FCOE_INDICES);
|
||||||
#endif
|
#endif
|
||||||
|
indices = max_t(unsigned int, dcb_max, indices);
|
||||||
netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices);
|
netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices);
|
||||||
if (!netdev) {
|
if (!netdev) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user