Use the functions introduced in the previous commit to dump the offload
flags.

Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
---
 app/test-pmd/csumonly.c | 27 +++------------------------
 app/test-pmd/rxonly.c   | 15 ++-------------
 2 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 21cb78f..5ca5702 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -791,23 +791,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 },
-                       };
-                       unsigned j;
-                       const char *name;
+                       char buf[256];

                        printf("-----------------\n");
                        printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
@@ -837,13 +821,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
                                        m->outer_l2_len, m->outer_l3_len);
                        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 9acc4c6..fff815c 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);
        }

-- 
2.8.1

Reply via email to