diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-01-13 03:58:37 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-13 04:08:50 -0500 |
commit | 61405fea92c42d072d9b8bd189689f1502a838af (patch) | |
tree | 013ea3e7ed71f4114004d5852d40b6e89e128f76 /drivers/scsi/bnx2i | |
parent | 9c443dfdd31eddea6cbe6ee0ca469fbcc4e1dc3b (diff) | |
parent | 1703f2c321a8a531c393e137a82602e16c6061cb (diff) |
Merge branch 'perf/urgent' into perf/core
Merge reason: queue up dependent patch, update to -rc4
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/scsi/bnx2i')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i.h | 1 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 51 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 16 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 |
4 files changed, 52 insertions, 18 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h index 2b973f3c2eb2..6cf9dc37d78b 100644 --- a/drivers/scsi/bnx2i/bnx2i.h +++ b/drivers/scsi/bnx2i/bnx2i.h | |||
@@ -684,6 +684,7 @@ extern unsigned int error_mask1, error_mask2; | |||
684 | extern u64 iscsi_error_mask; | 684 | extern u64 iscsi_error_mask; |
685 | extern unsigned int en_tcp_dack; | 685 | extern unsigned int en_tcp_dack; |
686 | extern unsigned int event_coal_div; | 686 | extern unsigned int event_coal_div; |
687 | extern unsigned int event_coal_min; | ||
687 | 688 | ||
688 | extern struct scsi_transport_template *bnx2i_scsi_xport_template; | 689 | extern struct scsi_transport_template *bnx2i_scsi_xport_template; |
689 | extern struct iscsi_transport bnx2i_iscsi_transport; | 690 | extern struct iscsi_transport bnx2i_iscsi_transport; |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 5c8d7630c13e..1af578dec276 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -133,20 +133,38 @@ void bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action) | |||
133 | { | 133 | { |
134 | struct bnx2i_5771x_cq_db *cq_db; | 134 | struct bnx2i_5771x_cq_db *cq_db; |
135 | u16 cq_index; | 135 | u16 cq_index; |
136 | u16 next_index; | ||
137 | u32 num_active_cmds; | ||
136 | 138 | ||
139 | |||
140 | /* Coalesce CQ entries only on 10G devices */ | ||
137 | if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) | 141 | if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) |
138 | return; | 142 | return; |
139 | 143 | ||
144 | /* Do not update CQ DB multiple times before firmware writes | ||
145 | * '0xFFFF' to CQDB->SQN field. Deviation may cause spurious | ||
146 | * interrupts and other unwanted results | ||
147 | */ | ||
148 | cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; | ||
149 | if (cq_db->sqn[0] && cq_db->sqn[0] != 0xFFFF) | ||
150 | return; | ||
151 | |||
140 | if (action == CNIC_ARM_CQE) { | 152 | if (action == CNIC_ARM_CQE) { |
141 | cq_index = ep->qp.cqe_exp_seq_sn + | 153 | num_active_cmds = ep->num_active_cmds; |
142 | ep->num_active_cmds / event_coal_div; | 154 | if (num_active_cmds <= event_coal_min) |
143 | cq_index %= (ep->qp.cqe_size * 2 + 1); | 155 | next_index = 1; |
144 | if (!cq_index) { | 156 | else |
157 | next_index = event_coal_min + | ||
158 | (num_active_cmds - event_coal_min) / event_coal_div; | ||
159 | if (!next_index) | ||
160 | next_index = 1; | ||
161 | cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1; | ||
162 | if (cq_index > ep->qp.cqe_size * 2) | ||
163 | cq_index -= ep->qp.cqe_size * 2; | ||
164 | if (!cq_index) | ||
145 | cq_index = 1; | 165 | cq_index = 1; |
146 | cq_db = (struct bnx2i_5771x_cq_db *) | 166 | |
147 | ep->qp.cq_pgtbl_virt; | 167 | cq_db->sqn[0] = cq_index; |
148 | cq_db->sqn[0] = cq_index; | ||
149 | } | ||
150 | } | 168 | } |
151 | } | 169 | } |
152 | 170 | ||
@@ -366,6 +384,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, | |||
366 | struct bnx2i_cmd *bnx2i_cmd; | 384 | struct bnx2i_cmd *bnx2i_cmd; |
367 | struct bnx2i_tmf_request *tmfabort_wqe; | 385 | struct bnx2i_tmf_request *tmfabort_wqe; |
368 | u32 dword; | 386 | u32 dword; |
387 | u32 scsi_lun[2]; | ||
369 | 388 | ||
370 | bnx2i_cmd = (struct bnx2i_cmd *)mtask->dd_data; | 389 | bnx2i_cmd = (struct bnx2i_cmd *)mtask->dd_data; |
371 | tmfabort_hdr = (struct iscsi_tm *)mtask->hdr; | 390 | tmfabort_hdr = (struct iscsi_tm *)mtask->hdr; |
@@ -376,27 +395,35 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, | |||
376 | tmfabort_wqe->op_attr = 0; | 395 | tmfabort_wqe->op_attr = 0; |
377 | tmfabort_wqe->op_attr = | 396 | tmfabort_wqe->op_attr = |
378 | ISCSI_TMF_REQUEST_ALWAYS_ONE | ISCSI_TM_FUNC_ABORT_TASK; | 397 | ISCSI_TMF_REQUEST_ALWAYS_ONE | ISCSI_TM_FUNC_ABORT_TASK; |
379 | tmfabort_wqe->lun[0] = be32_to_cpu(tmfabort_hdr->lun[0]); | ||
380 | tmfabort_wqe->lun[1] = be32_to_cpu(tmfabort_hdr->lun[1]); | ||
381 | 398 | ||
382 | tmfabort_wqe->itt = (mtask->itt | (ISCSI_TASK_TYPE_MPATH << 14)); | 399 | tmfabort_wqe->itt = (mtask->itt | (ISCSI_TASK_TYPE_MPATH << 14)); |
383 | tmfabort_wqe->reserved2 = 0; | 400 | tmfabort_wqe->reserved2 = 0; |
384 | tmfabort_wqe->cmd_sn = be32_to_cpu(tmfabort_hdr->cmdsn); | 401 | tmfabort_wqe->cmd_sn = be32_to_cpu(tmfabort_hdr->cmdsn); |
385 | 402 | ||
386 | ctask = iscsi_itt_to_task(conn, tmfabort_hdr->rtt); | 403 | ctask = iscsi_itt_to_task(conn, tmfabort_hdr->rtt); |
387 | if (!ctask || ctask->sc) | 404 | if (!ctask || !ctask->sc) |
388 | /* | 405 | /* |
389 | * the iscsi layer must have completed the cmd while this | 406 | * the iscsi layer must have completed the cmd while this |
390 | * was starting up. | 407 | * was starting up. |
408 | * | ||
409 | * Note: In the case of a SCSI cmd timeout, the task's sc | ||
410 | * is still active; hence ctask->sc != 0 | ||
411 | * In this case, the task must be aborted | ||
391 | */ | 412 | */ |
392 | return 0; | 413 | return 0; |
414 | |||
393 | ref_sc = ctask->sc; | 415 | ref_sc = ctask->sc; |
394 | 416 | ||
417 | /* Retrieve LUN directly from the ref_sc */ | ||
418 | int_to_scsilun(ref_sc->device->lun, (struct scsi_lun *) scsi_lun); | ||
419 | tmfabort_wqe->lun[0] = be32_to_cpu(scsi_lun[0]); | ||
420 | tmfabort_wqe->lun[1] = be32_to_cpu(scsi_lun[1]); | ||
421 | |||
395 | if (ref_sc->sc_data_direction == DMA_TO_DEVICE) | 422 | if (ref_sc->sc_data_direction == DMA_TO_DEVICE) |
396 | dword = (ISCSI_TASK_TYPE_WRITE << ISCSI_CMD_REQUEST_TYPE_SHIFT); | 423 | dword = (ISCSI_TASK_TYPE_WRITE << ISCSI_CMD_REQUEST_TYPE_SHIFT); |
397 | else | 424 | else |
398 | dword = (ISCSI_TASK_TYPE_READ << ISCSI_CMD_REQUEST_TYPE_SHIFT); | 425 | dword = (ISCSI_TASK_TYPE_READ << ISCSI_CMD_REQUEST_TYPE_SHIFT); |
399 | tmfabort_wqe->ref_itt = (dword | tmfabort_hdr->rtt); | 426 | tmfabort_wqe->ref_itt = (dword | (tmfabort_hdr->rtt & ISCSI_ITT_MASK)); |
400 | tmfabort_wqe->ref_cmd_sn = be32_to_cpu(tmfabort_hdr->refcmdsn); | 427 | tmfabort_wqe->ref_cmd_sn = be32_to_cpu(tmfabort_hdr->refcmdsn); |
401 | 428 | ||
402 | tmfabort_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma; | 429 | tmfabort_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma; |
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 0c4210d48ee8..6d8172e781cf 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -17,8 +17,8 @@ static struct list_head adapter_list = LIST_HEAD_INIT(adapter_list); | |||
17 | static u32 adapter_count; | 17 | static u32 adapter_count; |
18 | 18 | ||
19 | #define DRV_MODULE_NAME "bnx2i" | 19 | #define DRV_MODULE_NAME "bnx2i" |
20 | #define DRV_MODULE_VERSION "2.0.1e" | 20 | #define DRV_MODULE_VERSION "2.1.0" |
21 | #define DRV_MODULE_RELDATE "June 22, 2009" | 21 | #define DRV_MODULE_RELDATE "Dec 06, 2009" |
22 | 22 | ||
23 | static char version[] __devinitdata = | 23 | static char version[] __devinitdata = |
24 | "Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \ | 24 | "Broadcom NetXtreme II iSCSI Driver " DRV_MODULE_NAME \ |
@@ -32,6 +32,10 @@ MODULE_VERSION(DRV_MODULE_VERSION); | |||
32 | 32 | ||
33 | static DEFINE_MUTEX(bnx2i_dev_lock); | 33 | static DEFINE_MUTEX(bnx2i_dev_lock); |
34 | 34 | ||
35 | unsigned int event_coal_min = 24; | ||
36 | module_param(event_coal_min, int, 0664); | ||
37 | MODULE_PARM_DESC(event_coal_min, "Event Coalescing Minimum Commands"); | ||
38 | |||
35 | unsigned int event_coal_div = 1; | 39 | unsigned int event_coal_div = 1; |
36 | module_param(event_coal_div, int, 0664); | 40 | module_param(event_coal_div, int, 0664); |
37 | MODULE_PARM_DESC(event_coal_div, "Event Coalescing Divide Factor"); | 41 | MODULE_PARM_DESC(event_coal_div, "Event Coalescing Divide Factor"); |
@@ -83,8 +87,12 @@ void bnx2i_identify_device(struct bnx2i_hba *hba) | |||
83 | set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type); | 87 | set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type); |
84 | hba->mail_queue_access = BNX2I_MQ_BIN_MODE; | 88 | hba->mail_queue_access = BNX2I_MQ_BIN_MODE; |
85 | } else if (hba->pci_did == PCI_DEVICE_ID_NX2_57710 || | 89 | } else if (hba->pci_did == PCI_DEVICE_ID_NX2_57710 || |
86 | hba->pci_did == PCI_DEVICE_ID_NX2_57711) | 90 | hba->pci_did == PCI_DEVICE_ID_NX2_57711 || |
91 | hba->pci_did == PCI_DEVICE_ID_NX2_57711E) | ||
87 | set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type); | 92 | set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type); |
93 | else | ||
94 | printk(KERN_ALERT "bnx2i: unknown device, 0x%x\n", | ||
95 | hba->pci_did); | ||
88 | } | 96 | } |
89 | 97 | ||
90 | 98 | ||
@@ -363,7 +371,7 @@ static int __init bnx2i_mod_init(void) | |||
363 | 371 | ||
364 | printk(KERN_INFO "%s", version); | 372 | printk(KERN_INFO "%s", version); |
365 | 373 | ||
366 | if (!is_power_of_2(sq_size)) | 374 | if (sq_size && !is_power_of_2(sq_size)) |
367 | sq_size = roundup_pow_of_two(sq_size); | 375 | sq_size = roundup_pow_of_two(sq_size); |
368 | 376 | ||
369 | mutex_init(&bnx2i_dev_lock); | 377 | mutex_init(&bnx2i_dev_lock); |
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 132898c88d5e..33b2294625bb 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c | |||
@@ -485,7 +485,6 @@ static int bnx2i_setup_cmd_pool(struct bnx2i_hba *hba, | |||
485 | struct iscsi_task *task = session->cmds[i]; | 485 | struct iscsi_task *task = session->cmds[i]; |
486 | struct bnx2i_cmd *cmd = task->dd_data; | 486 | struct bnx2i_cmd *cmd = task->dd_data; |
487 | 487 | ||
488 | /* Anil */ | ||
489 | task->hdr = &cmd->hdr; | 488 | task->hdr = &cmd->hdr; |
490 | task->hdr_max = sizeof(struct iscsi_hdr); | 489 | task->hdr_max = sizeof(struct iscsi_hdr); |
491 | 490 | ||
@@ -765,7 +764,6 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) | |||
765 | hba->pci_svid = hba->pcidev->subsystem_vendor; | 764 | hba->pci_svid = hba->pcidev->subsystem_vendor; |
766 | hba->pci_func = PCI_FUNC(hba->pcidev->devfn); | 765 | hba->pci_func = PCI_FUNC(hba->pcidev->devfn); |
767 | hba->pci_devno = PCI_SLOT(hba->pcidev->devfn); | 766 | hba->pci_devno = PCI_SLOT(hba->pcidev->devfn); |
768 | bnx2i_identify_device(hba); | ||
769 | 767 | ||
770 | bnx2i_identify_device(hba); | 768 | bnx2i_identify_device(hba); |
771 | bnx2i_setup_host_queue_size(hba, shost); | 769 | bnx2i_setup_host_queue_size(hba, shost); |