Lines Matching refs:pkt
71 struct rxe_pkt_info *pkt) in check_psn() argument
73 int diff = psn_compare(pkt->psn, qp->resp.psn); in check_psn()
98 if (pkt->mask & RXE_START_MASK) { in check_psn()
115 struct rxe_pkt_info *pkt) in check_op_seq() argument
122 switch (pkt->opcode) { in check_op_seq()
134 switch (pkt->opcode) { in check_op_seq()
144 switch (pkt->opcode) { in check_op_seq()
163 switch (pkt->opcode) { in check_op_seq()
174 switch (pkt->opcode) { in check_op_seq()
184 switch (pkt->opcode) { in check_op_seq()
205 struct rxe_pkt_info *pkt) in check_qp_attr_access() argument
207 if (((pkt->mask & RXE_READ_MASK) && in check_qp_attr_access()
209 ((pkt->mask & (RXE_WRITE_MASK | RXE_ATOMIC_WRITE_MASK)) && in check_qp_attr_access()
211 ((pkt->mask & RXE_ATOMIC_MASK) && in check_qp_attr_access()
215 if (pkt->mask & RXE_FLUSH_MASK) { in check_qp_attr_access()
216 u32 flush_type = feth_plt(pkt); in check_qp_attr_access()
229 struct rxe_pkt_info *pkt) in check_op_valid() argument
233 if (!check_qp_attr_access(qp, pkt)) in check_op_valid()
239 if ((pkt->mask & RXE_WRITE_MASK) && in check_op_valid()
311 struct rxe_pkt_info *pkt) in check_resource() argument
315 if (pkt->mask & (RXE_READ_OR_ATOMIC_MASK | RXE_ATOMIC_WRITE_MASK)) { in check_resource()
326 if (pkt->mask & RXE_RWR_MASK) { in check_resource()
339 struct rxe_pkt_info *pkt) in rxe_resp_check_length() argument
348 unsigned int payload = payload_size(pkt); in rxe_resp_check_length()
360 if (pkt->mask & RXE_PAYLOAD_MASK && ((qp_type(qp) == IB_QPT_RC) || in rxe_resp_check_length()
363 unsigned int payload = payload_size(pkt); in rxe_resp_check_length()
365 if ((pkt->mask & RXE_START_MASK) && in rxe_resp_check_length()
366 (pkt->mask & RXE_END_MASK)) { in rxe_resp_check_length()
371 } else if ((pkt->mask & RXE_START_MASK) || in rxe_resp_check_length()
372 (pkt->mask & RXE_MIDDLE_MASK)) { in rxe_resp_check_length()
377 } else if (pkt->mask & RXE_END_MASK) { in rxe_resp_check_length()
386 if (pkt->mask & RXE_RETH_MASK) { in rxe_resp_check_length()
387 if (reth_len(pkt) > (1U << 31)) { in rxe_resp_check_length()
393 if (pkt->mask & RXE_RDMA_OP_MASK) in rxe_resp_check_length()
404 static void qp_resp_from_reth(struct rxe_qp *qp, struct rxe_pkt_info *pkt) in qp_resp_from_reth() argument
406 unsigned int length = reth_len(pkt); in qp_resp_from_reth()
408 qp->resp.va = reth_va(pkt); in qp_resp_from_reth()
412 if (pkt->mask & RXE_READ_OR_WRITE_MASK && length == 0) in qp_resp_from_reth()
415 qp->resp.rkey = reth_rkey(pkt); in qp_resp_from_reth()
418 static void qp_resp_from_atmeth(struct rxe_qp *qp, struct rxe_pkt_info *pkt) in qp_resp_from_atmeth() argument
420 qp->resp.va = atmeth_va(pkt); in qp_resp_from_atmeth()
422 qp->resp.rkey = atmeth_rkey(pkt); in qp_resp_from_atmeth()
431 struct rxe_pkt_info *pkt) in check_rkey() argument
447 if (pkt->mask & (RXE_READ_OR_WRITE_MASK | RXE_ATOMIC_WRITE_MASK)) { in check_rkey()
448 if (pkt->mask & RXE_RETH_MASK) in check_rkey()
449 qp_resp_from_reth(qp, pkt); in check_rkey()
451 access = (pkt->mask & RXE_READ_MASK) ? IB_ACCESS_REMOTE_READ in check_rkey()
453 } else if (pkt->mask & RXE_FLUSH_MASK) { in check_rkey()
454 u32 flush_type = feth_plt(pkt); in check_rkey()
456 if (pkt->mask & RXE_RETH_MASK) in check_rkey()
457 qp_resp_from_reth(qp, pkt); in check_rkey()
463 } else if (pkt->mask & RXE_ATOMIC_MASK) { in check_rkey()
464 qp_resp_from_atmeth(qp, pkt); in check_rkey()
474 if ((pkt->mask & RXE_READ_OR_WRITE_MASK) && in check_rkey()
475 (pkt->mask & RXE_RETH_MASK) && reth_len(pkt) == 0) { in check_rkey()
483 pktlen = payload_size(pkt); in check_rkey()
515 if (pkt->mask & RXE_FLUSH_MASK) { in check_rkey()
519 if (feth_sel(pkt) == IB_FLUSH_MR) in check_rkey()
529 if (pkt->mask & (RXE_WRITE_MASK | RXE_ATOMIC_WRITE_MASK)) { in check_rkey()
531 if (pktlen != mtu || bth_pad(pkt)) { in check_rkey()
540 if ((bth_pad(pkt) != (0x3 & (-resid)))) { in check_rkey()
580 struct rxe_pkt_info *pkt) in write_data_in() argument
584 int data_len = payload_size(pkt); in write_data_in()
587 payload_addr(pkt), data_len, RXE_TO_MR_OBJ); in write_data_in()
601 struct rxe_pkt_info *pkt, in rxe_prepare_res() argument
622 pkts = max_t(u32, (reth_len(pkt) + qp->mtu - 1)/qp->mtu, 1); in rxe_prepare_res()
623 res->first_psn = pkt->psn; in rxe_prepare_res()
624 res->cur_psn = pkt->psn; in rxe_prepare_res()
625 res->last_psn = (pkt->psn + pkts - 1) & BTH_PSN_MASK; in rxe_prepare_res()
631 res->first_psn = pkt->psn; in rxe_prepare_res()
632 res->last_psn = pkt->psn; in rxe_prepare_res()
633 res->cur_psn = pkt->psn; in rxe_prepare_res()
638 res->flush.type = feth_plt(pkt); in rxe_prepare_res()
639 res->flush.level = feth_sel(pkt); in rxe_prepare_res()
646 struct rxe_pkt_info *pkt) in process_flush() argument
656 res = rxe_prepare_res(qp, pkt, RXE_FLUSH_MASK); in process_flush()
681 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK; in process_flush()
684 qp->resp.opcode = pkt->opcode; in process_flush()
691 struct rxe_pkt_info *pkt) in atomic_reply() argument
698 res = rxe_prepare_res(qp, pkt, RXE_ATOMIC_MASK); in atomic_reply()
705 err = rxe_mr_do_atomic_op(mr, iova, pkt->opcode, in atomic_reply()
706 atmeth_comp(pkt), in atomic_reply()
707 atmeth_swap_add(pkt), in atomic_reply()
715 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK; in atomic_reply()
718 qp->resp.opcode = pkt->opcode; in atomic_reply()
726 struct rxe_pkt_info *pkt) in atomic_write_reply() argument
735 res = rxe_prepare_res(qp, pkt, RXE_ATOMIC_WRITE_MASK); in atomic_write_reply()
743 value = *(u64 *)payload_addr(pkt); in atomic_write_reply()
754 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK; in atomic_write_reply()
757 qp->resp.opcode = pkt->opcode; in atomic_write_reply()
983 static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt) in execute() argument
986 struct sk_buff *skb = PKT_TO_SKB(pkt); in execute()
989 if (pkt->mask & RXE_SEND_MASK) { in execute()
1005 err = send_data_in(qp, payload_addr(pkt), payload_size(pkt)); in execute()
1008 } else if (pkt->mask & RXE_WRITE_MASK) { in execute()
1009 err = write_data_in(qp, pkt); in execute()
1012 } else if (pkt->mask & RXE_READ_MASK) { in execute()
1016 } else if (pkt->mask & RXE_ATOMIC_MASK) { in execute()
1018 } else if (pkt->mask & RXE_ATOMIC_WRITE_MASK) { in execute()
1020 } else if (pkt->mask & RXE_FLUSH_MASK) { in execute()
1027 if (pkt->mask & RXE_IETH_MASK) { in execute()
1028 u32 rkey = ieth_rkey(pkt); in execute()
1035 if (pkt->mask & RXE_END_MASK) in execute()
1040 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK; in execute()
1043 qp->resp.opcode = pkt->opcode; in execute()
1046 if (pkt->mask & RXE_COMP_MASK) in execute()
1055 struct rxe_pkt_info *pkt) in do_complete() argument
1081 wc->opcode = (pkt->mask & RXE_IMMDT_MASK && in do_complete()
1082 pkt->mask & RXE_WRITE_MASK) ? in do_complete()
1084 wc->byte_len = (pkt->mask & RXE_IMMDT_MASK && in do_complete()
1085 pkt->mask & RXE_WRITE_MASK) ? in do_complete()
1094 if (pkt->mask & RXE_IMMDT_MASK) { in do_complete()
1096 uwc->ex.imm_data = immdt_imm(pkt); in do_complete()
1099 if (pkt->mask & RXE_IETH_MASK) { in do_complete()
1101 uwc->ex.invalidate_rkey = ieth_rkey(pkt); in do_complete()
1104 if (pkt->mask & RXE_DETH_MASK) in do_complete()
1105 uwc->src_qp = deth_sqp(pkt); in do_complete()
1109 struct sk_buff *skb = PKT_TO_SKB(pkt); in do_complete()
1122 if (pkt->mask & RXE_IMMDT_MASK) { in do_complete()
1124 wc->ex.imm_data = immdt_imm(pkt); in do_complete()
1127 if (pkt->mask & RXE_IETH_MASK) { in do_complete()
1129 wc->ex.invalidate_rkey = ieth_rkey(pkt); in do_complete()
1132 if (pkt->mask & RXE_DETH_MASK) in do_complete()
1133 wc->src_qp = deth_sqp(pkt); in do_complete()
1149 if (rxe_cq_post(qp->rcq, &cqe, pkt ? bth_se(pkt) : 1)) in do_complete()
1160 if (unlikely(!pkt)) in do_complete()
1219 struct rxe_pkt_info *pkt) in acknowledge() argument
1225 send_ack(qp, qp->resp.aeth_syndrome, pkt->psn); in acknowledge()
1226 else if (pkt->mask & RXE_ATOMIC_MASK) in acknowledge()
1227 send_atomic_ack(qp, AETH_ACK_UNLIMITED, pkt->psn); in acknowledge()
1228 else if (pkt->mask & (RXE_FLUSH_MASK | RXE_ATOMIC_WRITE_MASK)) in acknowledge()
1229 send_read_response_ack(qp, AETH_ACK_UNLIMITED, pkt->psn); in acknowledge()
1230 else if (bth_ack(pkt)) in acknowledge()
1231 send_ack(qp, AETH_ACK_UNLIMITED, pkt->psn); in acknowledge()
1237 struct rxe_pkt_info *pkt) in cleanup() argument
1241 if (pkt) { in cleanup()
1276 struct rxe_pkt_info *pkt) in duplicate_request() argument
1281 if (pkt->mask & RXE_SEND_MASK || in duplicate_request()
1282 pkt->mask & RXE_WRITE_MASK) { in duplicate_request()
1286 } else if (pkt->mask & RXE_FLUSH_MASK) { in duplicate_request()
1290 res = find_resource(qp, pkt->psn); in duplicate_request()
1293 res->cur_psn = pkt->psn; in duplicate_request()
1302 } else if (pkt->mask & RXE_READ_MASK) { in duplicate_request()
1305 res = find_resource(qp, pkt->psn); in duplicate_request()
1316 u64 iova = reth_va(pkt); in duplicate_request()
1317 u32 resid = reth_len(pkt); in duplicate_request()
1327 if (reth_rkey(pkt) != res->read.rkey) { in duplicate_request()
1332 res->cur_psn = pkt->psn; in duplicate_request()
1333 res->state = (pkt->psn == res->first_psn) ? in duplicate_request()
1352 res = find_resource(qp, pkt->psn); in duplicate_request()
1355 res->cur_psn = pkt->psn; in duplicate_request()
1357 rc = pkt->mask & RXE_ATOMIC_MASK ? in duplicate_request()
1495 struct rxe_pkt_info *pkt = NULL; in rxe_receiver() local
1519 state = get_req(qp, &pkt); in rxe_receiver()
1522 state = check_psn(qp, pkt); in rxe_receiver()
1525 state = check_op_seq(qp, pkt); in rxe_receiver()
1528 state = check_op_valid(qp, pkt); in rxe_receiver()
1531 state = check_resource(qp, pkt); in rxe_receiver()
1534 state = rxe_resp_check_length(qp, pkt); in rxe_receiver()
1537 state = check_rkey(qp, pkt); in rxe_receiver()
1540 state = execute(qp, pkt); in rxe_receiver()
1543 state = do_complete(qp, pkt); in rxe_receiver()
1546 state = read_reply(qp, pkt); in rxe_receiver()
1549 state = atomic_reply(qp, pkt); in rxe_receiver()
1552 state = atomic_write_reply(qp, pkt); in rxe_receiver()
1555 state = process_flush(qp, pkt); in rxe_receiver()
1558 state = acknowledge(qp, pkt); in rxe_receiver()
1561 state = cleanup(qp, pkt); in rxe_receiver()
1564 state = duplicate_request(qp, pkt); in rxe_receiver()
1593 pkt->psn); in rxe_receiver()