get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/45200/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 45200,
    "url": "https://patches.dpdk.org/api/patches/45200/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1537793304-27883-1-git-send-email-rasland@mellanox.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1537793304-27883-1-git-send-email-rasland@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537793304-27883-1-git-send-email-rasland@mellanox.com",
    "date": "2018-09-24T12:49:03",
    "name": "[v2,1/3] app/testpmd: move dumping packets to a separate function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "189d970bae13581cf5566026e744bfb8db9b8ead",
    "submitter": {
        "id": 513,
        "url": "https://patches.dpdk.org/api/people/513/?format=api",
        "name": "Raslan Darawsheh",
        "email": "rasland@mellanox.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1537793304-27883-1-git-send-email-rasland@mellanox.com/mbox/",
    "series": [
        {
            "id": 1465,
            "url": "https://patches.dpdk.org/api/series/1465/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1465",
            "date": "2018-09-24T12:49:05",
            "name": "[v2,1/3] app/testpmd: move dumping packets to a separate function",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/1465/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45200/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45200/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 283614C9F;\n\tMon, 24 Sep 2018 14:49:12 +0200 (CEST)",
            "from EUR03-AM5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80])\n\tby dpdk.org (Postfix) with ESMTP id 734064C8D\n\tfor <dev@dpdk.org>; Mon, 24 Sep 2018 14:49:08 +0200 (CEST)",
            "from DB5PR05MB1254.eurprd05.prod.outlook.com (10.162.157.140) by\n\tDB5PR05MB1205.eurprd05.prod.outlook.com (10.161.244.22) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1143.18; Mon, 24 Sep 2018 12:49:03 +0000",
            "from DB5PR05MB1254.eurprd05.prod.outlook.com\n\t([fe80::3516:b329:5c35:51a5]) by\n\tDB5PR05MB1254.eurprd05.prod.outlook.com\n\t([fe80::3516:b329:5c35:51a5%2]) with mapi id 15.20.1164.017;\n\tMon, 24 Sep 2018 12:49:03 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=2od4BKIyGSZ/Fj1Ih0Qpzopthz4iUQcghtVEeVxLtus=;\n\tb=MFEiFoh5uZiImKpdotjRy6WAsMLBsvlvY/WARB8ObsAmydW+MQi6202/kqLFs2GrHS9hUw9qMhL4Of5+HBHSm2JtD6kyVM+3F5lZRbWKPGa3X5lXms+oWBLdpcpqx4xXDNN4QqKRWhWtMZzvcBnkUbNFxavym9Nevca0QX3n0Ck=",
        "From": "Raslan Darawsheh <rasland@mellanox.com>",
        "To": "\"jingjing.wu@intel.com\" <jingjing.wu@intel.com>",
        "CC": "Thomas Monjalon <thomas@monjalon.net>, \"dev@dpdk.org\" <dev@dpdk.org>,\n\tShahaf Shuler <shahafs@mellanox.com>, Raslan Darawsheh\n\t<rasland@mellanox.com>, \"Xueming(Steven) Li\" <xuemingl@mellanox.com>, Ori\n\tKatz <orik@mellanox.com>, \"jerin.jacob@caviumnetworks.com\"\n\t<jerin.jacob@caviumnetworks.com>, \"david.marchand@6wind.com\"\n\t<david.marchand@6wind.com>",
        "Thread-Topic": "[PATCH v2 1/3] app/testpmd: move dumping packets to a separate\n\tfunction",
        "Thread-Index": "AQHUVAT4+O56diyQ4Eq0UB7BuKFsKw==",
        "Date": "Mon, 24 Sep 2018 12:49:03 +0000",
        "Message-ID": "<1537793304-27883-1-git-send-email-rasland@mellanox.com>",
        "References": "<1536739583-29166-2-git-send-email-rasland@mellanox.com>",
        "In-Reply-To": "<1536739583-29166-2-git-send-email-rasland@mellanox.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-mailer": "git-send-email 2.7.4",
        "x-clientproxiedby": "VI1PR04CA0105.eurprd04.prod.outlook.com\n\t(2603:10a6:803:64::40) To DB5PR05MB1254.eurprd05.prod.outlook.com\n\t(2a01:111:e400:51cc::12)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=rasland@mellanox.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-originating-ip": "[37.142.13.130]",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-exchange-diagnostics": "1; DB5PR05MB1205;\n\t6:BnsEEiIlbPVl27dBUBnMxKar3Vn8nkkj705ADdtmWbxfkLfRQxwZzrEWD8KMRirwMsNwnNIELhozS/Qpd1ALdlwymF+0IGu2Tzbe9A0fg6UAvGZnS1JYrBwDtk81W3A1aZ6hlbQkStCLjZNYjku06G6iyuuzhLgsR2thRZsvnDMHHebnE51ey6VZf9jfzBYet2CIe+2HWeSp4fRHM3zKhrMpKwrH92Vk9XQWkUbSTGcPrGHBe0DwttGsVPkHVW/wjCYOPhdA/EZYTTuPguN2VuIpMupGahHYbP993jbOoBMX6GEpVJTQCbmXPwOEwM6j2rai6RuCoCM2dfIQp/boMMm0zx/+x9a9+u8NELysqWOWdHfiR16B7Zy7C/NPxt9FhN4eAWXdNCmC1j2Oun5UWHBQnVrppkP499hCGnFflO5U0kGMQZoj5vxu1diAKMh3rV+YlUMQfST/tjmvf7rWBA==;\n\t5:7jhJnEUkz/QRFV5diJgt9Pc31Cul0w0ePIMa0xQyHe/NkoeippbU9vZT/7tpZHSkwsf7G0b8zTsuzMojbxYwGLoXQbBxoefE4qBCI1uhmtPQFYjOafzGuxWhlSmlDAojhCHtuTU72PFs0wnuC1dK8tTc9Ge56fNwJi6j2SjlJ/8=;\n\t7:NS149SG1LpG7LxeyivcEyhzNoRDxImbrVJITNEGiFjZ9SCrpjRh9hOQGbRchSOA9xO5hij7kDkBgJ7H3TAB+piqb8oTGnw7FSpiZ7qfXL6A1HRtyIcHk+v01OVbSoAoZ57dZUGmUJKDNQ4ZM215D+emQ0lQKmZqHKP3dVQuJegEnBlxwEF9015Cc8/2sWdvzvrJcvumbQLO1XYt7w/JhIW4FGtjO+lm/NrVjm7FPytkL9826j0GCXbJ31hzzAHf0",
        "x-ms-office365-filtering-correlation-id": "41af8616-626d-46a7-93da-08d6221c1a97",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:DB5PR05MB1205; ",
        "x-ms-traffictypediagnostic": "DB5PR05MB1205:",
        "x-ld-processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr",
        "x-microsoft-antispam-prvs": "<DB5PR05MB12053CE4522FD2A78D37A5F0C2170@DB5PR05MB1205.eurprd05.prod.outlook.com>",
        "x-exchange-antispam-report-test": "UriScan:;",
        "x-ms-exchange-senderadcheck": "1",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149066)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051);\n\tSRVR:DB5PR05MB1205; BCL:0; PCL:0; RULEID:; SRVR:DB5PR05MB1205; ",
        "x-forefront-prvs": "0805EC9467",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(39860400002)(366004)(396003)(346002)(136003)(376002)(199004)(189003)(2900100001)(71190400001)(386003)(6506007)(2351001)(102836004)(8936002)(36756003)(6486002)(478600001)(68736007)(6116002)(3846002)(5250100002)(2906002)(81166006)(81156014)(8676002)(25786009)(106356001)(53936002)(26005)(316002)(186003)(5640700003)(99286004)(86362001)(4326008)(52116002)(14454004)(105586002)(305945005)(6436002)(54906003)(11346002)(476003)(7736002)(97736004)(446003)(256004)(2616005)(486006)(6512007)(71200400001)(50226002)(6916009)(66066001)(5660300001)(2501003)(76176011);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR05MB1205;\n\tH:DB5PR05MB1254.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "x-microsoft-antispam-message-info": "VLRhVKpqlAaqI2/4vkmTrEVSbfqXQT7WKZUY1/BQFTMR+5Gbb3j67qJab/nSlTekjqGJbCSUUjwThsczrdhRo8nNC48bmMAG7cpX1OubfBcilEVKbd9MdHLcMMRFSEiRboEHazLwL0wz8dSkGysEvHj0bpZC7uniVVW6FcUHaggzIyEBt3cmh4IBxVDhGovbT399zmvOdXF26xlC1SR+ES0VS6gQrf/PUthsvTEIdD7ow70A1h+b69EJoA9US/+cF8cz5fjXTCd7NtwyhCnK7pNJ3wNiWBJ5J0PUeIjxesjK9OIr4jspWz3TBNFq4FzPGTol1Yi5Ql+cpLw/kYXn8A5h3D9kiUBoZ0K9txvVZ6A=",
        "spamdiagnosticoutput": "1:99",
        "spamdiagnosticmetadata": "NSPM",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "41af8616-626d-46a7-93da-08d6221c1a97",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "24 Sep 2018 12:49:03.0543\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DB5PR05MB1205",
        "Subject": "[dpdk-dev] [PATCH v2 1/3] app/testpmd: move dumping packets to a\n\tseparate function",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "verbosity for the received/sent packets is needed in all of the\nforwarding engines so moving it to be in a separate function\n\nSigned-off-by: Raslan Darawsheh <rasland@mellanox.com>\n---\n app/test-pmd/Makefile |   1 +\n app/test-pmd/rxonly.c | 134 ++--------------------------------------------\n app/test-pmd/util.c   | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 148 insertions(+), 131 deletions(-)\n create mode 100644 app/test-pmd/util.c",
    "diff": "diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile\nindex 2b4d604..e2c7845 100644\n--- a/app/test-pmd/Makefile\n+++ b/app/test-pmd/Makefile\n@@ -35,6 +35,7 @@ SRCS-y += csumonly.c\n SRCS-y += icmpecho.c\n SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c\n SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_cmd.c\n+SRCS-y += util.c\n \n ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC), y)\n SRCS-y += softnicfwd.c\ndiff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c\nindex a93d806..3eca89c 100644\n--- a/app/test-pmd/rxonly.c\n+++ b/app/test-pmd/rxonly.c\n@@ -40,14 +40,6 @@\n \n #include \"testpmd.h\"\n \n-static inline void\n-print_ether_addr(const char *what, struct ether_addr *eth_addr)\n-{\n-\tchar buf[ETHER_ADDR_FMT_SIZE];\n-\tether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);\n-\tprintf(\"%s%s\", what, buf);\n-}\n-\n /*\n  * Received a burst of packets.\n  */\n@@ -55,16 +47,8 @@ static void\n pkt_burst_receive(struct fwd_stream *fs)\n {\n \tstruct rte_mbuf  *pkts_burst[MAX_PKT_BURST];\n-\tstruct rte_mbuf  *mb;\n-\tstruct ether_hdr *eth_hdr;\n-\tuint16_t eth_type;\n-\tuint64_t ol_flags;\n \tuint16_t nb_rx;\n-\tuint16_t i, packet_type;\n-\tuint16_t is_encapsulation;\n-\tchar buf[256];\n-\tstruct rte_net_hdr_lens hdr_lens;\n-\tuint32_t sw_packet_type;\n+\tuint16_t i;\n \n #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES\n \tuint64_t start_tsc;\n@@ -90,120 +74,8 @@ pkt_burst_receive(struct fwd_stream *fs)\n \t/*\n \t * Dump each received packet if verbose_level > 0.\n \t */\n-\tif (verbose_level > 0)\n-\t\tprintf(\"port %u/queue %u: received %u packets\\n\",\n-\t\t       fs->rx_port,\n-\t\t       (unsigned) fs->rx_queue,\n-\t\t       (unsigned) nb_rx);\n-\tfor (i = 0; i < nb_rx; i++) {\n-\t\tmb = pkts_burst[i];\n-\t\tif (verbose_level == 0) {\n-\t\t\trte_pktmbuf_free(mb);\n-\t\t\tcontinue;\n-\t\t}\n-\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\n-\t\teth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type);\n-\t\tol_flags = mb->ol_flags;\n-\t\tpacket_type = mb->packet_type;\n-\t\tis_encapsulation = RTE_ETH_IS_TUNNEL_PKT(packet_type);\n-\n-\t\tprint_ether_addr(\"  src=\", &eth_hdr->s_addr);\n-\t\tprint_ether_addr(\" - dst=\", &eth_hdr->d_addr);\n-\t\tprintf(\" - type=0x%04x - length=%u - nb_segs=%d\",\n-\t\t       eth_type, (unsigned) mb->pkt_len,\n-\t\t       (int)mb->nb_segs);\n-\t\tif (ol_flags & PKT_RX_RSS_HASH) {\n-\t\t\tprintf(\" - RSS hash=0x%x\", (unsigned) mb->hash.rss);\n-\t\t\tprintf(\" - RSS queue=0x%x\",(unsigned) fs->rx_queue);\n-\t\t}\n-\t\tif (ol_flags & PKT_RX_FDIR) {\n-\t\t\tprintf(\" - FDIR matched \");\n-\t\t\tif (ol_flags & PKT_RX_FDIR_ID)\n-\t\t\t\tprintf(\"ID=0x%x\",\n-\t\t\t\t       mb->hash.fdir.hi);\n-\t\t\telse if (ol_flags & PKT_RX_FDIR_FLX)\n-\t\t\t\tprintf(\"flex bytes=0x%08x %08x\",\n-\t\t\t\t       mb->hash.fdir.hi, mb->hash.fdir.lo);\n-\t\t\telse\n-\t\t\t\tprintf(\"hash=0x%x ID=0x%x \",\n-\t\t\t\t       mb->hash.fdir.hash, mb->hash.fdir.id);\n-\t\t}\n-\t\tif (ol_flags & PKT_RX_TIMESTAMP)\n-\t\t\tprintf(\" - timestamp %\"PRIu64\" \", mb->timestamp);\n-\t\tif (ol_flags & PKT_RX_VLAN_STRIPPED)\n-\t\t\tprintf(\" - VLAN tci=0x%x\", mb->vlan_tci);\n-\t\tif (ol_flags & PKT_RX_QINQ_STRIPPED)\n-\t\t\tprintf(\" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x\",\n-\t\t\t\t\tmb->vlan_tci, mb->vlan_tci_outer);\n-\t\tif (mb->packet_type) {\n-\t\t\trte_get_ptype_name(mb->packet_type, buf, sizeof(buf));\n-\t\t\tprintf(\" - hw ptype: %s\", buf);\n-\t\t}\n-\t\tsw_packet_type = rte_net_get_ptype(mb, &hdr_lens,\n-\t\t\tRTE_PTYPE_ALL_MASK);\n-\t\trte_get_ptype_name(sw_packet_type, buf, sizeof(buf));\n-\t\tprintf(\" - sw ptype: %s\", buf);\n-\t\tif (sw_packet_type & RTE_PTYPE_L2_MASK)\n-\t\t\tprintf(\" - l2_len=%d\", hdr_lens.l2_len);\n-\t\tif (sw_packet_type & RTE_PTYPE_L3_MASK)\n-\t\t\tprintf(\" - l3_len=%d\", hdr_lens.l3_len);\n-\t\tif (sw_packet_type & RTE_PTYPE_L4_MASK)\n-\t\t\tprintf(\" - l4_len=%d\", hdr_lens.l4_len);\n-\t\tif (sw_packet_type & RTE_PTYPE_TUNNEL_MASK)\n-\t\t\tprintf(\" - tunnel_len=%d\", hdr_lens.tunnel_len);\n-\t\tif (sw_packet_type & RTE_PTYPE_INNER_L2_MASK)\n-\t\t\tprintf(\" - inner_l2_len=%d\", hdr_lens.inner_l2_len);\n-\t\tif (sw_packet_type & RTE_PTYPE_INNER_L3_MASK)\n-\t\t\tprintf(\" - inner_l3_len=%d\", hdr_lens.inner_l3_len);\n-\t\tif (sw_packet_type & RTE_PTYPE_INNER_L4_MASK)\n-\t\t\tprintf(\" - inner_l4_len=%d\", hdr_lens.inner_l4_len);\n-\t\tif (is_encapsulation) {\n-\t\t\tstruct ipv4_hdr *ipv4_hdr;\n-\t\t\tstruct ipv6_hdr *ipv6_hdr;\n-\t\t\tstruct udp_hdr *udp_hdr;\n-\t\t\tuint8_t l2_len;\n-\t\t\tuint8_t l3_len;\n-\t\t\tuint8_t l4_len;\n-\t\t\tuint8_t l4_proto;\n-\t\t\tstruct  vxlan_hdr *vxlan_hdr;\n-\n-\t\t\tl2_len  = sizeof(struct ether_hdr);\n-\n-\t\t\t /* Do not support ipv4 option field */\n-\t\t\tif (RTE_ETH_IS_IPV4_HDR(packet_type)) {\n-\t\t\t\tl3_len = sizeof(struct ipv4_hdr);\n-\t\t\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mb,\n-\t\t\t\t\t\t\t\t   struct ipv4_hdr *,\n-\t\t\t\t\t\t\t\t   l2_len);\n-\t\t\t\tl4_proto = ipv4_hdr->next_proto_id;\n-\t\t\t} else {\n-\t\t\t\tl3_len = sizeof(struct ipv6_hdr);\n-\t\t\t\tipv6_hdr = rte_pktmbuf_mtod_offset(mb,\n-\t\t\t\t\t\t\t\t   struct ipv6_hdr *,\n-\t\t\t\t\t\t\t\t   l2_len);\n-\t\t\t\tl4_proto = ipv6_hdr->proto;\n-\t\t\t}\n-\t\t\tif (l4_proto == IPPROTO_UDP) {\n-\t\t\t\tudp_hdr = rte_pktmbuf_mtod_offset(mb,\n-\t\t\t\t\t\t\t\t  struct udp_hdr *,\n-\t\t\t\t\t\t\t\t  l2_len + l3_len);\n-\t\t\t\tl4_len = sizeof(struct udp_hdr);\n-\t\t\t\tvxlan_hdr = rte_pktmbuf_mtod_offset(mb,\n-\t\t\t\t\t\t\t\t    struct vxlan_hdr *,\n-\t\t\t\t\t\t\t\t    l2_len + l3_len + l4_len);\n-\n-\t\t\t\tprintf(\" - VXLAN packet: packet type =%d, \"\n-\t\t\t\t\t\"Destination UDP port =%d, VNI = %d\",\n-\t\t\t\t\tpacket_type, RTE_BE_TO_CPU_16(udp_hdr->dst_port),\n-\t\t\t\t\trte_be_to_cpu_32(vxlan_hdr->vx_vni) >> 8);\n-\t\t\t}\n-\t\t}\n-\t\tprintf(\" - Receive queue=0x%x\", (unsigned) fs->rx_queue);\n-\t\tprintf(\"\\n\");\n-\t\trte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));\n-\t\tprintf(\"  ol_flags: %s\\n\", buf);\n-\t\trte_pktmbuf_free(mb);\n-\t}\n+\tfor (i = 0; i < nb_rx; i++)\n+\t\trte_pktmbuf_free(pkts_burst[i]);\n \n #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES\n \tend_tsc = rte_rdtsc();\ndiff --git a/app/test-pmd/util.c b/app/test-pmd/util.c\nnew file mode 100644\nindex 0000000..97c8349\n--- /dev/null\n+++ b/app/test-pmd/util.c\n@@ -0,0 +1,144 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2018 Mellanox technology.\n+ */\n+\n+#include <stdio.h>\n+\n+#include <rte_net.h>\n+#include <rte_mbuf.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_flow.h>\n+\n+#include \"testpmd.h\"\n+\n+static inline void\n+print_ether_addr(const char *what, struct ether_addr *eth_addr)\n+{\n+\tchar buf[ETHER_ADDR_FMT_SIZE];\n+\tether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);\n+\tprintf(\"%s%s\", what, buf);\n+}\n+\n+static  inline void\n+dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],\n+\t      uint16_t nb_pkts, int is_rx)\n+{\n+\tstruct rte_mbuf  *mb;\n+\tstruct ether_hdr *eth_hdr;\n+\tuint16_t eth_type;\n+\tuint64_t ol_flags;\n+\tuint16_t i, packet_type;\n+\tuint16_t is_encapsulation;\n+\tchar buf[256];\n+\tstruct rte_net_hdr_lens hdr_lens;\n+\tuint32_t sw_packet_type;\n+\n+\tif (!nb_pkts)\n+\t\treturn;\n+\tprintf(\"port %u/queue %u: %s %u packets\\n\",\n+\t\tport_id, queue,\n+\t       is_rx ? \"received\" : \"sent\",\n+\t       (unsigned int) nb_pkts);\n+\tfor (i = 0; i < nb_pkts; i++) {\n+\t\tmb = pkts[i];\n+\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\n+\t\teth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type);\n+\t\tol_flags = mb->ol_flags;\n+\t\tpacket_type = mb->packet_type;\n+\t\tis_encapsulation = RTE_ETH_IS_TUNNEL_PKT(packet_type);\n+\n+\t\tprint_ether_addr(\"  src=\", &eth_hdr->s_addr);\n+\t\tprint_ether_addr(\" - dst=\", &eth_hdr->d_addr);\n+\t\tprintf(\" - type=0x%04x - length=%u - nb_segs=%d\",\n+\t\t       eth_type, (unsigned int) mb->pkt_len,\n+\t\t       (int)mb->nb_segs);\n+\t\tprintf(\" - RSS hash=0x%x\", (unsigned int) mb->hash.rss);\n+\t\tprintf(\" - RSS queue=0x%x\", (unsigned int) queue);\n+\t\tif (ol_flags & PKT_RX_FDIR) {\n+\t\t\tprintf(\" - FDIR matched \");\n+\t\t\tif (ol_flags & PKT_RX_FDIR_ID)\n+\t\t\t\tprintf(\"ID=0x%x\",\n+\t\t\t\t       mb->hash.fdir.hi);\n+\t\t\telse if (ol_flags & PKT_RX_FDIR_FLX)\n+\t\t\t\tprintf(\"flex bytes=0x%08x %08x\",\n+\t\t\t\t       mb->hash.fdir.hi, mb->hash.fdir.lo);\n+\t\t\telse\n+\t\t\t\tprintf(\"hash=0x%x ID=0x%x \",\n+\t\t\t\t       mb->hash.fdir.hash, mb->hash.fdir.id);\n+\t\t}\n+\t\tif (ol_flags & PKT_RX_TIMESTAMP)\n+\t\t\tprintf(\" - timestamp %\"PRIu64\" \", mb->timestamp);\n+\t\tif (ol_flags & PKT_RX_VLAN_STRIPPED)\n+\t\t\tprintf(\" - VLAN tci=0x%x\", mb->vlan_tci);\n+\t\tif (ol_flags & PKT_RX_QINQ_STRIPPED)\n+\t\t\tprintf(\" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x\",\n+\t\t\t       mb->vlan_tci, mb->vlan_tci_outer);\n+\t\tif (mb->packet_type) {\n+\t\t\trte_get_ptype_name(mb->packet_type, buf, sizeof(buf));\n+\t\t\tprintf(\" - hw ptype: %s\", buf);\n+\t\t}\n+\t\tsw_packet_type = rte_net_get_ptype(mb, &hdr_lens,\n+\t\t\t\t\t\t   RTE_PTYPE_ALL_MASK);\n+\t\trte_get_ptype_name(sw_packet_type, buf, sizeof(buf));\n+\t\tprintf(\" - sw ptype: %s\", buf);\n+\t\tif (sw_packet_type & RTE_PTYPE_L2_MASK)\n+\t\t\tprintf(\" - l2_len=%d\", hdr_lens.l2_len);\n+\t\tif (sw_packet_type & RTE_PTYPE_L3_MASK)\n+\n+\t\t\tprintf(\" - l4_len=%d\", hdr_lens.l4_len);\n+\t\tif (sw_packet_type & RTE_PTYPE_TUNNEL_MASK)\n+\t\t\tprintf(\" - tunnel_len=%d\", hdr_lens.tunnel_len);\n+\t\tif (sw_packet_type & RTE_PTYPE_INNER_L2_MASK)\n+\t\t\tprintf(\" - inner_l2_len=%d\", hdr_lens.inner_l2_len);\n+\t\tif (sw_packet_type & RTE_PTYPE_INNER_L4_MASK)\n+\t\t\tprintf(\" - inner_l4_len=%d\", hdr_lens.inner_l4_len);\n+\t\tif (is_encapsulation) {\n+\t\t\tstruct ipv4_hdr *ipv4_hdr;\n+\t\t\tstruct ipv6_hdr *ipv6_hdr;\n+\t\t\tstruct udp_hdr *udp_hdr;\n+\t\t\tuint8_t l2_len;\n+\t\t\tuint8_t l3_len;\n+\t\t\tuint8_t l4_len;\n+\t\t\tuint8_t l4_proto;\n+\t\t\tstruct  vxlan_hdr *vxlan_hdr;\n+\n+\t\t\tl2_len  = sizeof(struct ether_hdr);\n+\n+\t\t\t/* Do not support ipv4 option field */\n+\t\t\tif (RTE_ETH_IS_IPV4_HDR(packet_type)) {\n+\t\t\t\tl3_len = sizeof(struct ipv4_hdr);\n+\t\t\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mb,\n+\t\t\t\tstruct ipv4_hdr *,\n+\t\t\t\tl2_len);\n+\t\t\t\tl4_proto = ipv4_hdr->next_proto_id;\n+\t\t\t} else {\n+\t\t\t\tl3_len = sizeof(struct ipv6_hdr);\n+\t\t\t\tipv6_hdr = rte_pktmbuf_mtod_offset(mb,\n+\t\t\t\tstruct ipv6_hdr *,\n+\t\t\t\tl2_len);\n+\t\t\t\tl4_proto = ipv6_hdr->proto;\n+\t\t\t}\n+\t\t\tif (l4_proto == IPPROTO_UDP) {\n+\t\t\t\tudp_hdr = rte_pktmbuf_mtod_offset(mb,\n+\t\t\t\tstruct udp_hdr *,\n+\t\t\t\tl2_len + l3_len);\n+\t\t\t\tl4_len = sizeof(struct udp_hdr);\n+\t\t\t\tvxlan_hdr = rte_pktmbuf_mtod_offset(mb,\n+\t\t\t\tstruct vxlan_hdr *,\n+\t\t\t\tl2_len + l3_len + l4_len);\n+\n+\t\t\t\tprintf(\" - VXLAN packet: packet type =%d, \"\n+\t\t\t\t       \"Destination UDP port =%d, VNI = %d\",\n+\t\t\t\t       packet_type,\n+\t\t\t\t       RTE_BE_TO_CPU_16(udp_hdr->dst_port),\n+\t\t\t\t       rte_be_to_cpu_32(vxlan_hdr->vx_vni) >> 8);\n+\t\t\t}\n+\t\t}\n+\t\tprintf(\" - %s queue=0x%x\", is_rx ? \"Receive\" : \"Send\",\n+\t\t\t(unsigned int) queue);\n+\t\tprintf(\"\\n\");\n+\t\trte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));\n+\t\tprintf(\"  ol_flags: %s\\n\", buf);\n+\t}\n+}\n",
    "prefixes": [
        "v2",
        "1/3"
    ]
}