Lines Matching full:packet
253 struct hfi1_packet *packet) in rcv_hdrerr() argument
255 struct ib_header *rhdr = packet->hdr; in rcv_hdrerr()
256 u32 rte = rhf_rcv_type_err(packet->rhf); in rcv_hdrerr()
263 if ((packet->rhf & RHF_DC_ERR) && in rcv_hdrerr()
267 if (packet->rhf & (RHF_VCRC_ERR | RHF_ICRC_ERR)) in rcv_hdrerr()
270 if (packet->etype == RHF_RCV_TYPE_BYPASS) { in rcv_hdrerr()
277 packet->ohdr = &rhdr->u.oth; in rcv_hdrerr()
279 packet->ohdr = &rhdr->u.l.oth; in rcv_hdrerr()
280 packet->grh = &rhdr->u.l.grh; in rcv_hdrerr()
286 if (packet->rhf & RHF_TID_ERR) { in rcv_hdrerr()
288 u32 tlen = rhf_pkt_len(packet->rhf); /* in bytes */ in rcv_hdrerr()
292 /* Sanity check packet */ in rcv_hdrerr()
297 if (packet->grh) { in rcv_hdrerr()
299 struct ib_grh *grh = packet->grh; in rcv_hdrerr()
309 qp_num = ib_bth_get_qpn(packet->ohdr); in rcv_hdrerr()
323 * packet. in rcv_hdrerr()
335 hfi1_rc_hdrerr(rcd, packet, qp); in rcv_hdrerr()
345 } /* Valid packet with TIDErr */ in rcv_hdrerr()
354 if (rhf_use_egr_bfr(packet->rhf)) in rcv_hdrerr()
355 ebuf = packet->ebuf; in rcv_hdrerr()
360 opcode = ib_bth_get_opcode(packet->ohdr); in rcv_hdrerr()
371 sc5 = hfi1_9B_get_sc5(rhdr, packet->rhf); in rcv_hdrerr()
374 lqpn = ib_bth_get_qpn(packet->ohdr); in rcv_hdrerr()
402 packet->rhf &= ~RHF_RCV_TYPE_ERR_SMASK; in rcv_hdrerr()
414 struct hfi1_packet *packet) in init_packet() argument
416 packet->rsize = rcd->rcvhdrqentsize; /* words */ in init_packet()
417 packet->maxcnt = rcd->rcvhdrq_cnt * packet->rsize; /* words */ in init_packet()
418 packet->rcd = rcd; in init_packet()
419 packet->updegr = 0; in init_packet()
420 packet->etail = -1; in init_packet()
421 packet->rhf_addr = get_rhf_addr(rcd); in init_packet()
422 packet->rhf = rhf_to_cpu(packet->rhf_addr); in init_packet()
423 packet->rhqoff = rcd->head; in init_packet()
424 packet->numpkt = 0; in init_packet()
435 * @qp: The packet's destination QP
436 * @pkt: The packet itself.
439 * Process the packet's FECN or BECN bits. By now, the packet
444 * normal packet processing to send an ACK with BECN set (or a CNP).
545 struct hfi1_packet *packet) in init_ps_mdata() argument
547 struct hfi1_ctxtdata *rcd = packet->rcd; in init_ps_mdata()
550 mdata->rsize = packet->rsize; in init_ps_mdata()
551 mdata->maxcnt = packet->maxcnt; in init_ps_mdata()
552 mdata->ps_head = packet->rhqoff; in init_ps_mdata()
610 #define prescan_rxq(rcd, packet) \ argument
613 __prescan_rxq(packet); \
615 static void __prescan_rxq(struct hfi1_packet *packet) in __prescan_rxq() argument
617 struct hfi1_ctxtdata *rcd = packet->rcd; in __prescan_rxq()
620 init_ps_mdata(&mdata, packet); in __prescan_rxq()
625 packet->rcd->rhf_offset; in __prescan_rxq()
642 packet->hdr = hfi1_get_msgheader(packet->rcd, rhf_addr); in __prescan_rxq()
643 hdr = packet->hdr; in __prescan_rxq()
647 packet->ohdr = &hdr->u.oth; in __prescan_rxq()
648 packet->grh = NULL; in __prescan_rxq()
650 packet->ohdr = &hdr->u.l.oth; in __prescan_rxq()
651 packet->grh = &hdr->u.l.grh; in __prescan_rxq()
656 if (!hfi1_may_ecn(packet)) in __prescan_rxq()
659 bth1 = be32_to_cpu(packet->ohdr->bth[1]); in __prescan_rxq()
669 hfi1_process_ecn_slowpath(qp, packet, true); in __prescan_rxq()
674 packet->ohdr->bth[1] = cpu_to_be32(bth1); in __prescan_rxq()
680 static void process_rcv_qp_work(struct hfi1_packet *packet) in process_rcv_qp_work() argument
683 struct hfi1_ctxtdata *rcd = packet->rcd; in process_rcv_qp_work()
693 packet->qp = qp; in process_rcv_qp_work()
694 hfi1_send_rc_ack(packet, 0); in process_rcv_qp_work()
710 static noinline int max_packet_exceeded(struct hfi1_packet *packet, int thread) in max_packet_exceeded() argument
713 if ((packet->numpkt & (MAX_PKT_RECV_THREAD - 1)) == 0) in max_packet_exceeded()
715 process_rcv_qp_work(packet); in max_packet_exceeded()
719 this_cpu_inc(*packet->rcd->dd->rcv_limit); in max_packet_exceeded()
724 static inline int check_max_packet(struct hfi1_packet *packet, int thread) in check_max_packet() argument
728 if (unlikely((packet->numpkt & (MAX_PKT_RECV - 1)) == 0)) in check_max_packet()
729 ret = max_packet_exceeded(packet, thread); in check_max_packet()
733 static noinline int skip_rcv_packet(struct hfi1_packet *packet, int thread) in skip_rcv_packet() argument
737 packet->rcd->dd->ctx0_seq_drop++; in skip_rcv_packet()
738 /* Set up for the next packet */ in skip_rcv_packet()
739 packet->rhqoff += packet->rsize; in skip_rcv_packet()
740 if (packet->rhqoff >= packet->maxcnt) in skip_rcv_packet()
741 packet->rhqoff = 0; in skip_rcv_packet()
743 packet->numpkt++; in skip_rcv_packet()
744 ret = check_max_packet(packet, thread); in skip_rcv_packet()
746 packet->rhf_addr = (__le32 *)packet->rcd->rcvhdrq + packet->rhqoff + in skip_rcv_packet()
747 packet->rcd->rhf_offset; in skip_rcv_packet()
748 packet->rhf = rhf_to_cpu(packet->rhf_addr); in skip_rcv_packet()
753 static inline int process_rcv_packet(struct hfi1_packet *packet, int thread) in process_rcv_packet() argument
757 packet->etype = rhf_rcv_type(packet->rhf); in process_rcv_packet()
760 packet->tlen = rhf_pkt_len(packet->rhf); /* in bytes */ in process_rcv_packet()
762 packet->ebuf = NULL; in process_rcv_packet()
763 if (rhf_use_egr_bfr(packet->rhf)) { in process_rcv_packet()
764 packet->etail = rhf_egr_index(packet->rhf); in process_rcv_packet()
765 packet->ebuf = get_egrbuf(packet->rcd, packet->rhf, in process_rcv_packet()
766 &packet->updegr); in process_rcv_packet()
772 prefetch_range(packet->ebuf, in process_rcv_packet()
773 packet->tlen - ((packet->rcd->rcvhdrqentsize - in process_rcv_packet()
774 (rhf_hdrq_offset(packet->rhf) in process_rcv_packet()
779 * Call a type specific handler for the packet. We in process_rcv_packet()
786 packet->rcd->rhf_rcv_function_map[packet->etype](packet); in process_rcv_packet()
787 packet->numpkt++; in process_rcv_packet()
789 /* Set up for the next packet */ in process_rcv_packet()
790 packet->rhqoff += packet->rsize; in process_rcv_packet()
791 if (packet->rhqoff >= packet->maxcnt) in process_rcv_packet()
792 packet->rhqoff = 0; in process_rcv_packet()
794 ret = check_max_packet(packet, thread); in process_rcv_packet()
796 packet->rhf_addr = (__le32 *)packet->rcd->rcvhdrq + packet->rhqoff + in process_rcv_packet()
797 packet->rcd->rhf_offset; in process_rcv_packet()
798 packet->rhf = rhf_to_cpu(packet->rhf_addr); in process_rcv_packet()
803 static inline void process_rcv_update(int last, struct hfi1_packet *packet) in process_rcv_update() argument
811 if (!last && !(packet->numpkt & 0xf)) { in process_rcv_update()
812 update_usrhead(packet->rcd, packet->rhqoff, packet->updegr, in process_rcv_update()
813 packet->etail, 0, 0); in process_rcv_update()
814 packet->updegr = 0; in process_rcv_update()
816 packet->grh = NULL; in process_rcv_update()
819 static inline void finish_packet(struct hfi1_packet *packet) in finish_packet() argument
822 * Nothing we need to free for the packet. in finish_packet()
827 update_usrhead(packet->rcd, packet->rcd->head, packet->updegr, in finish_packet()
828 packet->etail, rcv_intr_dynamic, packet->numpkt); in finish_packet()
838 struct hfi1_packet packet; in handle_receive_interrupt_nodma_rtail() local
840 init_packet(rcd, &packet); in handle_receive_interrupt_nodma_rtail()
841 seq = rhf_rcv_seq(packet.rhf); in handle_receive_interrupt_nodma_rtail()
847 prescan_rxq(rcd, &packet); in handle_receive_interrupt_nodma_rtail()
850 last = process_rcv_packet(&packet, thread); in handle_receive_interrupt_nodma_rtail()
851 seq = rhf_rcv_seq(packet.rhf); in handle_receive_interrupt_nodma_rtail()
856 process_rcv_update(last, &packet); in handle_receive_interrupt_nodma_rtail()
858 process_rcv_qp_work(&packet); in handle_receive_interrupt_nodma_rtail()
859 rcd->head = packet.rhqoff; in handle_receive_interrupt_nodma_rtail()
861 finish_packet(&packet); in handle_receive_interrupt_nodma_rtail()
869 struct hfi1_packet packet; in handle_receive_interrupt_dma_rtail() local
871 init_packet(rcd, &packet); in handle_receive_interrupt_dma_rtail()
873 if (packet.rhqoff == hdrqtail) { in handle_receive_interrupt_dma_rtail()
879 prescan_rxq(rcd, &packet); in handle_receive_interrupt_dma_rtail()
882 last = process_rcv_packet(&packet, thread); in handle_receive_interrupt_dma_rtail()
883 if (packet.rhqoff == hdrqtail) in handle_receive_interrupt_dma_rtail()
885 process_rcv_update(last, &packet); in handle_receive_interrupt_dma_rtail()
887 process_rcv_qp_work(&packet); in handle_receive_interrupt_dma_rtail()
888 rcd->head = packet.rhqoff; in handle_receive_interrupt_dma_rtail()
890 finish_packet(&packet); in handle_receive_interrupt_dma_rtail()
970 struct hfi1_packet *packet, in set_armed_to_active() argument
974 u8 etype = rhf_rcv_type(packet->rhf); in set_armed_to_active()
978 struct ib_header *hdr = hfi1_get_msgheader(packet->rcd, in set_armed_to_active()
979 packet->rhf_addr); in set_armed_to_active()
980 sc = hfi1_9B_get_sc5(hdr, packet->rhf); in set_armed_to_active()
983 packet->rcd, in set_armed_to_active()
984 packet->rhf_addr); in set_armed_to_active()
1004 * handle_receive_interrupt - receive a packet
1015 struct hfi1_packet packet; in handle_receive_interrupt() local
1021 init_packet(rcd, &packet); in handle_receive_interrupt()
1024 u32 seq = rhf_rcv_seq(packet.rhf); in handle_receive_interrupt()
1033 if (packet.rhqoff == hdrqtail) { in handle_receive_interrupt()
1044 u32 seq = rhf_rcv_seq(packet.rhf); in handle_receive_interrupt()
1051 prescan_rxq(rcd, &packet); in handle_receive_interrupt()
1059 /* On to the next packet */ in handle_receive_interrupt()
1060 packet.rhqoff += packet.rsize; in handle_receive_interrupt()
1061 packet.rhf_addr = (__le32 *)rcd->rcvhdrq + in handle_receive_interrupt()
1062 packet.rhqoff + in handle_receive_interrupt()
1064 packet.rhf = rhf_to_cpu(packet.rhf_addr); in handle_receive_interrupt()
1067 last = skip_rcv_packet(&packet, thread); in handle_receive_interrupt()
1070 /* Auto activate link on non-SC15 packet receive */ in handle_receive_interrupt()
1073 set_armed_to_active(rcd, &packet, dd)) in handle_receive_interrupt()
1075 last = process_rcv_packet(&packet, thread); in handle_receive_interrupt()
1079 u32 seq = rhf_rcv_seq(packet.rhf); in handle_receive_interrupt()
1091 if (packet.rhqoff == hdrqtail) in handle_receive_interrupt()
1098 u32 seq = rhf_rcv_seq(packet.rhf); in handle_receive_interrupt()
1114 process_rcv_update(last, &packet); in handle_receive_interrupt()
1117 process_rcv_qp_work(&packet); in handle_receive_interrupt()
1118 rcd->head = packet.rhqoff; in handle_receive_interrupt()
1125 finish_packet(&packet); in handle_receive_interrupt()
1131 * changed from ARMED to ACTIVE (due to the arrival of a non-SC15 packet),
1154 /* Received non-SC15 packet implies neighbor_normal */ in receive_interrupt_work()
1171 * Convert a given MTU size to the on-wire MAD packet enumeration.
1233 * MTU is specified per-VL. To ensure that no packet gets in set_mtu()
1234 * stuck (due, e.g., to the MTU for the packet's VL being in set_mtu()
1410 static inline void hfi1_setup_ib_header(struct hfi1_packet *packet) in hfi1_setup_ib_header() argument
1412 packet->hdr = (struct hfi1_ib_message_header *) in hfi1_setup_ib_header()
1413 hfi1_get_msgheader(packet->rcd, in hfi1_setup_ib_header()
1414 packet->rhf_addr); in hfi1_setup_ib_header()
1415 packet->hlen = (u8 *)packet->rhf_addr - (u8 *)packet->hdr; in hfi1_setup_ib_header()
1418 static int hfi1_bypass_ingress_pkt_check(struct hfi1_packet *packet) in hfi1_bypass_ingress_pkt_check() argument
1420 struct hfi1_pportdata *ppd = packet->rcd->ppd; in hfi1_bypass_ingress_pkt_check()
1423 if ((!packet->slid) || (!packet->dlid)) in hfi1_bypass_ingress_pkt_check()
1426 /* Compare port lid with incoming packet dlid */ in hfi1_bypass_ingress_pkt_check()
1427 if ((!(hfi1_is_16B_mcast(packet->dlid))) && in hfi1_bypass_ingress_pkt_check()
1428 (packet->dlid != in hfi1_bypass_ingress_pkt_check()
1430 if (packet->dlid != ppd->lid) in hfi1_bypass_ingress_pkt_check()
1435 if ((hfi1_is_16B_mcast(packet->dlid)) && (packet->sc == 0xF)) in hfi1_bypass_ingress_pkt_check()
1439 if ((packet->dlid == opa_get_lid(be32_to_cpu(OPA_LID_PERMISSIVE), in hfi1_bypass_ingress_pkt_check()
1441 (packet->sc != 0xF)) in hfi1_bypass_ingress_pkt_check()
1447 static int hfi1_setup_9B_packet(struct hfi1_packet *packet) in hfi1_setup_9B_packet() argument
1449 struct hfi1_ibport *ibp = rcd_to_iport(packet->rcd); in hfi1_setup_9B_packet()
1453 hfi1_setup_ib_header(packet); in hfi1_setup_9B_packet()
1454 hdr = packet->hdr; in hfi1_setup_9B_packet()
1458 packet->ohdr = &hdr->u.oth; in hfi1_setup_9B_packet()
1459 packet->grh = NULL; in hfi1_setup_9B_packet()
1463 packet->ohdr = &hdr->u.l.oth; in hfi1_setup_9B_packet()
1464 packet->grh = &hdr->u.l.grh; in hfi1_setup_9B_packet()
1465 if (packet->grh->next_hdr != IB_GRH_NEXT_HDR) in hfi1_setup_9B_packet()
1467 vtf = be32_to_cpu(packet->grh->version_tclass_flow); in hfi1_setup_9B_packet()
1474 /* Query commonly used fields from packet header */ in hfi1_setup_9B_packet()
1475 packet->payload = packet->ebuf; in hfi1_setup_9B_packet()
1476 packet->opcode = ib_bth_get_opcode(packet->ohdr); in hfi1_setup_9B_packet()
1477 packet->slid = ib_get_slid(hdr); in hfi1_setup_9B_packet()
1478 packet->dlid = ib_get_dlid(hdr); in hfi1_setup_9B_packet()
1479 if (unlikely((packet->dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) && in hfi1_setup_9B_packet()
1480 (packet->dlid != be16_to_cpu(IB_LID_PERMISSIVE)))) in hfi1_setup_9B_packet()
1481 packet->dlid += opa_get_mcast_base(OPA_MCAST_NR) - in hfi1_setup_9B_packet()
1483 packet->sl = ib_get_sl(hdr); in hfi1_setup_9B_packet()
1484 packet->sc = hfi1_9B_get_sc5(hdr, packet->rhf); in hfi1_setup_9B_packet()
1485 packet->pad = ib_bth_get_pad(packet->ohdr); in hfi1_setup_9B_packet()
1486 packet->extra_byte = 0; in hfi1_setup_9B_packet()
1487 packet->pkey = ib_bth_get_pkey(packet->ohdr); in hfi1_setup_9B_packet()
1488 packet->migrated = ib_bth_is_migration(packet->ohdr); in hfi1_setup_9B_packet()
1496 static int hfi1_setup_bypass_packet(struct hfi1_packet *packet) in hfi1_setup_bypass_packet() argument
1500 * compared to an IB packet. in hfi1_setup_bypass_packet()
1508 struct hfi1_ctxtdata *rcd = packet->rcd; in hfi1_setup_bypass_packet()
1513 packet->hdr = (struct hfi1_16b_header *) in hfi1_setup_bypass_packet()
1514 hfi1_get_16B_header(packet->rcd, in hfi1_setup_bypass_packet()
1515 packet->rhf_addr); in hfi1_setup_bypass_packet()
1516 l4 = hfi1_16B_get_l4(packet->hdr); in hfi1_setup_bypass_packet()
1518 packet->ohdr = packet->ebuf; in hfi1_setup_bypass_packet()
1519 packet->grh = NULL; in hfi1_setup_bypass_packet()
1520 packet->opcode = ib_bth_get_opcode(packet->ohdr); in hfi1_setup_bypass_packet()
1521 packet->pad = hfi1_16B_bth_get_pad(packet->ohdr); in hfi1_setup_bypass_packet()
1523 packet->hlen = hdr_len_by_opcode[packet->opcode] + in hfi1_setup_bypass_packet()
1525 packet->migrated = opa_bth_is_migration(packet->ohdr); in hfi1_setup_bypass_packet()
1530 packet->ohdr = packet->ebuf + grh_len; in hfi1_setup_bypass_packet()
1531 packet->grh = packet->ebuf; in hfi1_setup_bypass_packet()
1532 packet->opcode = ib_bth_get_opcode(packet->ohdr); in hfi1_setup_bypass_packet()
1533 packet->pad = hfi1_16B_bth_get_pad(packet->ohdr); in hfi1_setup_bypass_packet()
1535 packet->hlen = hdr_len_by_opcode[packet->opcode] + in hfi1_setup_bypass_packet()
1537 packet->migrated = opa_bth_is_migration(packet->ohdr); in hfi1_setup_bypass_packet()
1539 if (packet->grh->next_hdr != IB_GRH_NEXT_HDR) in hfi1_setup_bypass_packet()
1541 vtf = be32_to_cpu(packet->grh->version_tclass_flow); in hfi1_setup_bypass_packet()
1545 packet->mgmt = packet->ebuf; in hfi1_setup_bypass_packet()
1546 packet->ohdr = NULL; in hfi1_setup_bypass_packet()
1547 packet->grh = NULL; in hfi1_setup_bypass_packet()
1548 packet->opcode = IB_OPCODE_UD_SEND_ONLY; in hfi1_setup_bypass_packet()
1549 packet->pad = OPA_16B_L4_FM_PAD; in hfi1_setup_bypass_packet()
1550 packet->hlen = OPA_16B_L4_FM_HLEN; in hfi1_setup_bypass_packet()
1551 packet->migrated = false; in hfi1_setup_bypass_packet()
1556 /* Query commonly used fields from packet header */ in hfi1_setup_bypass_packet()
1557 packet->payload = packet->ebuf + packet->hlen - LRH_16B_BYTES; in hfi1_setup_bypass_packet()
1558 packet->slid = hfi1_16B_get_slid(packet->hdr); in hfi1_setup_bypass_packet()
1559 packet->dlid = hfi1_16B_get_dlid(packet->hdr); in hfi1_setup_bypass_packet()
1560 if (unlikely(hfi1_is_16B_mcast(packet->dlid))) in hfi1_setup_bypass_packet()
1561 packet->dlid += opa_get_mcast_base(OPA_MCAST_NR) - in hfi1_setup_bypass_packet()
1564 packet->sc = hfi1_16B_get_sc(packet->hdr); in hfi1_setup_bypass_packet()
1565 packet->sl = ibp->sc_to_sl[packet->sc]; in hfi1_setup_bypass_packet()
1566 packet->extra_byte = SIZE_OF_LT; in hfi1_setup_bypass_packet()
1567 packet->pkey = hfi1_16B_get_pkey(packet->hdr); in hfi1_setup_bypass_packet()
1569 if (hfi1_bypass_ingress_pkt_check(packet)) in hfi1_setup_bypass_packet()
1574 hfi1_cdbg(PKT, "%s: packet dropped\n", __func__); in hfi1_setup_bypass_packet()
1579 void handle_eflags(struct hfi1_packet *packet) in handle_eflags() argument
1581 struct hfi1_ctxtdata *rcd = packet->rcd; in handle_eflags()
1582 u32 rte = rhf_rcv_type_err(packet->rhf); in handle_eflags()
1584 rcv_hdrerr(rcd, rcd->ppd, packet); in handle_eflags()
1585 if (rhf_err_flags(packet->rhf)) in handle_eflags()
1588 rcd->ctxt, packet->rhf, in handle_eflags()
1589 packet->rhf & RHF_K_HDR_LEN_ERR ? "k_hdr_len " : "", in handle_eflags()
1590 packet->rhf & RHF_DC_UNC_ERR ? "dc_unc " : "", in handle_eflags()
1591 packet->rhf & RHF_DC_ERR ? "dc " : "", in handle_eflags()
1592 packet->rhf & RHF_TID_ERR ? "tid " : "", in handle_eflags()
1593 packet->rhf & RHF_LEN_ERR ? "len " : "", in handle_eflags()
1594 packet->rhf & RHF_ECC_ERR ? "ecc " : "", in handle_eflags()
1595 packet->rhf & RHF_VCRC_ERR ? "vcrc " : "", in handle_eflags()
1596 packet->rhf & RHF_ICRC_ERR ? "icrc " : "", in handle_eflags()
1602 * specific handlers for each packet type.
1604 static int process_receive_ib(struct hfi1_packet *packet) in process_receive_ib() argument
1606 if (hfi1_setup_9B_packet(packet)) in process_receive_ib()
1609 if (unlikely(hfi1_dbg_should_fault_rx(packet))) in process_receive_ib()
1612 trace_hfi1_rcvhdr(packet); in process_receive_ib()
1614 if (unlikely(rhf_err_flags(packet->rhf))) { in process_receive_ib()
1615 handle_eflags(packet); in process_receive_ib()
1619 hfi1_ib_rcv(packet); in process_receive_ib()
1623 static inline bool hfi1_is_vnic_packet(struct hfi1_packet *packet) in hfi1_is_vnic_packet() argument
1625 /* Packet received in VNIC context via RSM */ in hfi1_is_vnic_packet()
1626 if (packet->rcd->is_vnic) in hfi1_is_vnic_packet()
1629 if ((hfi1_16B_get_l2(packet->ebuf) == OPA_16B_L2_TYPE) && in hfi1_is_vnic_packet()
1630 (hfi1_16B_get_l4(packet->ebuf) == OPA_16B_L4_ETHR)) in hfi1_is_vnic_packet()
1636 static int process_receive_bypass(struct hfi1_packet *packet) in process_receive_bypass() argument
1638 struct hfi1_devdata *dd = packet->rcd->dd; in process_receive_bypass()
1640 if (hfi1_is_vnic_packet(packet)) { in process_receive_bypass()
1641 hfi1_vnic_bypass_rcv(packet); in process_receive_bypass()
1645 if (hfi1_setup_bypass_packet(packet)) in process_receive_bypass()
1648 trace_hfi1_rcvhdr(packet); in process_receive_bypass()
1650 if (unlikely(rhf_err_flags(packet->rhf))) { in process_receive_bypass()
1651 handle_eflags(packet); in process_receive_bypass()
1655 if (hfi1_16B_get_l2(packet->hdr) == 0x2) { in process_receive_bypass()
1656 hfi1_16B_rcv(packet); in process_receive_bypass()
1663 u64 *flits = packet->ebuf; in process_receive_bypass()
1665 if (flits && !(packet->rhf & RHF_LEN_ERR)) { in process_receive_bypass()
1668 packet->tlen > sizeof(flits[0]) ? in process_receive_bypass()
1678 static int process_receive_error(struct hfi1_packet *packet) in process_receive_error() argument
1680 /* KHdrHCRCErr -- KDETH packet with a bad HCRC */ in process_receive_error()
1682 hfi1_dbg_fault_suppress_err(&packet->rcd->dd->verbs_dev) && in process_receive_error()
1683 (rhf_rcv_type_err(packet->rhf) == RHF_RCV_TYPE_ERROR || in process_receive_error()
1684 packet->rhf & RHF_DC_ERR))) in process_receive_error()
1687 hfi1_setup_ib_header(packet); in process_receive_error()
1688 handle_eflags(packet); in process_receive_error()
1690 if (unlikely(rhf_err_flags(packet->rhf))) in process_receive_error()
1691 dd_dev_err(packet->rcd->dd, in process_receive_error()
1692 "Unhandled error packet received. Dropping.\n"); in process_receive_error()
1697 static int kdeth_process_expected(struct hfi1_packet *packet) in kdeth_process_expected() argument
1699 hfi1_setup_9B_packet(packet); in kdeth_process_expected()
1700 if (unlikely(hfi1_dbg_should_fault_rx(packet))) in kdeth_process_expected()
1703 if (unlikely(rhf_err_flags(packet->rhf))) in kdeth_process_expected()
1704 handle_eflags(packet); in kdeth_process_expected()
1706 dd_dev_err(packet->rcd->dd, in kdeth_process_expected()
1707 "Unhandled expected packet received. Dropping.\n"); in kdeth_process_expected()
1711 static int kdeth_process_eager(struct hfi1_packet *packet) in kdeth_process_eager() argument
1713 hfi1_setup_9B_packet(packet); in kdeth_process_eager()
1714 if (unlikely(hfi1_dbg_should_fault_rx(packet))) in kdeth_process_eager()
1716 if (unlikely(rhf_err_flags(packet->rhf))) in kdeth_process_eager()
1717 handle_eflags(packet); in kdeth_process_eager()
1719 dd_dev_err(packet->rcd->dd, in kdeth_process_eager()
1720 "Unhandled eager packet received. Dropping.\n"); in kdeth_process_eager()
1724 static int process_receive_invalid(struct hfi1_packet *packet) in process_receive_invalid() argument
1726 dd_dev_err(packet->rcd->dd, "Invalid packet type %d. Dropping\n", in process_receive_invalid()
1727 rhf_rcv_type(packet->rhf)); in process_receive_invalid()
1733 struct hfi1_packet packet; in seqfile_dump_rcd() local
1744 init_packet(rcd, &packet); in seqfile_dump_rcd()
1745 init_ps_mdata(&mdata, &packet); in seqfile_dump_rcd()
1766 packet.hdr = hfi1_get_msgheader(rcd, rhf_addr); in seqfile_dump_rcd()
1767 hdr = packet.hdr; in seqfile_dump_rcd()
1772 packet.ohdr = &hdr->u.oth; in seqfile_dump_rcd()
1774 packet.ohdr = &hdr->u.l.oth; in seqfile_dump_rcd()
1778 opcode = (be32_to_cpu(packet.ohdr->bth[0]) >> 24); in seqfile_dump_rcd()
1779 qpn = be32_to_cpu(packet.ohdr->bth[1]) & RVT_QPN_MASK; in seqfile_dump_rcd()
1780 psn = mask_psn(be32_to_cpu(packet.ohdr->bth[2])); in seqfile_dump_rcd()