Lines Matching refs:qp
153 cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; in bnx2i_arm_cq_event_coalescing()
170 cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1; in bnx2i_arm_cq_event_coalescing()
171 if (cq_index > ep->qp.cqe_size * 2) in bnx2i_arm_cq_event_coalescing()
172 cq_index -= ep->qp.cqe_size * 2; in bnx2i_arm_cq_event_coalescing()
195 if (!bnx2i_conn->ep->qp.rqe_left) in bnx2i_get_rq_buf()
198 bnx2i_conn->ep->qp.rqe_left--; in bnx2i_get_rq_buf()
199 memcpy(ptr, (u8 *) bnx2i_conn->ep->qp.rq_cons_qe, len); in bnx2i_get_rq_buf()
200 if (bnx2i_conn->ep->qp.rq_cons_qe == bnx2i_conn->ep->qp.rq_last_qe) { in bnx2i_get_rq_buf()
201 bnx2i_conn->ep->qp.rq_cons_qe = bnx2i_conn->ep->qp.rq_first_qe; in bnx2i_get_rq_buf()
202 bnx2i_conn->ep->qp.rq_cons_idx = 0; in bnx2i_get_rq_buf()
204 bnx2i_conn->ep->qp.rq_cons_qe++; in bnx2i_get_rq_buf()
205 bnx2i_conn->ep->qp.rq_cons_idx++; in bnx2i_get_rq_buf()
220 writel(cpu_to_le32(msg), conn->ep->qp.ctx_base); in bnx2i_ring_577xx_doorbell()
234 u16 hi_bit = (bnx2i_conn->ep->qp.rq_prod_idx & 0x8000); in bnx2i_put_rq_buf()
237 ep->qp.rqe_left += count; in bnx2i_put_rq_buf()
238 ep->qp.rq_prod_idx &= 0x7FFF; in bnx2i_put_rq_buf()
239 ep->qp.rq_prod_idx += count; in bnx2i_put_rq_buf()
241 if (ep->qp.rq_prod_idx > bnx2i_conn->hba->max_rqes) { in bnx2i_put_rq_buf()
242 ep->qp.rq_prod_idx %= bnx2i_conn->hba->max_rqes; in bnx2i_put_rq_buf()
244 ep->qp.rq_prod_idx |= 0x8000; in bnx2i_put_rq_buf()
246 ep->qp.rq_prod_idx |= hi_bit; in bnx2i_put_rq_buf()
249 rq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.rq_pgtbl_virt; in bnx2i_put_rq_buf()
250 rq_db->prod_idx = ep->qp.rq_prod_idx; in bnx2i_put_rq_buf()
253 writew(ep->qp.rq_prod_idx, in bnx2i_put_rq_buf()
254 ep->qp.ctx_base + CNIC_RECV_DOORBELL); in bnx2i_put_rq_buf()
277 sq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.sq_pgtbl_virt; in bnx2i_ring_sq_dbell()
278 sq_db->prod_idx = ep->qp.sq_prod_idx; in bnx2i_ring_sq_dbell()
281 writew(count, ep->qp.ctx_base + CNIC_SEND_DOORBELL); in bnx2i_ring_sq_dbell()
300 if (bnx2i_conn->ep->qp.sq_prod_qe == in bnx2i_ring_dbell_update_sq_params()
301 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
302 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
303 bnx2i_conn->ep->qp.sq_first_qe; in bnx2i_ring_dbell_update_sq_params()
305 bnx2i_conn->ep->qp.sq_prod_qe++; in bnx2i_ring_dbell_update_sq_params()
307 if ((bnx2i_conn->ep->qp.sq_prod_qe + count) <= in bnx2i_ring_dbell_update_sq_params()
308 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
309 bnx2i_conn->ep->qp.sq_prod_qe += count; in bnx2i_ring_dbell_update_sq_params()
311 tmp_cnt = bnx2i_conn->ep->qp.sq_last_qe - in bnx2i_ring_dbell_update_sq_params()
312 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_ring_dbell_update_sq_params()
313 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
314 &bnx2i_conn->ep->qp.sq_first_qe[count - in bnx2i_ring_dbell_update_sq_params()
318 bnx2i_conn->ep->qp.sq_prod_idx += count; in bnx2i_ring_dbell_update_sq_params()
320 bnx2i_ring_sq_dbell(bnx2i_conn, bnx2i_conn->ep->qp.sq_prod_idx); in bnx2i_ring_dbell_update_sq_params()
343 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_login()
402 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_tmf()
473 text_wqe = (struct bnx2i_text_request *) bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_text()
519 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_scsicmd()
550 nopout_wqe = (struct bnx2i_nop_out_request *)ep->qp.sq_prod_qe; in bnx2i_send_iscsi_nopout()
613 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_logout()
747 (struct bnx2i_cleanup_request *)cmd->conn->ep->qp.sq_prod_qe; in bnx2i_send_cmd_cleanup_req()
817 dma_addr = ep->qp.sq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
821 dma_addr = ep->qp.cq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
829 dma_addr = ep->qp.rq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
833 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
838 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
878 dma_addr = ep->qp.sq_pgtbl_phys + ISCSI_SQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
882 dma_addr = ep->qp.cq_pgtbl_phys + ISCSI_CQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
890 dma_addr = ep->qp.rq_pgtbl_phys + ISCSI_RQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
894 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
898 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
907 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
963 memset(ep->qp.sq_pgtbl_virt, 0, ep->qp.sq_pgtbl_size); in setup_qp_page_tables()
964 num_pages = ep->qp.sq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
965 page = ep->qp.sq_phys; in setup_qp_page_tables()
968 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in setup_qp_page_tables()
970 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in setup_qp_page_tables()
991 memset(ep->qp.rq_pgtbl_virt, 0, ep->qp.rq_pgtbl_size); in setup_qp_page_tables()
992 num_pages = ep->qp.rq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
993 page = ep->qp.rq_phys; in setup_qp_page_tables()
996 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in setup_qp_page_tables()
998 ptbl = (u32 *) ep->qp.rq_pgtbl_virt; in setup_qp_page_tables()
1019 memset(ep->qp.cq_pgtbl_virt, 0, ep->qp.cq_pgtbl_size); in setup_qp_page_tables()
1020 num_pages = ep->qp.cq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
1021 page = ep->qp.cq_phys; in setup_qp_page_tables()
1024 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in setup_qp_page_tables()
1026 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in setup_qp_page_tables()
1067 ep->qp.sq_mem_size = hba->max_sqes * BNX2I_SQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1068 ep->qp.sq_mem_size = in bnx2i_alloc_qp_resc()
1069 (ep->qp.sq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1070 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1071 (ep->qp.sq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1072 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1073 (ep->qp.sq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1075 ep->qp.sq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1076 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_alloc_qp_resc()
1077 &ep->qp.sq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1078 if (!ep->qp.sq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1080 ep->qp.sq_pgtbl_size); in bnx2i_alloc_qp_resc()
1085 ep->qp.sq_virt = in bnx2i_alloc_qp_resc()
1086 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_alloc_qp_resc()
1087 &ep->qp.sq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1088 if (!ep->qp.sq_virt) { in bnx2i_alloc_qp_resc()
1090 ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1094 memset(ep->qp.sq_virt, 0x00, ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1095 ep->qp.sq_first_qe = ep->qp.sq_virt; in bnx2i_alloc_qp_resc()
1096 ep->qp.sq_prod_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1097 ep->qp.sq_cons_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1098 ep->qp.sq_last_qe = &ep->qp.sq_first_qe[hba->max_sqes - 1]; in bnx2i_alloc_qp_resc()
1099 ep->qp.sq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1100 ep->qp.sq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1101 ep->qp.sqe_left = hba->max_sqes; in bnx2i_alloc_qp_resc()
1104 ep->qp.cq_mem_size = hba->max_cqes * BNX2I_CQE_SIZE; in bnx2i_alloc_qp_resc()
1105 ep->qp.cq_mem_size = in bnx2i_alloc_qp_resc()
1106 (ep->qp.cq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1107 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1108 (ep->qp.cq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1109 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1110 (ep->qp.cq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1112 ep->qp.cq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1113 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_alloc_qp_resc()
1114 &ep->qp.cq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1115 if (!ep->qp.cq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1117 ep->qp.cq_pgtbl_size); in bnx2i_alloc_qp_resc()
1122 ep->qp.cq_virt = in bnx2i_alloc_qp_resc()
1123 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_alloc_qp_resc()
1124 &ep->qp.cq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1125 if (!ep->qp.cq_virt) { in bnx2i_alloc_qp_resc()
1127 ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1130 memset(ep->qp.cq_virt, 0x00, ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1132 ep->qp.cq_first_qe = ep->qp.cq_virt; in bnx2i_alloc_qp_resc()
1133 ep->qp.cq_prod_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1134 ep->qp.cq_cons_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1135 ep->qp.cq_last_qe = &ep->qp.cq_first_qe[hba->max_cqes - 1]; in bnx2i_alloc_qp_resc()
1136 ep->qp.cq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1137 ep->qp.cq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1138 ep->qp.cqe_left = hba->max_cqes; in bnx2i_alloc_qp_resc()
1139 ep->qp.cqe_exp_seq_sn = ISCSI_INITIAL_SN; in bnx2i_alloc_qp_resc()
1140 ep->qp.cqe_size = hba->max_cqes; in bnx2i_alloc_qp_resc()
1143 cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; in bnx2i_alloc_qp_resc()
1147 ep->qp.rq_mem_size = hba->max_rqes * BNX2I_RQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1148 ep->qp.rq_mem_size = in bnx2i_alloc_qp_resc()
1149 (ep->qp.rq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1150 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1151 (ep->qp.rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1152 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1153 (ep->qp.rq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1155 ep->qp.rq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1156 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_alloc_qp_resc()
1157 &ep->qp.rq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1158 if (!ep->qp.rq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1160 ep->qp.rq_pgtbl_size); in bnx2i_alloc_qp_resc()
1165 ep->qp.rq_virt = in bnx2i_alloc_qp_resc()
1166 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_alloc_qp_resc()
1167 &ep->qp.rq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1168 if (!ep->qp.rq_virt) { in bnx2i_alloc_qp_resc()
1170 ep->qp.rq_mem_size); in bnx2i_alloc_qp_resc()
1174 ep->qp.rq_first_qe = ep->qp.rq_virt; in bnx2i_alloc_qp_resc()
1175 ep->qp.rq_prod_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1176 ep->qp.rq_cons_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1177 ep->qp.rq_last_qe = &ep->qp.rq_first_qe[hba->max_rqes - 1]; in bnx2i_alloc_qp_resc()
1178 ep->qp.rq_prod_idx = 0x8000; in bnx2i_alloc_qp_resc()
1179 ep->qp.rq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1180 ep->qp.rqe_left = hba->max_rqes; in bnx2i_alloc_qp_resc()
1202 if (ep->qp.ctx_base) { in bnx2i_free_qp_resc()
1203 iounmap(ep->qp.ctx_base); in bnx2i_free_qp_resc()
1204 ep->qp.ctx_base = NULL; in bnx2i_free_qp_resc()
1207 if (ep->qp.sq_pgtbl_virt) { in bnx2i_free_qp_resc()
1208 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_free_qp_resc()
1209 ep->qp.sq_pgtbl_virt, ep->qp.sq_pgtbl_phys); in bnx2i_free_qp_resc()
1210 ep->qp.sq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1211 ep->qp.sq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1213 if (ep->qp.sq_virt) { in bnx2i_free_qp_resc()
1214 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_free_qp_resc()
1215 ep->qp.sq_virt, ep->qp.sq_phys); in bnx2i_free_qp_resc()
1216 ep->qp.sq_virt = NULL; in bnx2i_free_qp_resc()
1217 ep->qp.sq_phys = 0; in bnx2i_free_qp_resc()
1221 if (ep->qp.rq_pgtbl_virt) { in bnx2i_free_qp_resc()
1222 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_free_qp_resc()
1223 ep->qp.rq_pgtbl_virt, ep->qp.rq_pgtbl_phys); in bnx2i_free_qp_resc()
1224 ep->qp.rq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1225 ep->qp.rq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1227 if (ep->qp.rq_virt) { in bnx2i_free_qp_resc()
1228 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_free_qp_resc()
1229 ep->qp.rq_virt, ep->qp.rq_phys); in bnx2i_free_qp_resc()
1230 ep->qp.rq_virt = NULL; in bnx2i_free_qp_resc()
1231 ep->qp.rq_phys = 0; in bnx2i_free_qp_resc()
1235 if (ep->qp.cq_pgtbl_virt) { in bnx2i_free_qp_resc()
1236 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_free_qp_resc()
1237 ep->qp.cq_pgtbl_virt, ep->qp.cq_pgtbl_phys); in bnx2i_free_qp_resc()
1238 ep->qp.cq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1239 ep->qp.cq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1241 if (ep->qp.cq_virt) { in bnx2i_free_qp_resc()
1242 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_free_qp_resc()
1243 ep->qp.cq_virt, ep->qp.cq_phys); in bnx2i_free_qp_resc()
1244 ep->qp.cq_virt = NULL; in bnx2i_free_qp_resc()
1245 ep->qp.cq_phys = 0; in bnx2i_free_qp_resc()
1981 struct qp_info *qp; in bnx2i_process_new_cqes() local
1989 qp = &bnx2i_conn->ep->qp; in bnx2i_process_new_cqes()
1991 if (!qp->cq_virt) { in bnx2i_process_new_cqes()
1997 nopin = (struct bnx2i_nop_in_msg *) qp->cq_cons_qe; in bnx2i_process_new_cqes()
1998 if (nopin->cq_req_sn != qp->cqe_exp_seq_sn) in bnx2i_process_new_cqes()
2024 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2028 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2032 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2036 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2040 qp->cq_cons_qe)) in bnx2i_process_new_cqes()
2045 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2049 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2054 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2058 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2083 qp->cqe_exp_seq_sn++; in bnx2i_process_new_cqes()
2084 if (qp->cqe_exp_seq_sn == (qp->cqe_size * 2 + 1)) in bnx2i_process_new_cqes()
2085 qp->cqe_exp_seq_sn = ISCSI_INITIAL_SN; in bnx2i_process_new_cqes()
2087 if (qp->cq_cons_qe == qp->cq_last_qe) { in bnx2i_process_new_cqes()
2088 qp->cq_cons_qe = qp->cq_first_qe; in bnx2i_process_new_cqes()
2089 qp->cq_cons_idx = 0; in bnx2i_process_new_cqes()
2091 qp->cq_cons_qe++; in bnx2i_process_new_cqes()
2092 qp->cq_cons_idx++; in bnx2i_process_new_cqes()
2488 ep->qp.ctx_base = NULL; in bnx2i_process_ofld_cmpl()
2744 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); in bnx2i_map_ep_dbell_regs()
2763 ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off, in bnx2i_map_ep_dbell_regs()
2765 if (!ep->qp.ctx_base) in bnx2i_map_ep_dbell_regs()