| 61 | #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER |
| 62 | #define DISPLAY_PRINT printf |
| 63 | static void dpaa_display_frame_info(const struct qm_fd *fd, |
| 64 | uint32_t fqid, bool rx) |
| 65 | { |
| 66 | int ii; |
| 67 | char *ptr; |
| 68 | struct annotations_t *annot = rte_dpaa_mem_ptov(fd->addr); |
| 69 | uint8_t format; |
| 70 | |
| 71 | if (!fd->status) { |
| 72 | /* Do not display correct packets.*/ |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> |
| 77 | DPAA_FD_FORMAT_SHIFT; |
| 78 | |
| 79 | DISPLAY_PRINT("fqid %d bpid %d addr 0x%lx, format %d\r\n", |
| 80 | fqid, fd->bpid, (unsigned long)fd->addr, fd->format); |
| 81 | DISPLAY_PRINT("off %d, len %d stat 0x%x\r\n", |
| 82 | fd->offset, fd->length20, fd->status); |
| 83 | if (rx) { |
| 84 | ptr = (char *)&annot->parse; |
| 85 | DISPLAY_PRINT("RX parser result:\r\n"); |
| 86 | for (ii = 0; ii < (int)sizeof(struct dpaa_eth_parse_results_t); |
| 87 | ii++) { |
| 88 | DISPLAY_PRINT("%02x ", ptr[ii]); |
| 89 | if (((ii + 1) % 16) == 0) |
| 90 | DISPLAY_PRINT("\n"); |
| 91 | } |
| 92 | DISPLAY_PRINT("\n"); |
| 93 | } |
| 94 | |
| 95 | if (unlikely(format == qm_fd_sg)) { |
| 96 | /*TBD:S/G display: to be implemented*/ |
| 97 | return; |
| 98 | } |
| 99 | |
| 100 | DISPLAY_PRINT("Frame payload:\r\n"); |
| 101 | ptr = (char *)annot; |
| 102 | ptr += fd->offset; |
| 103 | for (ii = 0; ii < fd->length20; ii++) { |
| 104 | DISPLAY_PRINT("%02x ", ptr[ii]); |
| 105 | if (((ii + 1) % 16) == 0) |
| 106 | printf("\n"); |
| 107 | } |
| 108 | DISPLAY_PRINT("\n"); |
| 109 | } |
| 110 | #else |
| 111 | #define dpaa_display_frame_info(a, b, c) |
| 112 | #endif |
no test coverage detected