Lines Matching defs:packet

274 static inline opcode_handler qp_ok(struct hfi1_packet *packet)
276 if (!(ib_rvt_state_ops[packet->qp->state] & RVT_PROCESS_RECV_OK))
278 if (((packet->opcode & RVT_OPCODE_QP_MASK) ==
279 packet->qp->allowed_ops) ||
280 (packet->opcode == IB_OPCODE_CNP))
281 return opcode_handler_tbl[packet->opcode];
293 * The packet will still be delivered
295 * KHdrHCRCErr (KDETH packet with a bad
297 * packet will not be delivered to the
306 * flag. The packet will still be
317 static opcode_handler tid_qp_ok(int opcode, struct hfi1_packet *packet)
319 if (packet->qp->ibqp.qp_type != IB_QPT_RC ||
320 !(ib_rvt_state_ops[packet->qp->state] & RVT_PROCESS_RECV_OK))
327 void hfi1_kdeth_eager_rcv(struct hfi1_packet *packet)
329 struct hfi1_ctxtdata *rcd = packet->rcd;
330 struct ib_header *hdr = packet->hdr;
331 u32 tlen = packet->tlen;
349 packet->ohdr = &hdr->u.oth;
350 trace_input_ibhdr(rcd->dd, packet, !!(rhf_dc_info(packet->rhf)));
352 opcode = (be32_to_cpu(packet->ohdr->bth[0]) >> 24);
356 qp_num = be32_to_cpu(packet->ohdr->u.tid_rdma.r_req.verbs_qp) &
360 packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
361 if (!packet->qp)
363 spin_lock_irqsave(&packet->qp->r_lock, flags);
364 opcode_handler = tid_qp_ok(opcode, packet);
366 opcode_handler(packet);
369 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
374 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
381 void hfi1_kdeth_expected_rcv(struct hfi1_packet *packet)
383 struct hfi1_ctxtdata *rcd = packet->rcd;
384 struct ib_header *hdr = packet->hdr;
385 u32 tlen = packet->tlen;
403 packet->ohdr = &hdr->u.oth;
404 trace_input_ibhdr(rcd->dd, packet, !!(rhf_dc_info(packet->rhf)));
406 opcode = (be32_to_cpu(packet->ohdr->bth[0]) >> 24);
410 qp_num = be32_to_cpu(packet->ohdr->u.tid_rdma.r_rsp.verbs_qp) &
414 packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
415 if (!packet->qp)
417 spin_lock_irqsave(&packet->qp->r_lock, flags);
418 opcode_handler = tid_qp_ok(opcode, packet);
420 opcode_handler(packet);
423 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
428 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
435 static int hfi1_do_pkey_check(struct hfi1_packet *packet)
437 struct hfi1_ctxtdata *rcd = packet->rcd;
439 struct hfi1_16b_header *hdr = packet->hdr;
443 if (packet->etype != RHF_RCV_TYPE_BYPASS)
448 return ingress_pkey_check(ppd, pkey, packet->sc,
449 packet->qp->s_pkey_index,
450 packet->slid, true);
453 static inline void hfi1_handle_packet(struct hfi1_packet *packet,
457 struct hfi1_ctxtdata *rcd = packet->rcd;
464 inc_opstats(packet->tlen, &rcd->opstats->stats[packet->opcode]);
470 if (!packet->grh)
473 &packet->grh->dgid,
474 opa_get_lid(packet->dlid, 9B));
479 packet->qp = p->qp;
480 if (hfi1_do_pkey_check(packet))
482 spin_lock_irqsave(&packet->qp->r_lock, flags);
483 packet_handler = qp_ok(packet);
485 packet_handler(packet);
488 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
499 if (packet->etype == RHF_RCV_TYPE_BYPASS &&
500 hfi1_16B_get_l4(packet->hdr) == OPA_16B_L4_FM)
501 qp_num = hfi1_16B_get_dest_qpn(packet->mgmt);
503 qp_num = ib_bth_get_qpn(packet->ohdr);
506 packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
507 if (!packet->qp)
510 if (hfi1_do_pkey_check(packet))
513 spin_lock_irqsave(&packet->qp->r_lock, flags);
514 packet_handler = qp_ok(packet);
516 packet_handler(packet);
519 spin_unlock_irqrestore(&packet->qp->r_lock, flags);
530 * hfi1_ib_rcv - process an incoming packet
531 * @packet: data packet information
533 * This is called to process an incoming packet at interrupt level.
535 void hfi1_ib_rcv(struct hfi1_packet *packet)
537 struct hfi1_ctxtdata *rcd = packet->rcd;
539 trace_input_ibhdr(rcd->dd, packet, !!(rhf_dc_info(packet->rhf)));
540 hfi1_handle_packet(packet, hfi1_check_mcast(packet->dlid));
543 void hfi1_16B_rcv(struct hfi1_packet *packet)
545 struct hfi1_ctxtdata *rcd = packet->rcd;
547 trace_input_ibhdr(rcd->dd, packet, false);
548 hfi1_handle_packet(packet, hfi1_check_mcast(packet->dlid));
553 * which need kernel memory in order to send a packet.
691 * @ps: transmit packet state
695 * packet has been presented to the egress mechanism.
844 /* Update HCRC based on packet opcode */
996 /* Update HCRC based on packet opcode */
1103 * egress_pkey_check - check P_KEY of a packet
1105 * @slid: SLID for packet
1107 * @sc5: SC for packet
1150 * once per SDMA request, not once per packet. Therefore, there's no
1206 * hfi1_verbs_send - send a packet
1208 * @ps: the state of the packet to send
1210 * Return zero if packet is sent or queued OK.
1912 void hfi1_cnp_rcv(struct hfi1_packet *packet)
1914 struct hfi1_ibport *ibp = rcd_to_iport(packet->rcd);
1916 struct ib_header *hdr = packet->hdr;
1917 struct rvt_qp *qp = packet->qp;
1922 switch (packet->qp->ibqp.qp_type) {
1943 sc5 = hfi1_9B_get_sc5(hdr, packet->rhf);