From: Olivier Matz Date: Wed, 12 Oct 2016 15:39:44 +0000 (+0200) Subject: app/testpmd: dump offload flags with new functions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3f3061f4a23da49a1cd945fec21dbe8ff02624ff;p=dpdk.git app/testpmd: dump offload flags with new functions Use the functions introduced in the previous commit to dump the offload flags. Signed-off-by: Olivier Matz Acked-by: Pablo de Lara --- diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 4fe038d2d8..2ecd6b8c87 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -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"); } } diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 9acc4c6c5d..fff815c666 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -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); }