diff options
Diffstat (limited to 'drivers/scsi/bnx2i/bnx2i_hwi.c')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index f0b89513faed..5c54a2d9b834 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -138,7 +138,6 @@ void bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action) | |||
138 | u16 next_index; | 138 | u16 next_index; |
139 | u32 num_active_cmds; | 139 | u32 num_active_cmds; |
140 | 140 | ||
141 | |||
142 | /* Coalesce CQ entries only on 10G devices */ | 141 | /* Coalesce CQ entries only on 10G devices */ |
143 | if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) | 142 | if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) |
144 | return; | 143 | return; |
@@ -148,16 +147,19 @@ void bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action) | |||
148 | * interrupts and other unwanted results | 147 | * interrupts and other unwanted results |
149 | */ | 148 | */ |
150 | cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; | 149 | cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; |
151 | if (cq_db->sqn[0] && cq_db->sqn[0] != 0xFFFF) | ||
152 | return; | ||
153 | 150 | ||
154 | if (action == CNIC_ARM_CQE) { | 151 | if (action != CNIC_ARM_CQE_FP) |
152 | if (cq_db->sqn[0] && cq_db->sqn[0] != 0xFFFF) | ||
153 | return; | ||
154 | |||
155 | if (action == CNIC_ARM_CQE || action == CNIC_ARM_CQE_FP) { | ||
155 | num_active_cmds = ep->num_active_cmds; | 156 | num_active_cmds = ep->num_active_cmds; |
156 | if (num_active_cmds <= event_coal_min) | 157 | if (num_active_cmds <= event_coal_min) |
157 | next_index = 1; | 158 | next_index = 1; |
158 | else | 159 | else |
159 | next_index = event_coal_min + | 160 | next_index = event_coal_min + |
160 | (num_active_cmds - event_coal_min) / event_coal_div; | 161 | ((num_active_cmds - event_coal_min) >> |
162 | ep->ec_shift); | ||
161 | if (!next_index) | 163 | if (!next_index) |
162 | next_index = 1; | 164 | next_index = 1; |
163 | cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1; | 165 | cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1; |
@@ -1274,6 +1276,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba) | |||
1274 | iscsi_init.dummy_buffer_addr_hi = | 1276 | iscsi_init.dummy_buffer_addr_hi = |
1275 | (u32) ((u64) hba->dummy_buf_dma >> 32); | 1277 | (u32) ((u64) hba->dummy_buf_dma >> 32); |
1276 | 1278 | ||
1279 | hba->num_ccell = hba->max_sqes >> 1; | ||
1277 | hba->ctx_ccell_tasks = | 1280 | hba->ctx_ccell_tasks = |
1278 | ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16)); | 1281 | ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16)); |
1279 | iscsi_init.num_ccells_per_conn = hba->num_ccell; | 1282 | iscsi_init.num_ccells_per_conn = hba->num_ccell; |
@@ -1934,7 +1937,6 @@ cqe_out: | |||
1934 | qp->cq_cons_idx++; | 1937 | qp->cq_cons_idx++; |
1935 | } | 1938 | } |
1936 | } | 1939 | } |
1937 | bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE); | ||
1938 | } | 1940 | } |
1939 | 1941 | ||
1940 | /** | 1942 | /** |
@@ -1948,22 +1950,23 @@ cqe_out: | |||
1948 | static void bnx2i_fastpath_notification(struct bnx2i_hba *hba, | 1950 | static void bnx2i_fastpath_notification(struct bnx2i_hba *hba, |
1949 | struct iscsi_kcqe *new_cqe_kcqe) | 1951 | struct iscsi_kcqe *new_cqe_kcqe) |
1950 | { | 1952 | { |
1951 | struct bnx2i_conn *conn; | 1953 | struct bnx2i_conn *bnx2i_conn; |
1952 | u32 iscsi_cid; | 1954 | u32 iscsi_cid; |
1953 | 1955 | ||
1954 | iscsi_cid = new_cqe_kcqe->iscsi_conn_id; | 1956 | iscsi_cid = new_cqe_kcqe->iscsi_conn_id; |
1955 | conn = bnx2i_get_conn_from_id(hba, iscsi_cid); | 1957 | bnx2i_conn = bnx2i_get_conn_from_id(hba, iscsi_cid); |
1956 | 1958 | ||
1957 | if (!conn) { | 1959 | if (!bnx2i_conn) { |
1958 | printk(KERN_ALERT "cid #%x not valid\n", iscsi_cid); | 1960 | printk(KERN_ALERT "cid #%x not valid\n", iscsi_cid); |
1959 | return; | 1961 | return; |
1960 | } | 1962 | } |
1961 | if (!conn->ep) { | 1963 | if (!bnx2i_conn->ep) { |
1962 | printk(KERN_ALERT "cid #%x - ep not bound\n", iscsi_cid); | 1964 | printk(KERN_ALERT "cid #%x - ep not bound\n", iscsi_cid); |
1963 | return; | 1965 | return; |
1964 | } | 1966 | } |
1965 | 1967 | bnx2i_process_new_cqes(bnx2i_conn); | |
1966 | bnx2i_process_new_cqes(conn); | 1968 | bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE_FP); |
1969 | bnx2i_process_new_cqes(bnx2i_conn); | ||
1967 | } | 1970 | } |
1968 | 1971 | ||
1969 | 1972 | ||