| 68 | } |
| 69 | |
| 70 | static inline void |
| 71 | dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], |
| 72 | uint16_t nb_pkts, int is_rx) |
| 73 | { |
| 74 | struct rte_mbuf *mb; |
| 75 | const struct rte_ether_hdr *eth_hdr; |
| 76 | struct rte_ether_hdr _eth_hdr; |
| 77 | uint16_t eth_type; |
| 78 | uint64_t ol_flags; |
| 79 | uint16_t i, packet_type; |
| 80 | uint16_t is_encapsulation; |
| 81 | char buf[256]; |
| 82 | struct rte_net_hdr_lens hdr_lens; |
| 83 | uint32_t sw_packet_type; |
| 84 | uint16_t udp_port; |
| 85 | uint32_t vx_vni; |
| 86 | const char *reason; |
| 87 | int dynf_index; |
| 88 | char print_buf[MAX_STRING_LEN]; |
| 89 | size_t buf_size = MAX_STRING_LEN; |
| 90 | size_t cur_len = 0; |
| 91 | uint64_t restore_info_dynflag; |
| 92 | |
| 93 | if (!nb_pkts) |
| 94 | return; |
| 95 | restore_info_dynflag = rte_flow_restore_info_dynflag(); |
| 96 | MKDUMPSTR(print_buf, buf_size, cur_len, |
| 97 | "port %u/queue %u: %s %u packets\n", port_id, queue, |
| 98 | is_rx ? "received" : "sent", (unsigned int) nb_pkts); |
| 99 | for (i = 0; i < nb_pkts; i++) { |
| 100 | struct rte_flow_error error; |
| 101 | struct rte_flow_restore_info info = { 0, }; |
| 102 | |
| 103 | mb = pkts[i]; |
| 104 | ol_flags = mb->ol_flags; |
| 105 | if (rxq_share > 0) |
| 106 | MKDUMPSTR(print_buf, buf_size, cur_len, "port %u, ", |
| 107 | mb->port); |
| 108 | eth_hdr = rte_pktmbuf_read(mb, 0, sizeof(_eth_hdr), &_eth_hdr); |
| 109 | eth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type); |
| 110 | packet_type = mb->packet_type; |
| 111 | is_encapsulation = RTE_ETH_IS_TUNNEL_PKT(packet_type); |
| 112 | if ((ol_flags & restore_info_dynflag) != 0 && |
| 113 | rte_flow_get_restore_info(port_id, mb, &info, &error) == 0) { |
| 114 | MKDUMPSTR(print_buf, buf_size, cur_len, |
| 115 | "restore info:"); |
| 116 | if (info.flags & RTE_FLOW_RESTORE_INFO_TUNNEL) { |
| 117 | struct port_flow_tunnel *port_tunnel; |
| 118 | |
| 119 | port_tunnel = port_flow_locate_tunnel |
| 120 | (port_id, &info.tunnel); |
| 121 | MKDUMPSTR(print_buf, buf_size, cur_len, |
| 122 | " - tunnel"); |
| 123 | if (port_tunnel) |
| 124 | MKDUMPSTR(print_buf, buf_size, cur_len, |
| 125 | " #%u", port_tunnel->id); |
| 126 | else |
| 127 | MKDUMPSTR(print_buf, buf_size, cur_len, |
no test coverage detected