Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c85a2618 authored by John Fastabend's avatar John Fastabend Committed by David S. Miller
Browse files

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: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a922afb6
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -5996,6 +5996,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
	const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data];
	const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data];
	static int cards_found;
	static int cards_found;
	int i, err, pci_using_dac;
	int i, err, pci_using_dac;
	unsigned int indices = num_possible_cpus();
#ifdef IXGBE_FCOE
#ifdef IXGBE_FCOE
	u16 device_caps;
	u16 device_caps;
#endif
#endif
@@ -6034,7 +6035,18 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
	pci_set_master(pdev);
	pci_set_master(pdev);
	pci_save_state(pdev);
	pci_save_state(pdev);


	netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), MAX_TX_QUEUES);
	if (ii->mac == ixgbe_mac_82598EB)
		indices = min_t(unsigned int, indices, IXGBE_MAX_RSS_INDICES);
	else
		indices = min_t(unsigned int, indices, IXGBE_MAX_FDIR_INDICES);

	indices = max_t(unsigned int, indices, IXGBE_MAX_DCB_INDICES);
#ifdef IXGBE_FCOE
	indices += min_t(unsigned int, num_possible_cpus(),
			 IXGBE_MAX_FCOE_INDICES);
#endif
	indices = min_t(unsigned int, indices, MAX_TX_QUEUES);
	netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices);
	if (!netdev) {
	if (!netdev) {
		err = -ENOMEM;
		err = -ENOMEM;
		goto err_alloc_etherdev;
		goto err_alloc_etherdev;