Lines Matching defs:packet
316 static inline opcode_handler qp_ok(struct hfi1_packet *packet)
318 if (!(ib_rvt_state_ops[packet->qp->state] & RVT_PROCESS_RECV_OK))
320 if (((packet->opcode & RVT_OPCODE_QP_MASK) ==
321 packet->qp->allowed_ops) ||
322 (packet->opcode == IB_OPCODE_CNP))
323 return opcode_handler_tbl[packet->opcode];
335 * The packet will still be delivered
337 * KHdrHCRCErr (KDETH packet with a bad
339 * packet will not be delivered to the
348 * flag. The packet will still be
359 static opcode_handler tid_qp_ok(int opcode, struct hfi1_packet *packet)
361 if (packet->qp->ibqp.qp_type != IB_QPT_RC ||
362 !(ib_rvt_state_ops[packet->qp->state] & RVT_PROCESS_RECV_OK))
369 void hfi1_kdeth_eager_rcv(struct hfi1_packet *packet)
371 struct hfi1_ctxtdata *rcd = packet->rcd;
372 struct ib_header *hdr = packet->hdr;
373 u32 tlen = packet->tlen;
391 packet->ohdr = &hdr->u.oth;
392 trace_input_ibhdr(rcd->dd, packet, !!(rhf_dc_info(packet->rhf)));
394 opcode = (be32_to_cpu(packet->ohdr->bth[0]) >> 24);
398 qp_num = be32_to_cpu(packet->ohdr->u.tid_rdma.r_req.verbs_qp) &
402 packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
403 if (!packet->qp)
405 spin_lock_irqsave(&packet->qp->r_lock, flags);
406 opcode_handler = tid_qp_ok(opcode, packet);
408 opcode_handler(packet);
411 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
416 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
423 void hfi1_kdeth_expected_rcv(struct hfi1_packet *packet)
425 struct hfi1_ctxtdata *rcd = packet->rcd;
426 struct ib_header *hdr = packet->hdr;
427 u32 tlen = packet->tlen;
445 packet->ohdr = &hdr->u.oth;
446 trace_input_ibhdr(rcd->dd, packet, !!(rhf_dc_info(packet->rhf)));
448 opcode = (be32_to_cpu(packet->ohdr->bth[0]) >> 24);
452 qp_num = be32_to_cpu(packet->ohdr->u.tid_rdma.r_rsp.verbs_qp) &
456 packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
457 if (!packet->qp)
459 spin_lock_irqsave(&packet->qp->r_lock, flags);
460 opcode_handler = tid_qp_ok(opcode, packet);
462 opcode_handler(packet);
465 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
470 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
477 static int hfi1_do_pkey_check(struct hfi1_packet *packet)
479 struct hfi1_ctxtdata *rcd = packet->rcd;
481 struct hfi1_16b_header *hdr = packet->hdr;
485 if (packet->etype != RHF_RCV_TYPE_BYPASS)
490 return ingress_pkey_check(ppd, pkey, packet->sc,
491 packet->qp->s_pkey_index,
492 packet->slid, true);
495 static inline void hfi1_handle_packet(struct hfi1_packet *packet,
499 struct hfi1_ctxtdata *rcd = packet->rcd;
506 inc_opstats(packet->tlen, &rcd->opstats->stats[packet->opcode]);
512 if (!packet->grh)
515 &packet->grh->dgid,
516 opa_get_lid(packet->dlid, 9B));
521 packet->qp = p->qp;
522 if (hfi1_do_pkey_check(packet))
524 spin_lock_irqsave(&packet->qp->r_lock, flags);
525 packet_handler = qp_ok(packet);
527 packet_handler(packet);
530 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
541 if (packet->etype == RHF_RCV_TYPE_BYPASS &&
542 hfi1_16B_get_l4(packet->hdr) == OPA_16B_L4_FM)
543 qp_num = hfi1_16B_get_dest_qpn(packet->mgmt);
545 qp_num = ib_bth_get_qpn(packet->ohdr);
548 packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
549 if (!packet->qp)
552 if (hfi1_do_pkey_check(packet))
555 spin_lock_irqsave(&packet->qp->r_lock, flags);
556 packet_handler = qp_ok(packet);
558 packet_handler(packet);
561 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
572 * hfi1_ib_rcv - process an incoming packet
573 * @packet: data packet information
575 * This is called to process an incoming packet at interrupt level.
577 void hfi1_ib_rcv(struct hfi1_packet *packet)
579 struct hfi1_ctxtdata *rcd = packet->rcd;
581 trace_input_ibhdr(rcd->dd, packet, !!(rhf_dc_info(packet->rhf)));
582 hfi1_handle_packet(packet, hfi1_check_mcast(packet->dlid));
585 void hfi1_16B_rcv(struct hfi1_packet *packet)
587 struct hfi1_ctxtdata *rcd = packet->rcd;
589 trace_input_ibhdr(rcd->dd, packet, false);
590 hfi1_handle_packet(packet, hfi1_check_mcast(packet->dlid));
595 * which need kernel memory in order to send a packet.
733 * @ps: transmit packet state
737 * packet has been presented to the egress mechanism.
886 /* Update HCRC based on packet opcode */
1038 /* Update HCRC based on packet opcode */
1145 * egress_pkey_check - check P_KEY of a packet
1147 * @slid: SLID for packet
1149 * @sc5: SC for packet
1192 * once per SDMA request, not once per packet. Therefore, there's no
1248 * hfi1_verbs_send - send a packet
1250 * @ps: the state of the packet to send
1252 * Return zero if packet is sent or queued OK.
1975 void hfi1_cnp_rcv(struct hfi1_packet *packet)
1977 struct hfi1_ibport *ibp = rcd_to_iport(packet->rcd);
1979 struct ib_header *hdr = packet->hdr;
1980 struct rvt_qp *qp = packet->qp;
1985 switch (packet->qp->ibqp.qp_type) {
2006 sc5 = hfi1_9B_get_sc5(hdr, packet->rhf);