Debian Codegraph @

prov/opx/src/fi_opx_hfi1_wfr.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2024 Cornelis Networks.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33 #include "rdma/opx/fi_opx_endpoint.h"
34 #include "rdma/opx/fi_opx_hfi1_version.h"
35
36 void opx_wfr_rhe_debug(struct fi_opx_ep *opx_ep, volatile uint64_t *rhe_ptr, volatile uint32_t *rhf_ptr,
37 const uint32_t rhf_msb, const uint32_t rhf_lsb, const uint64_t rhf_seq,
38 const uint64_t hdrq_offset, const uint64_t rhf_rcvd, const union opx_hfi1_packet_hdr *const hdr,
39 const enum opx_hfi1_type hfi1_type)
40 {
41 #ifdef OPX_VERBOSE_TRIGGER // verbose output
42 fprintf(stderr,
43 #else
44 FI_DBG_TRACE(
45 fi_opx_global.prov, FI_LOG_EP_DATA,
46 #endif
47 "RHF(%#16.16lX) RHE %#8.8X is ERRORED %u, UseEgrBuf %u, EgrIndex %#X/%#X, EgrOffset %#X, %s%s%s %s%s%s%s%s%s%s%s \n",
48 rhf_rcvd, rhf_msb & 0xBFE00000u, OPX_IS_ERRORED_RHF(rhf_rcvd, hfi1_type) != 0UL,
49 OPX_RHF_IS_USE_EGR_BUF(rhf_rcvd, hfi1_type), (uint32_t) OPX_RHF_EGR_INDEX(rhf_rcvd, hfi1_type),
50 opx_ep->rx->egrq.last_egrbfr_index, (uint32_t) OPX_RHF_EGR_OFFSET(rhf_rcvd, hfi1_type),
51 OPX_RHF_RCV_TYPE_EXPECTED_RCV(rhf_rcvd, hfi1_type) ? "EXPECTED_RCV" : "",
52 OPX_RHF_RCV_TYPE_EAGER_RCV(rhf_rcvd, hfi1_type) ? "EAGER_RCV" : "",
53 OPX_RHF_RCV_TYPE_OTHER(rhf_rcvd, hfi1_type) ? "OTHER RCV" : "",
54 rhf_msb & OPX_WFR_RHF_ICRCERR ? "OPX_WFR_RHF_ICRCERR" : "",
55 rhf_msb & OPX_WFR_RHF_LENERR ? "OPX_WFR_RHF_LENERR" : "",
56 rhf_msb & OPX_WFR_RHF_ECCERR ? "OPX_WFR_RHF_ECCERR" : "",
57 rhf_msb & OPX_WFR_RHF_TIDERR ? "OPX_WFR_RHF_TIDERR" : "",
58 rhf_msb & OPX_WFR_RHF_DCERR ? "OPX_WFR_RHF_DCERR" : "",
59 rhf_msb & OPX_WFR_RHF_DCUNCERR ? "OPX_WFR_RHF_DCUNCERR" : "",
60 rhf_msb & OPX_WFR_RHF_KHDRLENERR ? "OPX_WFR_RHF_KHDRLENERR" : "",
61 rhf_msb & OPX_WFR_RHF_RCVTYPEERR ? "OPX_WFR_RHF_RCVTYPEERR" : "");
62
63 FI_WARN(fi_opx_global.prov, FI_LOG_EP_DATA,
64 "%s HEADER ERROR RHF(%#16.16lX) RHE(%#8.8X) %s%s%s %s%s%s%s%s%s%s%s \n", OPX_HFI_TYPE_STRING(hfi1_type),
65 rhf_rcvd, rhf_msb & 0xBFE00000u,
66 OPX_RHF_RCV_TYPE_EXPECTED_RCV(rhf_rcvd, hfi1_type) ? "EXPECTED_RCV" : "",
67 OPX_RHF_RCV_TYPE_EAGER_RCV(rhf_rcvd, hfi1_type) ? "EAGER_RCV" : "",
68 OPX_RHF_RCV_TYPE_OTHER(rhf_rcvd, hfi1_type) ? "OTHER RCV" : "",
69 rhf_msb & OPX_WFR_RHF_ICRCERR ? "OPX_WFR_RHF_ICRCERR" : "",
70 rhf_msb & OPX_WFR_RHF_LENERR ? "OPX_WFR_RHF_LENERR" : "",
71 rhf_msb & OPX_WFR_RHF_ECCERR ? "OPX_WFR_RHF_ECCERR" : "",
72 rhf_msb & OPX_WFR_RHF_TIDERR ? "OPX_WFR_RHF_TIDERR" : "",
73 rhf_msb & OPX_WFR_RHF_DCERR ? "OPX_WFR_RHF_DCERR" : "",
74 rhf_msb & OPX_WFR_RHF_DCUNCERR ? "OPX_WFR_RHF_DCUNCERR" : "",
75 rhf_msb & OPX_WFR_RHF_KHDRLENERR ? "OPX_WFR_RHF_KHDRLENERR" : "",
76 rhf_msb & OPX_WFR_RHF_RCVTYPEERR ? "OPX_WFR_RHF_RCVTYPEERR" : "");
77
78 FI_OPX_DEBUG_COUNTERS_INC(opx_ep->debug_counters.rhf.error);
79 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_ICRCERR, opx_ep->debug_counters.rhf.icrcerr);
80 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_LENERR, opx_ep->debug_counters.rhf.lenerr);
81 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_ECCERR, opx_ep->debug_counters.rhf.eccerr);
82 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_TIDERR, opx_ep->debug_counters.rhf.tiderr);
83 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_DCERR, opx_ep->debug_counters.rhf.dcerr);
84 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_DCUNCERR, opx_ep->debug_counters.rhf.dcuncerr);
85 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_KHDRLENERR, opx_ep->debug_counters.rhf.khdrlenerr);
86 FI_OPX_DEBUG_COUNTERS_INC_COND(rhf_msb & OPX_WFR_RHF_RCVTYPEERR, opx_ep->debug_counters.rhf.rcvtypeerr);
87 /* Count the packet type that had an error */
88 FI_OPX_DEBUG_COUNTERS_INC_COND((OPX_RHF_RCV_TYPE_EXPECTED_RCV(rhf_rcvd, hfi1_type)),
89 opx_ep->debug_counters.rhf.rcvtypeexp);
90 FI_OPX_DEBUG_COUNTERS_INC_COND((OPX_RHF_RCV_TYPE_EAGER_RCV(rhf_rcvd, hfi1_type)),
91 opx_ep->debug_counters.rhf.rcvtypeegr);
92 FI_OPX_DEBUG_COUNTERS_INC_COND((OPX_RHF_RCV_TYPE_OTHER(rhf_rcvd, hfi1_type)),
93 opx_ep->debug_counters.rhf.rcvtypeoth);
94
95 #ifdef OPX_VERBOSE_TRIGGER // verbose output
96 fi_opx_hfi1_dump_packet_hdr(hdr, hfi1_type, "OPX_IS_ERRORED_RHF", __LINE__);
97 #endif
98
99 return;
100 }