diff options
author | Anjali Singhai Jain <anjali.singhai@intel.com> | 2014-05-21 19:32:43 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-06-09 03:17:43 -0400 |
commit | a34977ba6cbc17f14291771732c58f3cb8016a88 (patch) | |
tree | 3bb32b558eb91540104044194340482b7c80708e | |
parent | c674d1250bfc04bae9fdbd71883713d29ad9f5d7 (diff) |
i40e: Changes to Interrupt distribution policy
This patch changes the way resources are distributed to special features.
Change-ID: I847e49d714a1d70e97f3f994cb39bfb5e02ab016
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index afc37d3b2101..eb32c5ce3eb3 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -6228,6 +6228,16 @@ static int i40e_init_msix(struct i40e_pf *pf) | |||
6228 | for (i = 0; i < v_budget; i++) | 6228 | for (i = 0; i < v_budget; i++) |
6229 | pf->msix_entries[i].entry = i; | 6229 | pf->msix_entries[i].entry = i; |
6230 | vec = i40e_reserve_msix_vectors(pf, v_budget); | 6230 | vec = i40e_reserve_msix_vectors(pf, v_budget); |
6231 | |||
6232 | if (vec != v_budget) { | ||
6233 | /* If we have limited resources, we will start with no vectors | ||
6234 | * for the special features and then allocate vectors to some | ||
6235 | * of these features based on the policy and at the end disable | ||
6236 | * the features that did not get any vectors. | ||
6237 | */ | ||
6238 | pf->num_vmdq_msix = 0; | ||
6239 | } | ||
6240 | |||
6231 | if (vec < I40E_MIN_MSIX) { | 6241 | if (vec < I40E_MIN_MSIX) { |
6232 | pf->flags &= ~I40E_FLAG_MSIX_ENABLED; | 6242 | pf->flags &= ~I40E_FLAG_MSIX_ENABLED; |
6233 | kfree(pf->msix_entries); | 6243 | kfree(pf->msix_entries); |
@@ -6236,27 +6246,25 @@ static int i40e_init_msix(struct i40e_pf *pf) | |||
6236 | 6246 | ||
6237 | } else if (vec == I40E_MIN_MSIX) { | 6247 | } else if (vec == I40E_MIN_MSIX) { |
6238 | /* Adjust for minimal MSIX use */ | 6248 | /* Adjust for minimal MSIX use */ |
6239 | dev_info(&pf->pdev->dev, "Features disabled, not enough MSI-X vectors\n"); | ||
6240 | pf->flags &= ~I40E_FLAG_VMDQ_ENABLED; | ||
6241 | pf->num_vmdq_vsis = 0; | 6249 | pf->num_vmdq_vsis = 0; |
6242 | pf->num_vmdq_qps = 0; | 6250 | pf->num_vmdq_qps = 0; |
6243 | pf->num_vmdq_msix = 0; | ||
6244 | pf->num_lan_qps = 1; | 6251 | pf->num_lan_qps = 1; |
6245 | pf->num_lan_msix = 1; | 6252 | pf->num_lan_msix = 1; |
6246 | 6253 | ||
6247 | } else if (vec != v_budget) { | 6254 | } else if (vec != v_budget) { |
6255 | /* reserve the misc vector */ | ||
6256 | vec--; | ||
6257 | |||
6248 | /* Scale vector usage down */ | 6258 | /* Scale vector usage down */ |
6249 | pf->num_vmdq_msix = 1; /* force VMDqs to only one vector */ | 6259 | pf->num_vmdq_msix = 1; /* force VMDqs to only one vector */ |
6250 | vec--; /* reserve the misc vector */ | 6260 | pf->num_vmdq_vsis = 1; |
6251 | 6261 | ||
6252 | /* partition out the remaining vectors */ | 6262 | /* partition out the remaining vectors */ |
6253 | switch (vec) { | 6263 | switch (vec) { |
6254 | case 2: | 6264 | case 2: |
6255 | pf->num_vmdq_vsis = 1; | ||
6256 | pf->num_lan_msix = 1; | 6265 | pf->num_lan_msix = 1; |
6257 | break; | 6266 | break; |
6258 | case 3: | 6267 | case 3: |
6259 | pf->num_vmdq_vsis = 1; | ||
6260 | pf->num_lan_msix = 2; | 6268 | pf->num_lan_msix = 2; |
6261 | break; | 6269 | break; |
6262 | default: | 6270 | default: |
@@ -6268,6 +6276,11 @@ static int i40e_init_msix(struct i40e_pf *pf) | |||
6268 | } | 6276 | } |
6269 | } | 6277 | } |
6270 | 6278 | ||
6279 | if ((pf->flags & I40E_FLAG_VMDQ_ENABLED) && | ||
6280 | (pf->num_vmdq_msix == 0)) { | ||
6281 | dev_info(&pf->pdev->dev, "VMDq disabled, not enough MSI-X vectors\n"); | ||
6282 | pf->flags &= ~I40E_FLAG_VMDQ_ENABLED; | ||
6283 | } | ||
6271 | return err; | 6284 | return err; |
6272 | } | 6285 | } |
6273 | 6286 | ||