From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 8DD9D7E7F for ; Wed, 12 Oct 2016 17:40:24 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 2751328389; Wed, 12 Oct 2016 17:40:19 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org, pablo.de.lara.guarch@intel.com Cc: thomas.monjalon@6wind.com Date: Wed, 12 Oct 2016 17:39:44 +0200 Message-Id: <1476286790-26271-3-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1476286790-26271-1-git-send-email-olivier.matz@6wind.com> References: <1475856318-24616-1-git-send-email-olivier.matz@6wind.com> <1476286790-26271-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH v6 2/8] app/testpmd: use new function to dump offload flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 15:40:24 -0000 Use the functions introduced in the previous commit to dump the offload flags. Signed-off-by: Olivier Matz Acked-by: Pablo de Lara --- app/test-pmd/csumonly.c | 31 +++---------------------------- app/test-pmd/rxonly.c | 15 ++------------- 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 4fe038d..2ecd6b8 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 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