Commit 3802f7eb authored by Dean Luick's avatar Dean Luick Committed by Greg Kroah-Hartman

staging/rdma/hfi1: Add aeth name syndrome decode

Add aeth name syndrome decode to enhance debugging.

The IBTA RC ACK contains an ACK extended transport header.

Part of that header is the syndrome field that qualifies the RC ACK as an
ACK, NAK, or RNR NAK.

Without the patch here is the syndrome decode:
aeth syn 0x00

Here is the decode with the fix:
aeth syn 0x00 ACK
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarDean Luick <dean.luick@intel.com>
Signed-off-by: default avatarJubin John <jubin.john@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 93990be3
...@@ -67,7 +67,7 @@ u8 ibhdr_exhdr_len(struct hfi1_ib_header *hdr) ...@@ -67,7 +67,7 @@ u8 ibhdr_exhdr_len(struct hfi1_ib_header *hdr)
#define IMM_PRN "imm %d" #define IMM_PRN "imm %d"
#define RETH_PRN "reth vaddr 0x%.16llx rkey 0x%.8x dlen 0x%.8x" #define RETH_PRN "reth vaddr 0x%.16llx rkey 0x%.8x dlen 0x%.8x"
#define AETH_PRN "aeth syn 0x%.2x msn 0x%.8x" #define AETH_PRN "aeth syn 0x%.2x %s msn 0x%.8x"
#define DETH_PRN "deth qkey 0x%.8x sqpn 0x%.6x" #define DETH_PRN "deth qkey 0x%.8x sqpn 0x%.6x"
#define ATOMICACKETH_PRN "origdata %lld" #define ATOMICACKETH_PRN "origdata %lld"
#define ATOMICETH_PRN "vaddr 0x%llx rkey 0x%.8x sdata %lld cdata %lld" #define ATOMICETH_PRN "vaddr 0x%llx rkey 0x%.8x sdata %lld cdata %lld"
...@@ -79,6 +79,19 @@ static u64 ib_u64_get(__be32 *p) ...@@ -79,6 +79,19 @@ static u64 ib_u64_get(__be32 *p)
return ((u64)be32_to_cpu(p[0]) << 32) | be32_to_cpu(p[1]); return ((u64)be32_to_cpu(p[0]) << 32) | be32_to_cpu(p[1]);
} }
static const char *parse_syndrome(u8 syndrome)
{
switch (syndrome >> 5) {
case 0:
return "ACK";
case 1:
return "RNRNAK";
case 3:
return "NAK";
}
return "";
}
const char *parse_everbs_hdrs( const char *parse_everbs_hdrs(
struct trace_seq *p, struct trace_seq *p,
u8 opcode, u8 opcode,
...@@ -124,16 +137,18 @@ const char *parse_everbs_hdrs( ...@@ -124,16 +137,18 @@ const char *parse_everbs_hdrs(
case OP(RC, RDMA_READ_RESPONSE_LAST): case OP(RC, RDMA_READ_RESPONSE_LAST):
case OP(RC, RDMA_READ_RESPONSE_ONLY): case OP(RC, RDMA_READ_RESPONSE_ONLY):
case OP(RC, ACKNOWLEDGE): case OP(RC, ACKNOWLEDGE):
trace_seq_printf(p, AETH_PRN, trace_seq_printf(p, AETH_PRN, be32_to_cpu(eh->aeth) >> 24,
be32_to_cpu(eh->aeth) >> 24, parse_syndrome(be32_to_cpu(eh->aeth) >> 24),
be32_to_cpu(eh->aeth) & HFI1_MSN_MASK); be32_to_cpu(eh->aeth) & HFI1_MSN_MASK);
break; break;
/* aeth + atomicacketh */ /* aeth + atomicacketh */
case OP(RC, ATOMIC_ACKNOWLEDGE): case OP(RC, ATOMIC_ACKNOWLEDGE):
trace_seq_printf(p, AETH_PRN " " ATOMICACKETH_PRN, trace_seq_printf(p, AETH_PRN " " ATOMICACKETH_PRN,
(be32_to_cpu(eh->at.aeth) >> 24) & 0xff, be32_to_cpu(eh->at.aeth) >> 24,
parse_syndrome(be32_to_cpu(eh->at.aeth) >> 24),
be32_to_cpu(eh->at.aeth) & HFI1_MSN_MASK, be32_to_cpu(eh->at.aeth) & HFI1_MSN_MASK,
(unsigned long long)ib_u64_get(eh->at.atomic_ack_eth)); (unsigned long long)
ib_u64_get(eh->at.atomic_ack_eth));
break; break;
/* atomiceth */ /* atomiceth */
case OP(RC, COMPARE_SWAP): case OP(RC, COMPARE_SWAP):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment