aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2013-05-31 17:03:07 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-06-26 13:48:39 -0400
commitb246de174300db84cf9ef8fae6d4ae3f73900a9e (patch)
tree567a1797233531326605f5116d8350375fea3e74 /drivers/scsi
parentfeccada972756b959e21d450e75f91907e53e9e1 (diff)
[SCSI] lpfc 8.3.40: Fix lpfc_used_cpu to be more dynamic
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c30
-rw-r--r--drivers/scsi/lpfc/lpfc_sli4.h1
2 files changed, 23 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index cb465b253910..7e5a2b16521f 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -60,7 +60,8 @@ unsigned long _dump_buf_dif_order;
60spinlock_t _dump_buf_lock; 60spinlock_t _dump_buf_lock;
61 61
62/* Used when mapping IRQ vectors in a driver centric manner */ 62/* Used when mapping IRQ vectors in a driver centric manner */
63uint16_t lpfc_used_cpu[LPFC_MAX_CPU]; 63uint16_t *lpfc_used_cpu;
64uint32_t lpfc_present_cpu;
64 65
65static void lpfc_get_hba_model_desc(struct lpfc_hba *, uint8_t *, uint8_t *); 66static void lpfc_get_hba_model_desc(struct lpfc_hba *, uint8_t *, uint8_t *);
66static int lpfc_post_rcv_buf(struct lpfc_hba *); 67static int lpfc_post_rcv_buf(struct lpfc_hba *);
@@ -5213,6 +5214,21 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
5213 rc = -ENOMEM; 5214 rc = -ENOMEM;
5214 goto out_free_msix; 5215 goto out_free_msix;
5215 } 5216 }
5217 if (lpfc_used_cpu == NULL) {
5218 lpfc_used_cpu = kzalloc((sizeof(uint16_t) * lpfc_present_cpu),
5219 GFP_KERNEL);
5220 if (!lpfc_used_cpu) {
5221 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
5222 "3335 Failed allocate memory for msi-x "
5223 "interrupt vector mapping\n");
5224 kfree(phba->sli4_hba.cpu_map);
5225 rc = -ENOMEM;
5226 goto out_free_msix;
5227 }
5228 for (i = 0; i < lpfc_present_cpu; i++)
5229 lpfc_used_cpu[i] = LPFC_VECTOR_MAP_EMPTY;
5230 }
5231
5216 /* Initialize io channels for round robin */ 5232 /* Initialize io channels for round robin */
5217 cpup = phba->sli4_hba.cpu_map; 5233 cpup = phba->sli4_hba.cpu_map;
5218 rc = 0; 5234 rc = 0;
@@ -6824,8 +6840,6 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba)
6824 int cfg_fcp_io_channel; 6840 int cfg_fcp_io_channel;
6825 uint32_t cpu; 6841 uint32_t cpu;
6826 uint32_t i = 0; 6842 uint32_t i = 0;
6827 uint32_t j = 0;
6828
6829 6843
6830 /* 6844 /*
6831 * Sanity check for configured queue parameters against the run-time 6845 * Sanity check for configured queue parameters against the run-time
@@ -6839,10 +6853,9 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba)
6839 for_each_present_cpu(cpu) { 6853 for_each_present_cpu(cpu) {
6840 if (cpu_online(cpu)) 6854 if (cpu_online(cpu))
6841 i++; 6855 i++;
6842 j++;
6843 } 6856 }
6844 phba->sli4_hba.num_online_cpu = i; 6857 phba->sli4_hba.num_online_cpu = i;
6845 phba->sli4_hba.num_present_cpu = j; 6858 phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
6846 6859
6847 if (i < cfg_fcp_io_channel) { 6860 if (i < cfg_fcp_io_channel) {
6848 lpfc_printf_log(phba, 6861 lpfc_printf_log(phba,
@@ -10967,8 +10980,10 @@ lpfc_init(void)
10967 } 10980 }
10968 10981
10969 /* Initialize in case vector mapping is needed */ 10982 /* Initialize in case vector mapping is needed */
10970 for (cpu = 0; cpu < LPFC_MAX_CPU; cpu++) 10983 lpfc_used_cpu = NULL;
10971 lpfc_used_cpu[cpu] = LPFC_VECTOR_MAP_EMPTY; 10984 lpfc_present_cpu = 0;
10985 for_each_present_cpu(cpu)
10986 lpfc_present_cpu++;
10972 10987
10973 error = pci_register_driver(&lpfc_driver); 10988 error = pci_register_driver(&lpfc_driver);
10974 if (error) { 10989 if (error) {
@@ -11008,6 +11023,7 @@ lpfc_exit(void)
11008 (1L << _dump_buf_dif_order), _dump_buf_dif); 11023 (1L << _dump_buf_dif_order), _dump_buf_dif);
11009 free_pages((unsigned long)_dump_buf_dif, _dump_buf_dif_order); 11024 free_pages((unsigned long)_dump_buf_dif, _dump_buf_dif_order);
11010 } 11025 }
11026 kfree(lpfc_used_cpu);
11011} 11027}
11012 11028
11013module_init(lpfc_init); 11029module_init(lpfc_init);
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
index 67af460184ba..d9de52f8818d 100644
--- a/drivers/scsi/lpfc/lpfc_sli4.h
+++ b/drivers/scsi/lpfc/lpfc_sli4.h
@@ -444,7 +444,6 @@ struct lpfc_vector_map_info {
444 struct cpumask maskbits; 444 struct cpumask maskbits;
445}; 445};
446#define LPFC_VECTOR_MAP_EMPTY 0xffff 446#define LPFC_VECTOR_MAP_EMPTY 0xffff
447#define LPFC_MAX_CPU 256
448 447
449/* SLI4 HBA data structure entries */ 448/* SLI4 HBA data structure entries */
450struct lpfc_sli4_hba { 449struct lpfc_sli4_hba {