app/testpmd: dump offload flags with new functions
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 12 Oct 2016 15:39:44 +0000 (17:39 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 12 Oct 2016 16:35:44 +0000 (18:35 +0200)
Use the functions introduced in the previous commit to dump the offload
flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test-pmd/csumonly.c
app/test-pmd/rxonly.c

index 4fe038d..2ecd6b8 100644 (file)
@@ -816,27 +816,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 
                /* if verbose mode is enabled, dump debug info */
                if (verbose_level > 0) {
-                       struct {
-                               uint64_t flag;
-                               uint64_t mask;
-                       } tx_flags[] = {
-                               { PKT_TX_IP_CKSUM, PKT_TX_IP_CKSUM },
-                               { PKT_TX_UDP_CKSUM, PKT_TX_L4_MASK },
-                               { PKT_TX_TCP_CKSUM, PKT_TX_L4_MASK },
-                               { PKT_TX_SCTP_CKSUM, PKT_TX_L4_MASK },
-                               { PKT_TX_IPV4, PKT_TX_IPV4 },
-                               { PKT_TX_IPV6, PKT_TX_IPV6 },
-                               { PKT_TX_OUTER_IP_CKSUM, PKT_TX_OUTER_IP_CKSUM },
-                               { PKT_TX_OUTER_IPV4, PKT_TX_OUTER_IPV4 },
-                               { PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV6 },
-                               { PKT_TX_TCP_SEG, PKT_TX_TCP_SEG },
-                               { PKT_TX_TUNNEL_VXLAN, PKT_TX_TUNNEL_MASK },
-                               { PKT_TX_TUNNEL_GRE, PKT_TX_TUNNEL_MASK },
-                               { PKT_TX_TUNNEL_IPIP, PKT_TX_TUNNEL_MASK },
-                               { PKT_TX_TUNNEL_GENEVE, PKT_TX_TUNNEL_MASK },
-                       };
-                       unsigned j;
-                       const char *name;
+                       char buf[256];
 
                        printf("-----------------\n");
                        printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
@@ -872,13 +852,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
                                                m->tso_segsz);
                        } else if (info.tso_segsz != 0)
                                printf("tx: m->tso_segsz=%d\n", m->tso_segsz);
-                       printf("tx: flags=");
-                       for (j = 0; j < sizeof(tx_flags)/sizeof(*tx_flags); j++) {
-                               name = rte_get_tx_ol_flag_name(tx_flags[j].flag);
-                               if ((m->ol_flags & tx_flags[j].mask) ==
-                                       tx_flags[j].flag)
-                                       printf("%s ", name);
-                       }
+                       rte_get_tx_ol_flag_list(m->ol_flags, buf, sizeof(buf));
+                       printf("tx: flags=%s", buf);
                        printf("\n");
                }
        }
index 9acc4c6..fff815c 100644 (file)
@@ -229,19 +229,8 @@ pkt_burst_receive(struct fwd_stream *fs)
                }
                printf(" - Receive queue=0x%x", (unsigned) fs->rx_queue);
                printf("\n");
-               if (ol_flags != 0) {
-                       unsigned rxf;
-                       const char *name;
-
-                       for (rxf = 0; rxf < sizeof(mb->ol_flags) * 8; rxf++) {
-                               if ((ol_flags & (1ULL << rxf)) == 0)
-                                       continue;
-                               name = rte_get_rx_ol_flag_name(1ULL << rxf);
-                               if (name == NULL)
-                                       continue;
-                               printf("  %s\n", name);
-                       }
-               }
+               rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+               printf("  ol_flags: %s\n", buf);
                rte_pktmbuf_free(mb);
        }