diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-09-28 18:35:54 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 04:58:09 -0400 |
commit | 68c26a3afc6693d08181c1757f943bd005d03c2f (patch) | |
tree | f9c1d2ac8ca5d643c1f222b7be89c17445639629 | |
parent | d3fea9af00fc69f60a792f5e0ea1e51fabd7c633 (diff) |
[SCSI] be2iscsi: Fix MSIx creation for SKH-R adapter
The MSIx to be created for SKH-R adapter should be based on
eq_count returned by get_fw_config.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 45 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.h | 3 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 11 |
3 files changed, 42 insertions, 17 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index de948d36fb15..ddacd2c99079 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -3758,8 +3758,19 @@ static void find_num_cpus(struct beiscsi_hba *phba) | |||
3758 | BEISCSI_MAX_NUM_CPUS : num_cpus; | 3758 | BEISCSI_MAX_NUM_CPUS : num_cpus; |
3759 | break; | 3759 | break; |
3760 | case BE_GEN4: | 3760 | case BE_GEN4: |
3761 | phba->num_cpus = (num_cpus > OC_SKH_MAX_NUM_CPUS) ? | 3761 | /* |
3762 | OC_SKH_MAX_NUM_CPUS : num_cpus; | 3762 | * If eqid_count == 1 fall back to |
3763 | * INTX mechanism | ||
3764 | **/ | ||
3765 | if (phba->fw_config.eqid_count == 1) { | ||
3766 | enable_msix = 0; | ||
3767 | phba->num_cpus = 1; | ||
3768 | return; | ||
3769 | } | ||
3770 | |||
3771 | phba->num_cpus = | ||
3772 | (num_cpus > (phba->fw_config.eqid_count - 1)) ? | ||
3773 | (phba->fw_config.eqid_count - 1) : num_cpus; | ||
3763 | break; | 3774 | break; |
3764 | default: | 3775 | default: |
3765 | phba->num_cpus = 1; | 3776 | phba->num_cpus = 1; |
@@ -5275,20 +5286,6 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, | |||
5275 | phba->generation = 0; | 5286 | phba->generation = 0; |
5276 | } | 5287 | } |
5277 | 5288 | ||
5278 | if (enable_msix) | ||
5279 | find_num_cpus(phba); | ||
5280 | else | ||
5281 | phba->num_cpus = 1; | ||
5282 | |||
5283 | beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, | ||
5284 | "BM_%d : num_cpus = %d\n", | ||
5285 | phba->num_cpus); | ||
5286 | |||
5287 | if (enable_msix) { | ||
5288 | beiscsi_msix_enable(phba); | ||
5289 | if (!phba->msix_enabled) | ||
5290 | phba->num_cpus = 1; | ||
5291 | } | ||
5292 | ret = be_ctrl_init(phba, pcidev); | 5289 | ret = be_ctrl_init(phba, pcidev); |
5293 | if (ret) { | 5290 | if (ret) { |
5294 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, | 5291 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, |
@@ -5320,6 +5317,22 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, | |||
5320 | "BM_%d : Error getting fw config\n"); | 5317 | "BM_%d : Error getting fw config\n"); |
5321 | goto free_port; | 5318 | goto free_port; |
5322 | } | 5319 | } |
5320 | |||
5321 | if (enable_msix) | ||
5322 | find_num_cpus(phba); | ||
5323 | else | ||
5324 | phba->num_cpus = 1; | ||
5325 | |||
5326 | beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, | ||
5327 | "BM_%d : num_cpus = %d\n", | ||
5328 | phba->num_cpus); | ||
5329 | |||
5330 | if (enable_msix) { | ||
5331 | beiscsi_msix_enable(phba); | ||
5332 | if (!phba->msix_enabled) | ||
5333 | phba->num_cpus = 1; | ||
5334 | } | ||
5335 | |||
5323 | phba->shost->max_id = phba->params.cxns_per_ctrl; | 5336 | phba->shost->max_id = phba->params.cxns_per_ctrl; |
5324 | beiscsi_get_params(phba); | 5337 | beiscsi_get_params(phba); |
5325 | phba->shost->can_queue = phba->params.ios_per_ctrl; | 5338 | phba->shost->can_queue = phba->params.ios_per_ctrl; |
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 3fa1e819f42d..88291b0051bf 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -65,7 +65,6 @@ | |||
65 | 65 | ||
66 | #define MAX_CPUS 64 | 66 | #define MAX_CPUS 64 |
67 | #define BEISCSI_MAX_NUM_CPUS 7 | 67 | #define BEISCSI_MAX_NUM_CPUS 7 |
68 | #define OC_SKH_MAX_NUM_CPUS 31 | ||
69 | 68 | ||
70 | #define BEISCSI_VER_STRLEN 32 | 69 | #define BEISCSI_VER_STRLEN 32 |
71 | 70 | ||
@@ -377,6 +376,8 @@ struct beiscsi_hba { | |||
377 | * for cid to cri conversion | 376 | * for cid to cri conversion |
378 | */ | 377 | */ |
379 | unsigned int phys_port; | 378 | unsigned int phys_port; |
379 | unsigned int eqid_count; | ||
380 | unsigned int cqid_count; | ||
380 | unsigned int iscsi_cid_start[BEISCSI_ULP_COUNT]; | 381 | unsigned int iscsi_cid_start[BEISCSI_ULP_COUNT]; |
381 | #define BEISCSI_GET_CID_COUNT(phba, ulp_num) \ | 382 | #define BEISCSI_GET_CID_COUNT(phba, ulp_num) \ |
382 | (phba->fw_config.iscsi_cid_count[ulp_num]) | 383 | (phba->fw_config.iscsi_cid_count[ulp_num]) |
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 7b0b13f69b69..befeace18257 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -311,6 +311,17 @@ int mgmt_get_fw_config(struct be_ctrl_info *ctrl, | |||
311 | struct be_fw_cfg *pfw_cfg; | 311 | struct be_fw_cfg *pfw_cfg; |
312 | pfw_cfg = req; | 312 | pfw_cfg = req; |
313 | 313 | ||
314 | if (!is_chip_be2_be3r(phba)) { | ||
315 | phba->fw_config.eqid_count = pfw_cfg->eqid_count; | ||
316 | phba->fw_config.cqid_count = pfw_cfg->cqid_count; | ||
317 | |||
318 | beiscsi_log(phba, KERN_INFO, | ||
319 | BEISCSI_LOG_INIT, | ||
320 | "BG_%d : EQ_Count : %d CQ_Count : %d\n", | ||
321 | phba->fw_config.eqid_count, | ||
322 | phba->fw_config.cqid_count); | ||
323 | } | ||
324 | |||
314 | for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) | 325 | for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) |
315 | if (pfw_cfg->ulp[ulp_num].ulp_mode & | 326 | if (pfw_cfg->ulp[ulp_num].ulp_mode & |
316 | BEISCSI_ULP_ISCSI_INI_MODE) | 327 | BEISCSI_ULP_ISCSI_INI_MODE) |