aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@intel.com>2013-09-28 03:13:28 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-10-22 08:42:47 -0400
commit958a3e3b14f3f7b2dcc35fad0b8695d9bcd9fbd0 (patch)
tree4842933df1d7fc938710ed22369b01eb3c1e3380 /drivers/net/ethernet/intel/i40e
parent13c60b99055a9e53543b7df7e4cb7eda3d6e5700 (diff)
i40e: fixup legacy interrupt handling
There were a number of little bugs in the error handling of irq setup, most of which ended up panicing the kernel, and are addressed by this patch, along with a couple formatting issues. Legacy interrupts (including MSI) are used only in the case of failure to allocate MSI-X interrupts. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a8c18faf1c54..270190ad7faa 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4615,7 +4615,8 @@ static void i40e_fdir_setup(struct i40e_pf *pf)
4615 bool new_vsi = false; 4615 bool new_vsi = false;
4616 int err, i; 4616 int err, i;
4617 4617
4618 if (!(pf->flags & (I40E_FLAG_FDIR_ENABLED|I40E_FLAG_FDIR_ATR_ENABLED))) 4618 if (!(pf->flags & (I40E_FLAG_FDIR_ENABLED |
4619 I40E_FLAG_FDIR_ATR_ENABLED)))
4619 return; 4620 return;
4620 4621
4621 pf->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE; 4622 pf->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE;
@@ -5435,7 +5436,8 @@ static void i40e_init_interrupt_scheme(struct i40e_pf *pf)
5435 if (pf->flags & I40E_FLAG_MSIX_ENABLED) { 5436 if (pf->flags & I40E_FLAG_MSIX_ENABLED) {
5436 err = i40e_init_msix(pf); 5437 err = i40e_init_msix(pf);
5437 if (err) { 5438 if (err) {
5438 pf->flags &= ~(I40E_FLAG_RSS_ENABLED | 5439 pf->flags &= ~(I40E_FLAG_MSIX_ENABLED |
5440 I40E_FLAG_RSS_ENABLED |
5439 I40E_FLAG_MQ_ENABLED | 5441 I40E_FLAG_MQ_ENABLED |
5440 I40E_FLAG_DCB_ENABLED | 5442 I40E_FLAG_DCB_ENABLED |
5441 I40E_FLAG_SRIOV_ENABLED | 5443 I40E_FLAG_SRIOV_ENABLED |
@@ -5450,14 +5452,17 @@ static void i40e_init_interrupt_scheme(struct i40e_pf *pf)
5450 5452
5451 if (!(pf->flags & I40E_FLAG_MSIX_ENABLED) && 5453 if (!(pf->flags & I40E_FLAG_MSIX_ENABLED) &&
5452 (pf->flags & I40E_FLAG_MSI_ENABLED)) { 5454 (pf->flags & I40E_FLAG_MSI_ENABLED)) {
5455 dev_info(&pf->pdev->dev, "MSIX not available, trying MSI\n");
5453 err = pci_enable_msi(pf->pdev); 5456 err = pci_enable_msi(pf->pdev);
5454 if (err) { 5457 if (err) {
5455 dev_info(&pf->pdev->dev, 5458 dev_info(&pf->pdev->dev, "MSI init failed - %d\n", err);
5456 "MSI init failed (%d), trying legacy.\n", err);
5457 pf->flags &= ~I40E_FLAG_MSI_ENABLED; 5459 pf->flags &= ~I40E_FLAG_MSI_ENABLED;
5458 } 5460 }
5459 } 5461 }
5460 5462
5463 if (!(pf->flags & (I40E_FLAG_MSIX_ENABLED | I40E_FLAG_MSI_ENABLED)))
5464 dev_info(&pf->pdev->dev, "MSIX and MSI not available, falling back to Legacy IRQ\n");
5465
5461 /* track first vector for misc interrupts */ 5466 /* track first vector for misc interrupts */
5462 err = i40e_get_lump(pf, pf->irq_pile, 1, I40E_PILE_VALID_BIT-1); 5467 err = i40e_get_lump(pf, pf->irq_pile, 1, I40E_PILE_VALID_BIT-1);
5463} 5468}
@@ -6110,8 +6115,9 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
6110 goto vector_setup_out; 6115 goto vector_setup_out;
6111 } 6116 }
6112 6117
6113 vsi->base_vector = i40e_get_lump(pf, pf->irq_pile, 6118 if (vsi->num_q_vectors)
6114 vsi->num_q_vectors, vsi->idx); 6119 vsi->base_vector = i40e_get_lump(pf, pf->irq_pile,
6120 vsi->num_q_vectors, vsi->idx);
6115 if (vsi->base_vector < 0) { 6121 if (vsi->base_vector < 0) {
6116 dev_info(&pf->pdev->dev, 6122 dev_info(&pf->pdev->dev,
6117 "failed to get q tracking for VSI %d, err=%d\n", 6123 "failed to get q tracking for VSI %d, err=%d\n",