• Home
  • Raw
  • Download

Lines Matching refs:qp

151 	cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt;  in bnx2i_arm_cq_event_coalescing()
168 cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1; in bnx2i_arm_cq_event_coalescing()
169 if (cq_index > ep->qp.cqe_size * 2) in bnx2i_arm_cq_event_coalescing()
170 cq_index -= ep->qp.cqe_size * 2; in bnx2i_arm_cq_event_coalescing()
193 if (!bnx2i_conn->ep->qp.rqe_left) in bnx2i_get_rq_buf()
196 bnx2i_conn->ep->qp.rqe_left--; in bnx2i_get_rq_buf()
197 memcpy(ptr, (u8 *) bnx2i_conn->ep->qp.rq_cons_qe, len); in bnx2i_get_rq_buf()
198 if (bnx2i_conn->ep->qp.rq_cons_qe == bnx2i_conn->ep->qp.rq_last_qe) { in bnx2i_get_rq_buf()
199 bnx2i_conn->ep->qp.rq_cons_qe = bnx2i_conn->ep->qp.rq_first_qe; in bnx2i_get_rq_buf()
200 bnx2i_conn->ep->qp.rq_cons_idx = 0; in bnx2i_get_rq_buf()
202 bnx2i_conn->ep->qp.rq_cons_qe++; in bnx2i_get_rq_buf()
203 bnx2i_conn->ep->qp.rq_cons_idx++; in bnx2i_get_rq_buf()
218 writel(cpu_to_le32(msg), conn->ep->qp.ctx_base); in bnx2i_ring_577xx_doorbell()
232 u16 hi_bit = (bnx2i_conn->ep->qp.rq_prod_idx & 0x8000); in bnx2i_put_rq_buf()
235 ep->qp.rqe_left += count; in bnx2i_put_rq_buf()
236 ep->qp.rq_prod_idx &= 0x7FFF; in bnx2i_put_rq_buf()
237 ep->qp.rq_prod_idx += count; in bnx2i_put_rq_buf()
239 if (ep->qp.rq_prod_idx > bnx2i_conn->hba->max_rqes) { in bnx2i_put_rq_buf()
240 ep->qp.rq_prod_idx %= bnx2i_conn->hba->max_rqes; in bnx2i_put_rq_buf()
242 ep->qp.rq_prod_idx |= 0x8000; in bnx2i_put_rq_buf()
244 ep->qp.rq_prod_idx |= hi_bit; in bnx2i_put_rq_buf()
247 rq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.rq_pgtbl_virt; in bnx2i_put_rq_buf()
248 rq_db->prod_idx = ep->qp.rq_prod_idx; in bnx2i_put_rq_buf()
251 writew(ep->qp.rq_prod_idx, in bnx2i_put_rq_buf()
252 ep->qp.ctx_base + CNIC_RECV_DOORBELL); in bnx2i_put_rq_buf()
275 sq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.sq_pgtbl_virt; in bnx2i_ring_sq_dbell()
276 sq_db->prod_idx = ep->qp.sq_prod_idx; in bnx2i_ring_sq_dbell()
279 writew(count, ep->qp.ctx_base + CNIC_SEND_DOORBELL); in bnx2i_ring_sq_dbell()
298 if (bnx2i_conn->ep->qp.sq_prod_qe == in bnx2i_ring_dbell_update_sq_params()
299 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
300 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
301 bnx2i_conn->ep->qp.sq_first_qe; in bnx2i_ring_dbell_update_sq_params()
303 bnx2i_conn->ep->qp.sq_prod_qe++; in bnx2i_ring_dbell_update_sq_params()
305 if ((bnx2i_conn->ep->qp.sq_prod_qe + count) <= in bnx2i_ring_dbell_update_sq_params()
306 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
307 bnx2i_conn->ep->qp.sq_prod_qe += count; in bnx2i_ring_dbell_update_sq_params()
309 tmp_cnt = bnx2i_conn->ep->qp.sq_last_qe - in bnx2i_ring_dbell_update_sq_params()
310 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_ring_dbell_update_sq_params()
311 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
312 &bnx2i_conn->ep->qp.sq_first_qe[count - in bnx2i_ring_dbell_update_sq_params()
316 bnx2i_conn->ep->qp.sq_prod_idx += count; in bnx2i_ring_dbell_update_sq_params()
318 bnx2i_ring_sq_dbell(bnx2i_conn, bnx2i_conn->ep->qp.sq_prod_idx); in bnx2i_ring_dbell_update_sq_params()
341 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_login()
400 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_tmf()
471 text_wqe = (struct bnx2i_text_request *) bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_text()
517 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_scsicmd()
548 nopout_wqe = (struct bnx2i_nop_out_request *)ep->qp.sq_prod_qe; in bnx2i_send_iscsi_nopout()
611 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_logout()
745 (struct bnx2i_cleanup_request *)cmd->conn->ep->qp.sq_prod_qe; in bnx2i_send_cmd_cleanup_req()
815 dma_addr = ep->qp.sq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
819 dma_addr = ep->qp.cq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
827 dma_addr = ep->qp.rq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
831 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
836 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
876 dma_addr = ep->qp.sq_pgtbl_phys + ISCSI_SQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
880 dma_addr = ep->qp.cq_pgtbl_phys + ISCSI_CQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
888 dma_addr = ep->qp.rq_pgtbl_phys + ISCSI_RQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
892 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
896 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
905 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
961 memset(ep->qp.sq_pgtbl_virt, 0, ep->qp.sq_pgtbl_size); in setup_qp_page_tables()
962 num_pages = ep->qp.sq_mem_size / PAGE_SIZE; in setup_qp_page_tables()
963 page = ep->qp.sq_phys; in setup_qp_page_tables()
966 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in setup_qp_page_tables()
968 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in setup_qp_page_tables()
989 memset(ep->qp.rq_pgtbl_virt, 0, ep->qp.rq_pgtbl_size); in setup_qp_page_tables()
990 num_pages = ep->qp.rq_mem_size / PAGE_SIZE; in setup_qp_page_tables()
991 page = ep->qp.rq_phys; in setup_qp_page_tables()
994 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in setup_qp_page_tables()
996 ptbl = (u32 *) ep->qp.rq_pgtbl_virt; in setup_qp_page_tables()
1017 memset(ep->qp.cq_pgtbl_virt, 0, ep->qp.cq_pgtbl_size); in setup_qp_page_tables()
1018 num_pages = ep->qp.cq_mem_size / PAGE_SIZE; in setup_qp_page_tables()
1019 page = ep->qp.cq_phys; in setup_qp_page_tables()
1022 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in setup_qp_page_tables()
1024 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in setup_qp_page_tables()
1065 ep->qp.sq_mem_size = hba->max_sqes * BNX2I_SQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1066 ep->qp.sq_mem_size = in bnx2i_alloc_qp_resc()
1067 (ep->qp.sq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; in bnx2i_alloc_qp_resc()
1068 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1069 (ep->qp.sq_mem_size / PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1070 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1071 (ep->qp.sq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; in bnx2i_alloc_qp_resc()
1073 ep->qp.sq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1074 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_alloc_qp_resc()
1075 &ep->qp.sq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1076 if (!ep->qp.sq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1078 ep->qp.sq_pgtbl_size); in bnx2i_alloc_qp_resc()
1083 ep->qp.sq_virt = in bnx2i_alloc_qp_resc()
1084 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_alloc_qp_resc()
1085 &ep->qp.sq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1086 if (!ep->qp.sq_virt) { in bnx2i_alloc_qp_resc()
1088 ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1092 memset(ep->qp.sq_virt, 0x00, ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1093 ep->qp.sq_first_qe = ep->qp.sq_virt; in bnx2i_alloc_qp_resc()
1094 ep->qp.sq_prod_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1095 ep->qp.sq_cons_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1096 ep->qp.sq_last_qe = &ep->qp.sq_first_qe[hba->max_sqes - 1]; in bnx2i_alloc_qp_resc()
1097 ep->qp.sq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1098 ep->qp.sq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1099 ep->qp.sqe_left = hba->max_sqes; in bnx2i_alloc_qp_resc()
1102 ep->qp.cq_mem_size = hba->max_cqes * BNX2I_CQE_SIZE; in bnx2i_alloc_qp_resc()
1103 ep->qp.cq_mem_size = in bnx2i_alloc_qp_resc()
1104 (ep->qp.cq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; in bnx2i_alloc_qp_resc()
1105 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1106 (ep->qp.cq_mem_size / PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1107 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1108 (ep->qp.cq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; in bnx2i_alloc_qp_resc()
1110 ep->qp.cq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1111 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_alloc_qp_resc()
1112 &ep->qp.cq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1113 if (!ep->qp.cq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1115 ep->qp.cq_pgtbl_size); in bnx2i_alloc_qp_resc()
1120 ep->qp.cq_virt = in bnx2i_alloc_qp_resc()
1121 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_alloc_qp_resc()
1122 &ep->qp.cq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1123 if (!ep->qp.cq_virt) { in bnx2i_alloc_qp_resc()
1125 ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1128 memset(ep->qp.cq_virt, 0x00, ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1130 ep->qp.cq_first_qe = ep->qp.cq_virt; in bnx2i_alloc_qp_resc()
1131 ep->qp.cq_prod_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1132 ep->qp.cq_cons_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1133 ep->qp.cq_last_qe = &ep->qp.cq_first_qe[hba->max_cqes - 1]; in bnx2i_alloc_qp_resc()
1134 ep->qp.cq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1135 ep->qp.cq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1136 ep->qp.cqe_left = hba->max_cqes; in bnx2i_alloc_qp_resc()
1137 ep->qp.cqe_exp_seq_sn = ISCSI_INITIAL_SN; in bnx2i_alloc_qp_resc()
1138 ep->qp.cqe_size = hba->max_cqes; in bnx2i_alloc_qp_resc()
1141 cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; in bnx2i_alloc_qp_resc()
1145 ep->qp.rq_mem_size = hba->max_rqes * BNX2I_RQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1146 ep->qp.rq_mem_size = in bnx2i_alloc_qp_resc()
1147 (ep->qp.rq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; in bnx2i_alloc_qp_resc()
1148 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1149 (ep->qp.rq_mem_size / PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1150 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1151 (ep->qp.rq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; in bnx2i_alloc_qp_resc()
1153 ep->qp.rq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1154 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_alloc_qp_resc()
1155 &ep->qp.rq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1156 if (!ep->qp.rq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1158 ep->qp.rq_pgtbl_size); in bnx2i_alloc_qp_resc()
1163 ep->qp.rq_virt = in bnx2i_alloc_qp_resc()
1164 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_alloc_qp_resc()
1165 &ep->qp.rq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1166 if (!ep->qp.rq_virt) { in bnx2i_alloc_qp_resc()
1168 ep->qp.rq_mem_size); in bnx2i_alloc_qp_resc()
1172 ep->qp.rq_first_qe = ep->qp.rq_virt; in bnx2i_alloc_qp_resc()
1173 ep->qp.rq_prod_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1174 ep->qp.rq_cons_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1175 ep->qp.rq_last_qe = &ep->qp.rq_first_qe[hba->max_rqes - 1]; in bnx2i_alloc_qp_resc()
1176 ep->qp.rq_prod_idx = 0x8000; in bnx2i_alloc_qp_resc()
1177 ep->qp.rq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1178 ep->qp.rqe_left = hba->max_rqes; in bnx2i_alloc_qp_resc()
1200 if (ep->qp.ctx_base) { in bnx2i_free_qp_resc()
1201 iounmap(ep->qp.ctx_base); in bnx2i_free_qp_resc()
1202 ep->qp.ctx_base = NULL; in bnx2i_free_qp_resc()
1205 if (ep->qp.sq_pgtbl_virt) { in bnx2i_free_qp_resc()
1206 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_free_qp_resc()
1207 ep->qp.sq_pgtbl_virt, ep->qp.sq_pgtbl_phys); in bnx2i_free_qp_resc()
1208 ep->qp.sq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1209 ep->qp.sq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1211 if (ep->qp.sq_virt) { in bnx2i_free_qp_resc()
1212 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_free_qp_resc()
1213 ep->qp.sq_virt, ep->qp.sq_phys); in bnx2i_free_qp_resc()
1214 ep->qp.sq_virt = NULL; in bnx2i_free_qp_resc()
1215 ep->qp.sq_phys = 0; in bnx2i_free_qp_resc()
1219 if (ep->qp.rq_pgtbl_virt) { in bnx2i_free_qp_resc()
1220 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_free_qp_resc()
1221 ep->qp.rq_pgtbl_virt, ep->qp.rq_pgtbl_phys); in bnx2i_free_qp_resc()
1222 ep->qp.rq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1223 ep->qp.rq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1225 if (ep->qp.rq_virt) { in bnx2i_free_qp_resc()
1226 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_free_qp_resc()
1227 ep->qp.rq_virt, ep->qp.rq_phys); in bnx2i_free_qp_resc()
1228 ep->qp.rq_virt = NULL; in bnx2i_free_qp_resc()
1229 ep->qp.rq_phys = 0; in bnx2i_free_qp_resc()
1233 if (ep->qp.cq_pgtbl_virt) { in bnx2i_free_qp_resc()
1234 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_free_qp_resc()
1235 ep->qp.cq_pgtbl_virt, ep->qp.cq_pgtbl_phys); in bnx2i_free_qp_resc()
1236 ep->qp.cq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1237 ep->qp.cq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1239 if (ep->qp.cq_virt) { in bnx2i_free_qp_resc()
1240 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_free_qp_resc()
1241 ep->qp.cq_virt, ep->qp.cq_phys); in bnx2i_free_qp_resc()
1242 ep->qp.cq_virt = NULL; in bnx2i_free_qp_resc()
1243 ep->qp.cq_phys = 0; in bnx2i_free_qp_resc()
1979 struct qp_info *qp; in bnx2i_process_new_cqes() local
1987 qp = &bnx2i_conn->ep->qp; in bnx2i_process_new_cqes()
1989 if (!qp->cq_virt) { in bnx2i_process_new_cqes()
1995 nopin = (struct bnx2i_nop_in_msg *) qp->cq_cons_qe; in bnx2i_process_new_cqes()
1996 if (nopin->cq_req_sn != qp->cqe_exp_seq_sn) in bnx2i_process_new_cqes()
2022 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2026 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2030 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2034 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2038 qp->cq_cons_qe)) in bnx2i_process_new_cqes()
2043 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2047 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2052 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2056 qp->cq_cons_qe); in bnx2i_process_new_cqes()
2081 qp->cqe_exp_seq_sn++; in bnx2i_process_new_cqes()
2082 if (qp->cqe_exp_seq_sn == (qp->cqe_size * 2 + 1)) in bnx2i_process_new_cqes()
2083 qp->cqe_exp_seq_sn = ISCSI_INITIAL_SN; in bnx2i_process_new_cqes()
2085 if (qp->cq_cons_qe == qp->cq_last_qe) { in bnx2i_process_new_cqes()
2086 qp->cq_cons_qe = qp->cq_first_qe; in bnx2i_process_new_cqes()
2087 qp->cq_cons_idx = 0; in bnx2i_process_new_cqes()
2089 qp->cq_cons_qe++; in bnx2i_process_new_cqes()
2090 qp->cq_cons_idx++; in bnx2i_process_new_cqes()
2486 ep->qp.ctx_base = NULL; in bnx2i_process_ofld_cmpl()
2743 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); in bnx2i_map_ep_dbell_regs()
2762 ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off, in bnx2i_map_ep_dbell_regs()
2764 if (!ep->qp.ctx_base) in bnx2i_map_ep_dbell_regs()