From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40056.outbound.protection.outlook.com [40.107.4.56]) by dpdk.org (Postfix) with ESMTP id 48F761041 for ; Wed, 12 Sep 2018 10:06:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sMlFS29Yz2+WdMVpNVoYTiDIraEbhD6zRhDemHTVJ1Q=; b=dBK7arvgpXrvE6DHx5RE9h9LWUwAYSmC9OJABXgPUbSujQ01CcFVUli/dZlt1HX+0H7Sr9fotvzthzJyrJxQ/tDCTh+yGYW4yPz97dBDho9AuPHIzwefQYuVg2bZ1CzXth+SdwxtKsE20KEUZfwJT24iqxOQhUiaJs5rY74cn7g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB5PR05MB1255.eurprd05.prod.outlook.com (2a01:111:e400:51cc::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Wed, 12 Sep 2018 08:06:34 +0000 From: Raslan Darawsheh To: jingjing.wu@intel.com Cc: thomas@monjalon.net, dev@dpdk.org, shahafs@mellanox.com, rasland@mellanox.com, xuemingl@mellanox.com Date: Wed, 12 Sep 2018 11:06:23 +0300 Message-Id: <1536739583-29166-2-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536739583-29166-1-git-send-email-rasland@mellanox.com> References: <1536739583-29166-1-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: LO2P265CA0118.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::34) To DB5PR05MB1255.eurprd05.prod.outlook.com (2a01:111:e400:51cc::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19351b8e-07f2-4048-5c52-08d61886a897 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB5PR05MB1255; X-Microsoft-Exchange-Diagnostics: 1; DB5PR05MB1255; 3:5NC740YT/hL+/7S7PZz5m6YsA0Sf0/vQY3jCrwBHkz+HsSs5SnlDV4OVL4d7lTUeIl8lGciXPRQhNW3zo/A7xJA+UMs6oMpZSY2Sr74QkUqUkJyrVKdr/jt2vwwpt82xmNMg7UAwm4/rPZ0GIPOfC19IPtBLlE4Z4564WlQ9ptjkLmb6QpdwMCk1rBnNaSyg7eJwNULKOTspB8xIDdDCns2z1yqYPAv7H1r5tOTM+4IH5E73BkM8dzFeHAE9jXhA; 25:ZwpS/MDHhld/rTiKmKuBxp9gHJ0/rmWecndPbLmBlavwoeUFqf7dAGJ+wK4wrb82okfywXK/ljOY4OHnUHPtX6rlgVqsnjLj6Uhh92LcJz7XZevgtM3tSsG4w6QQa48UzXH4lutmvHm+vD2pQGVirLpnuEnv6n3uVSZKkSZWEzR+lTG3wy3yU1xZwzqI0G5LoNy053CaiqUE+h6Id7gEc8ID34HUWt7DMDSOdWQcoF6AdADbn9KAM44l4b6yNXrt8rX/EOhY8ORaUJMqZFHa5+BLao32ZO/GOc1j5XPxF4SfYgSwsGzhCjSOdjXLPVlCJR/+oiDUXzuH+h0i831Rdw==; 31:F7Nq+yfvwbRwtXOJ+Ya/kIdPkFkzeWug2VXJVgXyNKBWGJ/WwE3EwBj3iuIiJSrZMfQWIqR5HCXbQlURtrwi5386u3osazjtYPJ2JakJQ6/ApErxX9ujiZK/Yeq7wWf7UbLKnmb5demLeXuOrobZfOo85MTcY7iBgAkkq8lOqa1JvcR06IBCTC6WleYf3imwhSV1c6k22oLtZY9o6ytXmE93wiXrPwFi/WrxJTc56dE= X-MS-TrafficTypeDiagnostic: DB5PR05MB1255: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB5PR05MB1255; 20:9kllSez+7squ76Kggcjy31teNYj5t64Ircqn3hXEwSlb/zeZDBXF6ivjM+B3Anyhd7ncGJDF3+2ZctYxzhICXSwwJh1yvo+t4Q74sUyKb20AJreOxlHMVEWq3ejUvQCLVSVhn5o4Jx6f9b0QP9bb7j1GDg6k/1FnoHmTXP+qnnHwUuQxG1gmfRIBDdI0Wfqpb2A2+3ldZv6pLiYousCn8HXSwqYo4CMUKUu5Fl3O8iJMKCshDwZOSvGYQijDsymBekkezm+vDauSeabom8WhDk3oEkmd8H7c8ixI2IfWs7D2oGlYewCpgK0q8FIzuP8TJckBI5hC71iS6gUyOgBP0kx5YNeaYPwlyP4odj0+jufO3kJePwaTcjSY5u31nkj7NJoBfiFUOn41Z+7OsuEGJfXSEfFaqCMT7ymAqTM3ChUjDlejplJM8sjs4qZhgr2DLrYgm1Dpm8e35Cmgwmx+/5FHsUSUpT/9T94ySzpdw2phf8/t17FRAvSBvF0x3ZzK; 4:0b8j8JeCVk2laL4lh2RzMc57A7H5unFW7esaKqKYYaxbtuf8x7vnWPqWYzcU0aTFEYQGQaNCp4k3txq9RhP1SPZSnVALCAext+L6pBrAzRJ2t8oNCOix/5jKU4x+3duFIKomMdWbRMVFCKJVR+96w7FCQrmHXdbUSgPKvo8m3MEjVVAd49eqPpHu/xdWWKoNkohwYxKvz4ur75okCVYZv9nayIumLwr/0Hm61KxXd13BnBuLasyYHscOGxAg54XGVJ7qrYwRov92Bm4Hfwa9bA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:DB5PR05MB1255; BCL:0; PCL:0; RULEID:; SRVR:DB5PR05MB1255; X-Forefront-PRVS: 07935ACF08 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(346002)(366004)(376002)(39860400002)(396003)(189003)(199004)(2906002)(386003)(33026002)(7736002)(69596002)(186003)(26005)(107886003)(25786009)(97736004)(478600001)(4326008)(8676002)(66066001)(16526019)(86362001)(6116002)(3846002)(47776003)(5660300001)(16586007)(50226002)(36756003)(2351001)(55016002)(105586002)(106356001)(316002)(476003)(486006)(446003)(11346002)(2616005)(21086003)(956004)(68736007)(52116002)(7696005)(2361001)(76176011)(305945005)(6916009)(48376002)(81156014)(53936002)(51416003)(8936002)(50466002)(6666003)(81166006)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR05MB1255; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR05MB1255; 23:z1rsY/96Ouwg+HvIt8xb11Y6mkeJ+BbAb8hhROXeu?= =?us-ascii?Q?nqOWXViCsohG3GEaqABihy6mckGAb7yPePOtrgYHdv/spa4FCppJ53Fkv/Yq?= =?us-ascii?Q?SlbVGayXFHuLA0UUEqODXEcwxiJWMpBlN7NdHbDAr+ljFvylO+Cl9Hx2mxAM?= =?us-ascii?Q?/NHSJhSp9RbizbI0+njFkcPRl329ljEhTvFT6Voes40zZXCzwF11Z9HW35MW?= =?us-ascii?Q?j8hbdKTbWeasLI+rP9hSaf4fY6C03XOaO0JGRqeyXXWZ/uDi9AAduGWsqaZJ?= =?us-ascii?Q?cTZ7wTr5qPSIXe5i/BlBWrkd5hOw/srh9dtgf1LyyDdyN6L1YoZ2SwX6g4H1?= =?us-ascii?Q?LacVl1i9eiQ0i09xtXftPthH9rLE7RbemSrNJfTrvvfhvYacYL16DOURVBFb?= =?us-ascii?Q?7zEmYpUoScg8B6epQkF1ZBvLmnReY6bNpxeVI460KZ0nBYfMJNbawtX/csKw?= =?us-ascii?Q?KapPeWKf/teVmc1tNgLJnDszDnN0bripRoUtX6m3XPbeodrcWneKqr6t7Pg7?= =?us-ascii?Q?qk+TBRsxlkvZRfrDaJ36KqO0SWAHDXCTcsqNoicdF73+soDwvXxeZ3MVTexX?= =?us-ascii?Q?yQh3cuz+R8ws+ix+Ms/k6LS40q1cV0d79A6e/BOhAQDpseBIc15go52WXZbo?= =?us-ascii?Q?WfJFkolJ6tTxJtBNSAkg9hVOJWMhfkgzzuicrapLnFqEIoGprFAwdXlH6Qlv?= =?us-ascii?Q?ohMjyXCvpVTgKpKT0ZBpx9PRfciUTXZjgo2gbjUdmksbeekSg/f8m6FFfeBo?= =?us-ascii?Q?QuE6Vu5vUvr7yPON05R0s2PVuPamEKKUXi9Z047bHQNwNr6cdlp8MptRq1ZV?= =?us-ascii?Q?CY8lQbvoWaVfavG7J1dOSOLoNTWhCosstrwKY0eDHvCDNYOz5nf07J53FR70?= =?us-ascii?Q?c1QBS6uhS18hczSOGNHZ3rquzEZxqoxkbE+EqT1x35xgayxZaW91Kij+/lSg?= =?us-ascii?Q?iFZQkFQ6dl2qc53mfGXNqUJt5KzADMa2l35E8UNZy9NqQpIqeNJkjXZHyKyV?= =?us-ascii?Q?4UoGtWzvX7yGszqD0phBO8Frw54I4C7sQOIbO2D5QdvxSTECY8/giURRJF/s?= =?us-ascii?Q?T+lDU3NoW1bBICCQZoyjKG5mDjaBRzYAr9RqXKX8QBTyjnjuN8KBCyPvwGBh?= =?us-ascii?Q?nVilJIZ8j13K3qURUyTvCCuQMyn82FlMNkUbIefNzZwM4NCmcRLDAHXzhIzp?= =?us-ascii?Q?pYsexZcwhhTw3PRJ19oOY/ZSO/uNPAiEfibgOjtTJ4LVWFaD1gl3sqtQ0DFp?= =?us-ascii?Q?D+ZqVB11XZXV+WiHeOX24/ePPKwlXHDpL/aH7U/w0xZy1KZUNqW1gExNV3C4?= =?us-ascii?B?UT09?= X-Microsoft-Antispam-Message-Info: T3iJUdHrg2piiVJJIFyGjZosDq4QzAXGZDC3MA6c6dXFiX2y3UBrghPIcY66j02ZZW14hl9TzU3Jux94zfL1ziWAop17BGT5yGotmfANVpi9FRUUqaTXyO+zUmBHff+72pB4c8Gl1FsExnmZ5FGwo+BNNOomJKVZ7fdUgRxxNvxt2kt6ofQvBE4uAduOn56cJ10QoaiVGJgP99W5swSVaCShIYXbYisxb/532Y/ePsY81xOOuWNpoKwHRRWyeSlK05PFAkws8PEw57HMiOktH6ave6aXgC14dq7wp7n/XNC5AnQn8+HsqEjA/pzT1LRbANWMYdBwUHDJS+6jymxAhPlOV7OgkA2Gr+hUdjvJRn4= X-Microsoft-Exchange-Diagnostics: 1; DB5PR05MB1255; 6:+11Z95Fi/7YIjikHw4i3Lus9UciA9FgUHccPB01mY5aySX3smsxZjh3IehElXPH3/iZmV0+yUoVT46v9KO3FDkvRmdXmFdDuKwtO6YehiQ0Zvnb2QkrTginBmNYWSP+/dQN/JprvJ7/ZpZxExwhgBIucxGelPvsd0DwpXH5o/Raz591uXlcK3slG89ErRzuMLr/AMOzL0fwNvtts3P7jbX4TMPZQRT+NwX+l35Mrcl4g+j3uMGsjfgxxJKBziNEo//iv2eqhQwpYXDUYlMUxY/4Ijfr9w9z+wquxvIOww2H6GElO+Eg+odLMa8vkG/sOwFE6Pk4FA7SEgZkZSMyixef25sNSL/8E3INyN6hOvLRbfihzROTWCI/xAv/Sgruhiseku2qhjFqigBNoWHakm0CjbvKRWxOJAzWYESnzzk2+cQ2+bC6QfhPbOa6DAn9kYm/Y4/hyQkdTbHVHWTJ5WQ==; 5:+dJ79m3l2hO/6gdeG292kQD+yaWEyEEBwzNtx+UrEX7yN3YG55vXkSvfIgTYTrhKqTkxWaodEnSjeCTCBhQ+jI74EowQN1vpmqkTEgm/QBCPS2mDs6GlxeZWNECFIkYVC5KDAFcHWftayQCCc9JdG/dKptT/P+YEGa8zg0R4AaE=; 7:Za+8t58pe6q0ixAuwizuSuZetkWkvR6+KaeLN9JYvFgJjraUf/eRfNApApwbLDwKNHsCiNRT0V3UUTu5FBPFWxG4MWTsE4zK7oKeBbU7yrvqyYoGmbrjaoj3PnS+2r7oBOSJRPlugIk3rHCud/Hvd53mQkgnxf/LJR/ku/alJKhvHOc1IksoVDXK1Peu5mB8MH09FQCvuCs9OQpp+SzaksEyW5NvtiGz6vPpDMHc1MilfEx+YXIOMV3zzUqrGht8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 08:06:34.3929 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19351b8e-07f2-4048-5c52-08d61886a897 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR05MB1255 Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: use the generic function to dump packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2018 08:06:36 -0000 use the generic function to dump packets for several forwarding engines. To dump received packets first bit of verbosity need to be set and for sent packets verbosity second bit need to be set. for example: dump rx : set verbose 1 dump tx : set verbose 2 dump rx and tx : set verbose 3 Signed-off-by: Raslan Darawsheh --- app/test-pmd/iofwd.c | 2 + app/test-pmd/macfwd.c | 4 ++ app/test-pmd/macswap.c | 4 ++ app/test-pmd/rxonly.c | 136 ++----------------------------------------------- 4 files changed, 15 insertions(+), 131 deletions(-) diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c index 9dce76e..7c09271 100644 --- a/app/test-pmd/iofwd.c +++ b/app/test-pmd/iofwd.c @@ -69,6 +69,8 @@ pkt_burst_io_forward(struct fwd_stream *fs) if (unlikely(nb_rx == 0)) return; fs->rx_packets += nb_rx; + if (unlikely(verbose_level & 0x1)) + dump_pkt_burst(fs, pkts_burst, nb_rx, 1); #ifdef RTE_TEST_PMD_RECORD_BURST_STATS fs->rx_burst_stats.pkt_burst_spread[nb_rx]++; diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 7cac757..b1b00bc 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -78,6 +78,8 @@ pkt_burst_mac_forward(struct fwd_stream *fs) fs->rx_burst_stats.pkt_burst_spread[nb_rx]++; #endif fs->rx_packets += nb_rx; + if (unlikely(verbose_level & 0x1)) + dump_pkt_burst(fs, pkts_burst, nb_rx, 1); txp = &ports[fs->tx_port]; tx_offloads = txp->dev_conf.txmode.offloads; if (tx_offloads & DEV_TX_OFFLOAD_VLAN_INSERT) @@ -117,6 +119,8 @@ pkt_burst_mac_forward(struct fwd_stream *fs) } fs->tx_packets += nb_tx; + if (unlikely(verbose_level & 0x2)) + dump_pkt_burst(fs, pkts_burst, nb_tx, 0); #ifdef RTE_TEST_PMD_RECORD_BURST_STATS fs->tx_burst_stats.pkt_burst_spread[nb_tx]++; #endif diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index a8384d5..5611bf8 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -107,6 +107,8 @@ pkt_burst_mac_swap(struct fwd_stream *fs) fs->rx_burst_stats.pkt_burst_spread[nb_rx]++; #endif fs->rx_packets += nb_rx; + if (unlikely(verbose_level & 0x1)) + dump_pkt_burst(fs, pkts_burst, nb_rx, 1); txp = &ports[fs->tx_port]; tx_offloads = txp->dev_conf.txmode.offloads; if (tx_offloads & DEV_TX_OFFLOAD_VLAN_INSERT) @@ -147,6 +149,8 @@ pkt_burst_mac_swap(struct fwd_stream *fs) } } fs->tx_packets += nb_tx; + if (unlikely(verbose_level & 0x2)) + dump_pkt_burst(fs, pkts_burst, nb_tx, 0); #ifdef RTE_TEST_PMD_RECORD_BURST_STATS fs->tx_burst_stats.pkt_burst_spread[nb_tx]++; #endif diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index a93d806..f9bfdeb 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -40,14 +40,6 @@ #include "testpmd.h" -static inline void -print_ether_addr(const char *what, struct ether_addr *eth_addr) -{ - char buf[ETHER_ADDR_FMT_SIZE]; - ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); - printf("%s%s", what, buf); -} - /* * Received a burst of packets. */ @@ -55,16 +47,8 @@ static void pkt_burst_receive(struct fwd_stream *fs) { struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; - struct rte_mbuf *mb; - struct ether_hdr *eth_hdr; - uint16_t eth_type; - uint64_t ol_flags; uint16_t nb_rx; - uint16_t i, packet_type; - uint16_t is_encapsulation; - char buf[256]; - struct rte_net_hdr_lens hdr_lens; - uint32_t sw_packet_type; + uint16_t i; #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES uint64_t start_tsc; @@ -90,120 +74,10 @@ pkt_burst_receive(struct fwd_stream *fs) /* * Dump each received packet if verbose_level > 0. */ - if (verbose_level > 0) - printf("port %u/queue %u: received %u packets\n", - fs->rx_port, - (unsigned) fs->rx_queue, - (unsigned) nb_rx); - for (i = 0; i < nb_rx; i++) { - mb = pkts_burst[i]; - if (verbose_level == 0) { - rte_pktmbuf_free(mb); - continue; - } - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); - eth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type); - ol_flags = mb->ol_flags; - packet_type = mb->packet_type; - is_encapsulation = RTE_ETH_IS_TUNNEL_PKT(packet_type); - - print_ether_addr(" src=", ð_hdr->s_addr); - print_ether_addr(" - dst=", ð_hdr->d_addr); - printf(" - type=0x%04x - length=%u - nb_segs=%d", - eth_type, (unsigned) mb->pkt_len, - (int)mb->nb_segs); - if (ol_flags & PKT_RX_RSS_HASH) { - printf(" - RSS hash=0x%x", (unsigned) mb->hash.rss); - printf(" - RSS queue=0x%x",(unsigned) fs->rx_queue); - } - if (ol_flags & PKT_RX_FDIR) { - printf(" - FDIR matched "); - if (ol_flags & PKT_RX_FDIR_ID) - printf("ID=0x%x", - mb->hash.fdir.hi); - else if (ol_flags & PKT_RX_FDIR_FLX) - printf("flex bytes=0x%08x %08x", - mb->hash.fdir.hi, mb->hash.fdir.lo); - else - printf("hash=0x%x ID=0x%x ", - mb->hash.fdir.hash, mb->hash.fdir.id); - } - if (ol_flags & PKT_RX_TIMESTAMP) - printf(" - timestamp %"PRIu64" ", mb->timestamp); - if (ol_flags & PKT_RX_VLAN_STRIPPED) - printf(" - VLAN tci=0x%x", mb->vlan_tci); - if (ol_flags & PKT_RX_QINQ_STRIPPED) - printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x", - mb->vlan_tci, mb->vlan_tci_outer); - if (mb->packet_type) { - rte_get_ptype_name(mb->packet_type, buf, sizeof(buf)); - printf(" - hw ptype: %s", buf); - } - sw_packet_type = rte_net_get_ptype(mb, &hdr_lens, - RTE_PTYPE_ALL_MASK); - rte_get_ptype_name(sw_packet_type, buf, sizeof(buf)); - printf(" - sw ptype: %s", buf); - if (sw_packet_type & RTE_PTYPE_L2_MASK) - printf(" - l2_len=%d", hdr_lens.l2_len); - if (sw_packet_type & RTE_PTYPE_L3_MASK) - printf(" - l3_len=%d", hdr_lens.l3_len); - if (sw_packet_type & RTE_PTYPE_L4_MASK) - printf(" - l4_len=%d", hdr_lens.l4_len); - if (sw_packet_type & RTE_PTYPE_TUNNEL_MASK) - printf(" - tunnel_len=%d", hdr_lens.tunnel_len); - if (sw_packet_type & RTE_PTYPE_INNER_L2_MASK) - printf(" - inner_l2_len=%d", hdr_lens.inner_l2_len); - if (sw_packet_type & RTE_PTYPE_INNER_L3_MASK) - printf(" - inner_l3_len=%d", hdr_lens.inner_l3_len); - if (sw_packet_type & RTE_PTYPE_INNER_L4_MASK) - printf(" - inner_l4_len=%d", hdr_lens.inner_l4_len); - if (is_encapsulation) { - struct ipv4_hdr *ipv4_hdr; - struct ipv6_hdr *ipv6_hdr; - struct udp_hdr *udp_hdr; - uint8_t l2_len; - uint8_t l3_len; - uint8_t l4_len; - uint8_t l4_proto; - struct vxlan_hdr *vxlan_hdr; - - l2_len = sizeof(struct ether_hdr); - - /* Do not support ipv4 option field */ - if (RTE_ETH_IS_IPV4_HDR(packet_type)) { - l3_len = sizeof(struct ipv4_hdr); - ipv4_hdr = rte_pktmbuf_mtod_offset(mb, - struct ipv4_hdr *, - l2_len); - l4_proto = ipv4_hdr->next_proto_id; - } else { - l3_len = sizeof(struct ipv6_hdr); - ipv6_hdr = rte_pktmbuf_mtod_offset(mb, - struct ipv6_hdr *, - l2_len); - l4_proto = ipv6_hdr->proto; - } - if (l4_proto == IPPROTO_UDP) { - udp_hdr = rte_pktmbuf_mtod_offset(mb, - struct udp_hdr *, - l2_len + l3_len); - l4_len = sizeof(struct udp_hdr); - vxlan_hdr = rte_pktmbuf_mtod_offset(mb, - struct vxlan_hdr *, - l2_len + l3_len + l4_len); - - printf(" - VXLAN packet: packet type =%d, " - "Destination UDP port =%d, VNI = %d", - packet_type, RTE_BE_TO_CPU_16(udp_hdr->dst_port), - rte_be_to_cpu_32(vxlan_hdr->vx_vni) >> 8); - } - } - printf(" - Receive queue=0x%x", (unsigned) fs->rx_queue); - printf("\n"); - rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf)); - printf(" ol_flags: %s\n", buf); - rte_pktmbuf_free(mb); - } + if (unlikely(verbose_level & 0x1)) + dump_pkt_burst(fs, pkts_burst, nb_rx, 1); + for (i = 0; i < nb_rx; i++) + rte_pktmbuf_free(pkts_burst[i]); #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES end_tsc = rte_rdtsc(); -- 2.7.4