From: Andy Gospodarek <gospo@redhat.com> Date: Tue, 2 Jun 2009 11:31:12 -0400 Subject: [net] ixgbe: fix MSI-X allocation on 8+ core systems Message-id: 20090602153112.GG10204@shell.devel.redhat.com O-Subject: [RHEL5.4 PATCH] ixgbe: fix MSI-X allocation on systems with more than 8 cores Bugzilla: 500857 RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: Ivan Vecera <ivecera@redhat.com> RH-Acked-by: Stefan Assmann <sassmann@redhat.com> Neil Horman was working on an issue where a particular box with 16 cores would not properly reboot if the ixgbe driver was loaded. The old (5.3) driver was fine, but the new one wasn't. Simultaneusly Mark Wagner noticed that MSI-X box was no longer working with ixgbe when he enabled HT on his system's bios and that enabled him to see 16 cores (instead of 8) on his box. I thought this was odd and when looking into the MSI-X initialization failures something didn't quite look right. A change to address this upstream had already been made, so we tried that. After getting MSI-X to initialize correctly, I realized this may have been related to the problem Neil saw and it turns out this patch fixes his problem as well (and that makes sense after seeing what it does). This is a backport of the following upstream commit: commit 8be0e4671d6355b2d905cb8fd051393b2cbf9510 Author: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> Date: Tue Mar 31 21:34:05 2009 +0000 ixgbe: Fix 82598 MSI-X allocation on systems with more than 8 CPU cores This was tested by both Neil Horman and Mark Wagner and everything seems to be working as expected. This will resolve RHBZ 500857. diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index ff5a79a..cf0d60b 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -2641,6 +2641,7 @@ err_tx_ring_allocation: **/ static int ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter) { + struct ixgbe_hw *hw = &adapter->hw; int err = 0; int vector, v_budget; @@ -2655,12 +2656,12 @@ static int ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter) /* * At the same time, hardware can only support a maximum of - * MAX_MSIX_COUNT vectors. With features such as RSS and VMDq, - * we can easily reach upwards of 64 Rx descriptor queues and - * 32 Tx queues. Thus, we cap it off in those rare cases where - * the cpu count also exceeds our vector limit. + * hw.mac->max_msix_vectors vectors. With features + * such as RSS and VMDq, we can easily surpass the number of Rx and Tx + * descriptor queues supported by our device. Thus, we cap it off in + * those rare cases where the cpu count also exceeds our vector limit. */ - v_budget = min(v_budget, MAX_MSIX_COUNT); + v_budget = min(v_budget, (int)hw->mac.max_msix_vectors); /* A failure in MSI-X entry allocation isn't fatal, but it does * mean we disable MSI-X capabilities of the adapter. */