Show a patch.

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

{
    "id": 257,
    "url": "http://patches.dpdk.org/api/patches/257/",
    "web_url": "http://patches.dpdk.org/patch/257/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1409154628-30825-4-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-08-27T15:50:25",
    "name": "[dpdk-dev,3/6] mbuf: remove rte_ctrlmbuf",
    "commit_ref": "",
    "pull_url": "",
    "state": "superseded",
    "archived": true,
    "hash": "130abda6ee44bf08df4875e563fd8c0186be90f9",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/257/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/257/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/257/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<bricha3@ecsmtp.ir.intel.com>",
        "References": "<1409154628-30825-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,412,1406617200\"; d=\"scan'208\";a=\"594062242\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "X-List-Received-Date": "Wed, 27 Aug 2014 15:47:01 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1409154628-30825-4-git-send-email-bruce.richardson@intel.com>",
        "Received": [
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\r\n\tby dpdk.org (Postfix) with ESMTP id 5851BB38B\r\n\tfor <dev@dpdk.org>; Wed, 27 Aug 2014 17:47:00 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\r\n\tby orsmga102.jf.intel.com with ESMTP; 27 Aug 2014 08:44:34 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby orsmga002.jf.intel.com with ESMTP; 27 Aug 2014 08:50:31 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\r\n\t[10.237.217.46])\r\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\r\n\ts7RFoTgI026037; Wed, 27 Aug 2014 16:50:29 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s7RFoTb4031310;\r\n\tWed, 27 Aug 2014 16:50:29 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s7RFoTnX031306;\r\n\tWed, 27 Aug 2014 16:50:29 +0100"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Precedence": "list",
        "Date": "Wed, 27 Aug 2014 16:50:25 +0100",
        "Subject": "[dpdk-dev] [PATCH 3/6] mbuf: remove rte_ctrlmbuf",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "In-Reply-To": "<1409154628-30825-1-git-send-email-bruce.richardson@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "From: Olivier Matz <olivier.matz@6wind.com>\n\nThe initial role of rte_ctrlmbuf is to carry generic messages (data\npointer + data length) but it's not used by the DPDK or it applications.\nKeeping it implies:\n  - loosing 1 byte in the rte_mbuf structure\n  - having some dead code rte_mbuf.[ch]\n\nThis patch removes this feature. Thanks to it, it is now possible to\nsimplify the rte_mbuf structure by merging the rte_pktmbuf structure\nin it. This is done in next commit.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n\n* Updated patch to HEAD.\n* Modified patch to retain the old function names for ctrl mbufs as\n  macros. This helps with app compatibility, and allows the concept\n  of a control mbuf to be reintroduced via a single-bit flag in\n  a future change.\n* Updated the packet framework ip_pipeline example application to\n  work following this change.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/test-pmd/cmdline.c                             |   1 -\n app/test-pmd/flowgen.c                             |   2 +-\n app/test-pmd/testpmd.c                             |   2 -\n app/test-pmd/txonly.c                              |   2 +-\n app/test/commands.c                                |   1 -\n app/test/test_mbuf.c                               |  72 +------------\n examples/ip_pipeline/cmdline.c                     |  44 ++++----\n examples/ip_pipeline/init.c                        |   2 +-\n examples/ip_pipeline/pipeline_firewall.c           |   4 +-\n .../ip_pipeline/pipeline_flow_classification.c     |   4 +-\n examples/ip_pipeline/pipeline_routing.c            |   4 +-\n examples/ip_pipeline/pipeline_rx.c                 |   4 +-\n examples/ipv4_multicast/main.c                     |   2 +-\n lib/librte_mbuf/rte_mbuf.c                         |  60 +++--------\n lib/librte_mbuf/rte_mbuf.h                         | 117 +++++++--------------\n lib/librte_pmd_e1000/em_rxtx.c                     |   2 +-\n lib/librte_pmd_e1000/igb_rxtx.c                    |   2 +-\n lib/librte_pmd_i40e/i40e_rxtx.c                    |   4 +-\n lib/librte_pmd_ixgbe/ixgbe_rxtx.c                  |   4 +-\n lib/librte_pmd_virtio/virtio_rxtx.c                |   2 +-\n lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c              |   2 +-\n lib/librte_pmd_xenvirt/rte_eth_xenvirt.c           |   2 +-\n 22 files changed, 96 insertions(+), 243 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\r\nindex 345be11..6dd576a 100644\r\n--- a/app/test-pmd/cmdline.c\r\n+++ b/app/test-pmd/cmdline.c\r\n@@ -6377,7 +6377,6 @@ dump_struct_sizes(void)\r\n #define DUMP_SIZE(t) printf(\"sizeof(\" #t \") = %u\\n\", (unsigned)sizeof(t));\r\n \tDUMP_SIZE(struct rte_mbuf);\r\n \tDUMP_SIZE(struct rte_pktmbuf);\r\n-\tDUMP_SIZE(struct rte_ctrlmbuf);\r\n \tDUMP_SIZE(struct rte_mempool);\r\n \tDUMP_SIZE(struct rte_ring);\r\n #undef DUMP_SIZE\r\ndiff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c\r\nindex 04911ff..a8f2a65 100644\r\n--- a/app/test-pmd/flowgen.c\r\n+++ b/app/test-pmd/flowgen.c\r\n@@ -96,7 +96,7 @@ tx_mbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \treturn (m);\r\n }\r\n \r\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\r\nindex e8a4b45..5368d01 100644\r\n--- a/app/test-pmd/testpmd.c\r\n+++ b/app/test-pmd/testpmd.c\r\n@@ -398,13 +398,11 @@ testpmd_mbuf_ctor(struct rte_mempool *mp,\r\n \tmb_ctor_arg = (struct mbuf_ctor_arg *) opaque_arg;\r\n \tmb = (struct rte_mbuf *) raw_mbuf;\r\n \r\n-\tmb->type         = RTE_MBUF_PKT;\r\n \tmb->pool         = mp;\r\n \tmb->buf_addr     = (void *) ((char *)mb + mb_ctor_arg->seg_buf_offset);\r\n \tmb->buf_physaddr = (uint64_t) (rte_mempool_virt2phy(mp, mb) +\r\n \t\t\tmb_ctor_arg->seg_buf_offset);\r\n \tmb->buf_len      = mb_ctor_arg->seg_buf_size;\r\n-\tmb->type         = RTE_MBUF_PKT;\r\n \tmb->ol_flags     = 0;\r\n \tmb->pkt.data     = (char *) mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \tmb->pkt.nb_segs  = 1;\r\ndiff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c\r\nindex ef93741..d634096 100644\r\n--- a/app/test-pmd/txonly.c\r\n+++ b/app/test-pmd/txonly.c\r\n@@ -93,7 +93,7 @@ tx_mbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \treturn (m);\r\n }\r\n \r\ndiff --git a/app/test/commands.c b/app/test/commands.c\r\nindex 5f23420..f38d419 100644\r\n--- a/app/test/commands.c\r\n+++ b/app/test/commands.c\r\n@@ -276,7 +276,6 @@ dump_struct_sizes(void)\r\n #define DUMP_SIZE(t) printf(\"sizeof(\" #t \") = %u\\n\", (unsigned)sizeof(t));\r\n \tDUMP_SIZE(struct rte_mbuf);\r\n \tDUMP_SIZE(struct rte_pktmbuf);\r\n-\tDUMP_SIZE(struct rte_ctrlmbuf);\r\n \tDUMP_SIZE(struct rte_mempool);\r\n \tDUMP_SIZE(struct rte_ring);\r\n #undef DUMP_SIZE\r\ndiff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c\r\nindex 678c382..6b32d9d 100644\r\n--- a/app/test/test_mbuf.c\r\n+++ b/app/test/test_mbuf.c\r\n@@ -80,7 +80,6 @@\r\n #define MAKE_STRING(x)          # x\r\n \r\n static struct rte_mempool *pktmbuf_pool = NULL;\r\n-static struct rte_mempool *ctrlmbuf_pool = NULL;\r\n \r\n #if defined RTE_MBUF_REFCNT  && defined RTE_MBUF_REFCNT_ATOMIC\r\n \r\n@@ -272,8 +271,8 @@ test_one_pktmbuf(void)\r\n \t\tGOTO_FAIL(\"Buffer should be continuous\");\r\n \tmemset(hdr, 0x55, MBUF_TEST_HDR2_LEN);\r\n \r\n-\trte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n-\trte_mbuf_sanity_check(m, RTE_MBUF_PKT, 0);\r\n+\trte_mbuf_sanity_check(m, 1);\r\n+\trte_mbuf_sanity_check(m, 0);\r\n \trte_pktmbuf_dump(stdout, m, 0);\r\n \r\n \t/* this prepend should fail */\r\n@@ -320,48 +319,6 @@ fail:\r\n \treturn -1;\r\n }\r\n \r\n-/*\r\n- * test control mbuf\r\n- */\r\n-static int\r\n-test_one_ctrlmbuf(void)\r\n-{\r\n-\tstruct rte_mbuf *m = NULL;\r\n-\tchar message[] = \"This is a message carried by a ctrlmbuf\";\r\n-\r\n-\tprintf(\"Test ctrlmbuf API\\n\");\r\n-\r\n-\t/* alloc a mbuf */\r\n-\r\n-\tm = rte_ctrlmbuf_alloc(ctrlmbuf_pool);\r\n-\tif (m == NULL)\r\n-\t\tGOTO_FAIL(\"Cannot allocate mbuf\");\r\n-\tif (rte_ctrlmbuf_len(m) != 0)\r\n-\t\tGOTO_FAIL(\"Bad length\");\r\n-\r\n-\t/* set data */\r\n-\trte_ctrlmbuf_data(m) = &message;\r\n-\trte_ctrlmbuf_len(m) = sizeof(message);\r\n-\r\n-\t/* read data */\r\n-\tif (rte_ctrlmbuf_data(m) != message)\r\n-\t\tGOTO_FAIL(\"Invalid data pointer\");\r\n-\tif (rte_ctrlmbuf_len(m) != sizeof(message))\r\n-\t\tGOTO_FAIL(\"Invalid len\");\r\n-\r\n-\trte_mbuf_sanity_check(m, RTE_MBUF_CTRL, 0);\r\n-\r\n-\t/* free mbuf */\r\n-\trte_ctrlmbuf_free(m);\r\n-\tm = NULL;\r\n-\treturn 0;\r\n-\r\n-fail:\r\n-\tif (m)\r\n-\t\trte_ctrlmbuf_free(m);\r\n-\treturn -1;\r\n-}\r\n-\r\n static int\r\n testclone_testupdate_testdetach(void)\r\n {\r\n@@ -744,7 +701,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)\r\n \tpid = fork();\r\n \r\n \tif (pid == 0) {\r\n-\t\trte_mbuf_sanity_check(buf, RTE_MBUF_PKT, 1); /* should panic */\r\n+\t\trte_mbuf_sanity_check(buf, 1); /* should panic */\r\n \t\texit(0);  /* return normally if it doesn't panic */\r\n \t} else if (pid < 0){\r\n \t\tprintf(\"Fork Failed\\n\");\r\n@@ -781,13 +738,6 @@ test_failing_mbuf_sanity_check(void)\r\n \t}\r\n \r\n \tbadbuf = *buf;\r\n-\tbadbuf.type = (uint8_t)-1;\r\n-\tif (verify_mbuf_check_panics(&badbuf)) {\r\n-\t\tprintf(\"Error with bad-type mbuf test\\n\");\r\n-\t\treturn -1;\r\n-\t}\r\n-\r\n-\tbadbuf = *buf;\r\n \tbadbuf.pool = NULL;\r\n \tif (verify_mbuf_check_panics(&badbuf)) {\r\n \t\tprintf(\"Error with bad-pool mbuf test\\n\");\r\n@@ -889,22 +839,6 @@ test_mbuf(void)\r\n \t\treturn -1;\r\n \t}\r\n \r\n-\t/* create ctrlmbuf pool if it does not exist */\r\n-\tif (ctrlmbuf_pool == NULL) {\r\n-\t\tctrlmbuf_pool =\r\n-\t\t\trte_mempool_create(\"test_ctrlmbuf_pool\", NB_MBUF,\r\n-\t\t\t\t\t   sizeof(struct rte_mbuf), 32, 0,\r\n-\t\t\t\t\t   NULL, NULL,\r\n-\t\t\t\t\t   rte_ctrlmbuf_init, NULL,\r\n-\t\t\t\t\t   SOCKET_ID_ANY, 0);\r\n-\t}\r\n-\r\n-\t/* test control mbuf */\r\n-\tif (test_one_ctrlmbuf() < 0) {\r\n-\t\tprintf(\"test_one_ctrlmbuf() failed\\n\");\r\n-\t\treturn -1;\r\n-\t}\r\n-\r\n \t/* test free pktmbuf segment one by one */\r\n \tif (test_pktmbuf_free_segment() < 0) {\r\n \t\tprintf(\"test_pktmbuf_free_segment() failed.\\n\");\r\ndiff --git a/examples/ip_pipeline/cmdline.c b/examples/ip_pipeline/cmdline.c\r\nindex e10a0cf..a56335e 100644\r\n--- a/examples/ip_pipeline/cmdline.c\r\n+++ b/examples/ip_pipeline/cmdline.c\r\n@@ -345,7 +345,7 @@ cmd_link_enable_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \treq->type = APP_MSG_REQ_RX_PORT_ENABLE;\r\n \treq->rx_up.port = params->port;\r\n \r\n@@ -358,7 +358,7 @@ cmd_link_enable_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n \t\tprintf(\"Request LINK_UP failed (%u)\\n\", resp->result);\r\n@@ -433,7 +433,7 @@ cmd_link_disable_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \treq->type = APP_MSG_REQ_RX_PORT_DISABLE;\r\n \treq->rx_down.port = params->port;\r\n \r\n@@ -446,7 +446,7 @@ cmd_link_disable_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -543,7 +543,7 @@ cmd_arp_add_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \treq->type = APP_MSG_REQ_ARP_ADD;\r\n \treq->arp_add.out_iface = rule.arp.key.out_iface;\r\n \treq->arp_add.nh_ip = rule.arp.key.nh_ip;\r\n@@ -558,7 +558,7 @@ cmd_arp_add_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -672,7 +672,7 @@ cmd_arp_del_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \treq->type = APP_MSG_REQ_ARP_DEL;\r\n \treq->arp_del.out_iface = rule.arp.key.out_iface;\r\n \treq->arp_del.nh_ip = rule.arp.key.nh_ip;\r\n@@ -686,7 +686,7 @@ cmd_arp_del_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -834,7 +834,7 @@ cmd_route_add_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \treq->type = APP_MSG_REQ_RT_ADD;\r\n \treq->routing_add.ip = rule.routing.key.ip;\r\n \treq->routing_add.depth = rule.routing.key.depth;\r\n@@ -850,7 +850,7 @@ cmd_route_add_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -972,7 +972,7 @@ cmd_route_del_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \treq->type = APP_MSG_REQ_RT_DEL;\r\n \treq->routing_del.ip = rule.routing.key.ip;\r\n \treq->routing_del.depth = rule.routing.key.depth;\r\n@@ -986,7 +986,7 @@ cmd_route_del_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -1149,7 +1149,7 @@ cmd_firewall_add_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) msg->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data(msg);\r\n \treq->type = APP_MSG_REQ_FW_ADD;\r\n \treq->firewall_add.add_params.priority = rule.firewall.priority;\r\n \treq->firewall_add.add_params.field_value[1].value.u32 =\r\n@@ -1183,7 +1183,7 @@ cmd_firewall_add_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, (void **) &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) msg->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data(msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -1347,7 +1347,7 @@ cmd_firewall_del_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) msg->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data(msg);\r\n \tmemset(&req->firewall_del, 0, sizeof(req->firewall_del));\r\n \treq->type = APP_MSG_REQ_FW_DEL;\r\n \treq->firewall_del.delete_params.field_value[1].value.u32 =\r\n@@ -1380,7 +1380,7 @@ cmd_firewall_del_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, (void **) &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) msg->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data(msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -1525,7 +1525,7 @@ cmd_flow_add_all_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tmemset(req, 0, sizeof(struct app_msg_req));\r\n \r\n \treq->type = APP_MSG_REQ_FC_ADD_ALL;\r\n@@ -1539,7 +1539,7 @@ cmd_flow_add_all_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -1641,7 +1641,7 @@ cmd_flow_add_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tmemset(req, 0, sizeof(struct app_msg_req));\r\n \r\n \treq->type = APP_MSG_REQ_FC_ADD;\r\n@@ -1663,7 +1663,7 @@ cmd_flow_add_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\n@@ -1790,7 +1790,7 @@ cmd_flow_del_parsed(\r\n \t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t/* Fill request message */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tmemset(req, 0, sizeof(struct app_msg_req));\r\n \r\n \treq->type = APP_MSG_REQ_FC_DEL;\r\n@@ -1811,7 +1811,7 @@ cmd_flow_del_parsed(\r\n \tdo {\r\n \t\tstatus = rte_ring_sc_dequeue(ring_resp, &msg);\r\n \t} while (status != 0);\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \r\n \t/* Check response */\r\n \tif (resp->result != 0)\r\ndiff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c\r\nindex d00027f..e3ebd46 100644\r\n--- a/examples/ip_pipeline/init.c\r\n+++ b/examples/ip_pipeline/init.c\r\n@@ -561,7 +561,7 @@ app_ping(void)\r\n \t\t\trte_panic(\"Unable to allocate new message\\n\");\r\n \r\n \t\treq = (struct app_msg_req *)\r\n-\t\t\t((struct rte_mbuf *)msg)->ctrl.data;\r\n+\t\t\t\trte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \t\treq->type = APP_MSG_REQ_PING;\r\n \r\n \t\t/* Send request */\r\ndiff --git a/examples/ip_pipeline/pipeline_firewall.c b/examples/ip_pipeline/pipeline_firewall.c\r\nindex ecc15a7..b70260e 100644\r\n--- a/examples/ip_pipeline/pipeline_firewall.c\r\n+++ b/examples/ip_pipeline/pipeline_firewall.c\r\n@@ -264,7 +264,7 @@ app_message_handle(struct app_core_firewall_message_handle_params *params)\r\n \ttable_id = params->table_id;\r\n \r\n \t/* Handle request */\r\n-\treq = (struct app_msg_req *) msg->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data(msg);\r\n \tswitch (req->type) {\r\n \tcase APP_MSG_REQ_PING:\r\n \t{\r\n@@ -303,7 +303,7 @@ app_message_handle(struct app_core_firewall_message_handle_params *params)\r\n \t}\r\n \r\n \t/* Fill in response message */\r\n-\tresp = (struct app_msg_resp *) msg->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data(msg);\r\n \tresp->result = result;\r\n \r\n \t/* Send response */\r\ndiff --git a/examples/ip_pipeline/pipeline_flow_classification.c b/examples/ip_pipeline/pipeline_flow_classification.c\r\nindex 68d4f93..cc0cbf1 100644\r\n--- a/examples/ip_pipeline/pipeline_flow_classification.c\r\n+++ b/examples/ip_pipeline/pipeline_flow_classification.c\r\n@@ -250,7 +250,7 @@ app_message_handle(struct app_core_fc_message_handle_params *params)\r\n \ttable_id = params->table_id;\r\n \r\n \t/* Handle request */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tswitch (req->type) {\r\n \tcase APP_MSG_REQ_PING:\r\n \t{\r\n@@ -296,7 +296,7 @@ app_message_handle(struct app_core_fc_message_handle_params *params)\r\n \t}\r\n \r\n \t/* Fill in response message */\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tresp->result = result;\r\n \r\n \t/* Send response */\r\ndiff --git a/examples/ip_pipeline/pipeline_routing.c b/examples/ip_pipeline/pipeline_routing.c\r\nindex f19506d..b1ce624 100644\r\n--- a/examples/ip_pipeline/pipeline_routing.c\r\n+++ b/examples/ip_pipeline/pipeline_routing.c\r\n@@ -370,7 +370,7 @@ app_message_handle(struct app_core_routing_message_handle_params *params)\r\n \tarp_table_id = params->arp_table_id;\r\n \r\n \t/* Handle request */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tswitch (req->type) {\r\n \tcase APP_MSG_REQ_PING:\r\n \t{\r\n@@ -464,7 +464,7 @@ app_message_handle(struct app_core_routing_message_handle_params *params)\r\n \t}\r\n \r\n \t/* Fill in response message */\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tresp->result = result;\r\n \r\n \t/* Send response */\r\ndiff --git a/examples/ip_pipeline/pipeline_rx.c b/examples/ip_pipeline/pipeline_rx.c\r\nindex ba5fa0a..e43ebfa 100644\r\n--- a/examples/ip_pipeline/pipeline_rx.c\r\n+++ b/examples/ip_pipeline/pipeline_rx.c\r\n@@ -348,7 +348,7 @@ app_message_handle(struct app_core_rx_message_handle_params *params)\r\n \tport_in_id = params->port_in_id;\r\n \r\n \t/* Handle request */\r\n-\treq = (struct app_msg_req *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\treq = (struct app_msg_req *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tswitch (req->type) {\r\n \tcase APP_MSG_REQ_PING:\r\n \t{\r\n@@ -375,7 +375,7 @@ app_message_handle(struct app_core_rx_message_handle_params *params)\r\n \t}\r\n \r\n \t/* Fill in response message */\r\n-\tresp = (struct app_msg_resp *) ((struct rte_mbuf *)msg)->ctrl.data;\r\n+\tresp = (struct app_msg_resp *)rte_ctrlmbuf_data((struct rte_mbuf *)msg);\r\n \tresp->result = result;\r\n \r\n \t/* Send response */\r\ndiff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c\r\nindex dfa0075..7b53296 100644\r\n--- a/examples/ipv4_multicast/main.c\r\n+++ b/examples/ipv4_multicast/main.c\r\n@@ -343,7 +343,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)\r\n \r\n \thdr->ol_flags = pkt->ol_flags;\r\n \r\n-\t__rte_mbuf_sanity_check(hdr, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(hdr, 1);\r\n \treturn (hdr);\r\n }\r\n \r\ndiff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\r\nindex a4967e3..39865c1 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.c\r\n+++ b/lib/librte_mbuf/rte_mbuf.c\r\n@@ -65,24 +65,11 @@\r\n  */\r\n void\r\n rte_ctrlmbuf_init(struct rte_mempool *mp,\r\n-\t\t  __attribute__((unused)) void *opaque_arg,\r\n-\t\t  void *_m,\r\n-\t\t  __attribute__((unused)) unsigned i)\r\n+                 __attribute__((unused)) void *opaque_arg,\r\n+                 void *_m,\r\n+                 __attribute__((unused)) unsigned i)\r\n {\r\n-\tstruct rte_mbuf *m = _m;\r\n-\r\n-\tmemset(m, 0, mp->elt_size);\r\n-\r\n-\t/* start of buffer is just after mbuf structure */\r\n-\tm->buf_addr = (char *)m + sizeof(struct rte_mbuf);\r\n-\tm->buf_physaddr = rte_mempool_virt2phy(mp, m) +\r\n-\t\t\tsizeof(struct rte_mbuf);\r\n-\tm->buf_len = (uint16_t) (mp->elt_size - sizeof(struct rte_mbuf));\r\n-\r\n-\t/* init some constant fields */\r\n-\tm->type = RTE_MBUF_CTRL;\r\n-\tm->ctrl.data = (char *)m->buf_addr;\r\n-\tm->pool = (struct rte_mempool *)mp;\r\n+       rte_pktmbuf_init(mp, opaque_arg, _m, i);\r\n }\r\n \r\n /*\r\n@@ -133,7 +120,6 @@ rte_pktmbuf_init(struct rte_mempool *mp,\r\n \tm->pkt.data = (char*) m->buf_addr + RTE_MIN(RTE_PKTMBUF_HEADROOM, m->buf_len);\r\n \r\n \t/* init some constant fields */\r\n-\tm->type = RTE_MBUF_PKT;\r\n \tm->pool = mp;\r\n \tm->pkt.nb_segs = 1;\r\n \tm->pkt.in_port = 0xff;\r\n@@ -141,16 +127,13 @@ rte_pktmbuf_init(struct rte_mempool *mp,\r\n \r\n /* do some sanity checks on a mbuf: panic if it fails */\r\n void\r\n-rte_mbuf_sanity_check(const struct rte_mbuf *m, enum rte_mbuf_type t,\r\n-\t\t      int is_header)\r\n+rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)\r\n {\r\n \tconst struct rte_mbuf *m_seg;\r\n \tunsigned nb_segs;\r\n \r\n \tif (m == NULL)\r\n \t\trte_panic(\"mbuf is NULL\\n\");\r\n-\tif (m->type != (uint8_t)t)\r\n-\t\trte_panic(\"bad mbuf type\\n\");\r\n \r\n \t/* generic checks */\r\n \tif (m->pool == NULL)\r\n@@ -166,29 +149,18 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, enum rte_mbuf_type t,\r\n \t\trte_panic(\"bad ref cnt\\n\");\r\n #endif\r\n \r\n-\t/* nothing to check for ctrl messages */\r\n-\tif (m->type == RTE_MBUF_CTRL)\r\n+\t/* nothing to check for sub-segments */\r\n+\tif (is_header == 0)\r\n \t\treturn;\r\n \r\n-\t/* check pkt consistency */\r\n-\telse if (m->type == RTE_MBUF_PKT) {\r\n-\r\n-\t\t/* nothing to check for sub-segments */\r\n-\t\tif (is_header == 0)\r\n-\t\t\treturn;\r\n-\r\n-\t\tnb_segs = m->pkt.nb_segs;\r\n-\t\tm_seg = m;\r\n-\t\twhile (m_seg && nb_segs != 0) {\r\n-\t\t\tm_seg = m_seg->pkt.next;\r\n-\t\t\tnb_segs --;\r\n-\t\t}\r\n-\t\tif (nb_segs != 0)\r\n-\t\t\trte_panic(\"bad nb_segs\\n\");\r\n-\t\treturn;\r\n+\tnb_segs = m->pkt.nb_segs;\r\n+\tm_seg = m;\r\n+\twhile (m_seg && nb_segs != 0) {\r\n+\t\tm_seg = m_seg->pkt.next;\r\n+\t\tnb_segs --;\r\n \t}\r\n-\r\n-\trte_panic(\"unknown mbuf type\\n\");\r\n+\tif (nb_segs != 0)\r\n+\t\trte_panic(\"bad nb_segs\\n\");\r\n }\r\n \r\n /* dump a mbuf on console */\r\n@@ -198,7 +170,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)\r\n \tunsigned int len;\r\n \tunsigned nb_segs;\r\n \r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \tfprintf(f, \"dump mbuf at 0x%p, phys=%\"PRIx64\", buf_len=%u\\n\",\r\n \t       m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);\r\n@@ -208,7 +180,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)\r\n \tnb_segs = m->pkt.nb_segs;\r\n \r\n \twhile (m && nb_segs != 0) {\r\n-\t\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 0);\r\n+\t\t__rte_mbuf_sanity_check(m, 0);\r\n \r\n \t\tfprintf(f, \"  segment at 0x%p, data=0x%p, data_len=%u\\n\",\r\n \t\t       m, m->pkt.data, (unsigned)m->pkt.data_len);\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex fbd1c7b..cdb92dc 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -43,18 +43,13 @@\r\n  * buffers. The message buffers are stored in a mempool, using the\r\n  * RTE mempool library.\r\n  *\r\n- * This library provide an API to allocate/free mbufs, manipulate\r\n- * control message buffer (ctrlmbuf), which are generic message\r\n- * buffers, and packet buffers (pktmbuf), which are used to carry\r\n- * network packets.\r\n+ * This library provide an API to allocate/free packet mbufs, which are\r\n+ * used to carry network packets.\r\n  *\r\n  * To understand the concepts of packet buffers or mbufs, you\r\n  * should read \"TCP/IP Illustrated, Volume 2: The Implementation,\r\n  * Addison-Wesley, 1995, ISBN 0-201-63354-X from Richard Stevens\"\r\n  * http://www.kohala.com/start/tcpipiv2.html\r\n- *\r\n- * The main modification of this implementation is the use of mbuf for\r\n- * transports other than packets. mbufs can have other types.\r\n  */\r\n \r\n #include <stdint.h>\r\n@@ -70,15 +65,6 @@ extern \"C\" {\r\n /* deprecated feature, renamed in RTE_MBUF_REFCNT */\r\n #pragma GCC poison RTE_MBUF_SCATTER_GATHER\r\n \r\n-/**\r\n- * A control message buffer.\r\n- */\r\n-struct rte_ctrlmbuf {\r\n-\tvoid *data;        /**< Pointer to data. */\r\n-\tuint32_t data_len; /**< Length of data. */\r\n-};\r\n-\r\n-\r\n /*\r\n  * Packet Offload Features Flags. It also carry packet type information.\r\n  * Critical resources. Both rx/tx shared these bits. Be cautious on any change\r\n@@ -173,15 +159,7 @@ struct rte_pktmbuf {\r\n };\r\n \r\n /**\r\n- * This enum indicates the mbuf type.\r\n- */\r\n-enum rte_mbuf_type {\r\n-\tRTE_MBUF_CTRL,  /**< Control mbuf. */\r\n-\tRTE_MBUF_PKT,   /**< Packet mbuf. */\r\n-};\r\n-\r\n-/**\r\n- * The generic rte_mbuf, containing a packet mbuf or a control mbuf.\r\n+ * The generic rte_mbuf, containing a packet mbuf.\r\n  */\r\n struct rte_mbuf {\r\n \tstruct rte_mempool *pool; /**< Pool from which mbuf was allocated. */\r\n@@ -204,14 +182,10 @@ struct rte_mbuf {\r\n #else\r\n \tuint16_t refcnt_reserved;     /**< Do not use this field */\r\n #endif\r\n-\tuint8_t type;                 /**< Type of mbuf. */\r\n-\tuint8_t reserved;             /**< Unused field. Required for padding. */\r\n+\tuint16_t reserved;            /**< Unused field. Required for padding */\r\n \tuint16_t ol_flags;            /**< Offload features. */\r\n \r\n-\tunion {\r\n-\t\tstruct rte_ctrlmbuf ctrl;\r\n-\t\tstruct rte_pktmbuf pkt;\r\n-\t};\r\n+\tstruct rte_pktmbuf pkt;\r\n \r\n \tunion {\r\n \t\tuint8_t metadata[0];\r\n@@ -274,12 +248,12 @@ struct rte_pktmbuf_pool_private {\r\n #ifdef RTE_LIBRTE_MBUF_DEBUG\r\n \r\n /**  check mbuf type in debug mode */\r\n-#define __rte_mbuf_sanity_check(m, t, is_h) rte_mbuf_sanity_check(m, t, is_h)\r\n+#define __rte_mbuf_sanity_check(m, is_h) rte_mbuf_sanity_check(m, is_h)\r\n \r\n /**  check mbuf type in debug mode if mbuf pointer is not null */\r\n-#define __rte_mbuf_sanity_check_raw(m, t, is_h)\tdo {       \\\r\n+#define __rte_mbuf_sanity_check_raw(m, is_h)\tdo {       \\\r\n \tif ((m) != NULL)                                   \\\r\n-\t\trte_mbuf_sanity_check(m, t, is_h);          \\\r\n+\t\trte_mbuf_sanity_check(m, is_h);          \\\r\n } while (0)\r\n \r\n /**  MBUF asserts in debug mode */\r\n@@ -291,10 +265,10 @@ if (!(exp)) {                                                        \\\r\n #else /*  RTE_LIBRTE_MBUF_DEBUG */\r\n \r\n /**  check mbuf type in debug mode */\r\n-#define __rte_mbuf_sanity_check(m, t, is_h) do { } while(0)\r\n+#define __rte_mbuf_sanity_check(m, is_h) do { } while(0)\r\n \r\n /**  check mbuf type in debug mode if mbuf pointer is not null */\r\n-#define __rte_mbuf_sanity_check_raw(m, t, is_h) do { } while(0)\r\n+#define __rte_mbuf_sanity_check_raw(m, is_h) do { } while(0)\r\n \r\n /**  MBUF asserts in debug mode */\r\n #define RTE_MBUF_ASSERT(exp)                do { } while(0)\r\n@@ -401,20 +375,17 @@ rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)\r\n  *\r\n  * @param m\r\n  *   The mbuf to be checked.\r\n- * @param t\r\n- *   The expected type of the mbuf.\r\n  * @param is_header\r\n  *   True if the mbuf is a packet header, false if it is a sub-segment\r\n  *   of a packet (in this case, some fields like nb_segs are not checked)\r\n  */\r\n void\r\n-rte_mbuf_sanity_check(const struct rte_mbuf *m, enum rte_mbuf_type t,\r\n-\t\t      int is_header);\r\n+rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);\r\n \r\n /**\r\n  * @internal Allocate a new mbuf from mempool *mp*.\r\n  * The use of that function is reserved for RTE internal needs.\r\n- * Please use either rte_ctrlmbuf_alloc() or rte_pktmbuf_alloc().\r\n+ * Please use rte_pktmbuf_alloc().\r\n  *\r\n  * @param mp\r\n  *   The mempool from which mbuf is allocated.\r\n@@ -439,7 +410,7 @@ static inline struct rte_mbuf *__rte_mbuf_raw_alloc(struct rte_mempool *mp)\r\n /**\r\n  * @internal Put mbuf back into its original mempool.\r\n  * The use of that function is reserved for RTE internal needs.\r\n- * Please use either rte_ctrlmbuf_free() or rte_pktmbuf_free().\r\n+ * Please use rte_pktmbuf_free().\r\n  *\r\n  * @param m\r\n  *   The mbuf to be freed.\r\n@@ -475,7 +446,7 @@ __rte_mbuf_raw_free(struct rte_mbuf *m)\r\n  *   The index of the mbuf in the pool table.\r\n  */\r\n void rte_ctrlmbuf_init(struct rte_mempool *mp, void *opaque_arg,\r\n-\t\t       void *m, unsigned i);\r\n+                      void *m, unsigned i);\r\n \r\n /**\r\n  * Allocate a new mbuf (type is ctrl) from mempool *mp*.\r\n@@ -489,16 +460,7 @@ void rte_ctrlmbuf_init(struct rte_mempool *mp, void *opaque_arg,\r\n  *   - The pointer to the new mbuf on success.\r\n  *   - NULL if allocation failed.\r\n  */\r\n-static inline struct rte_mbuf *rte_ctrlmbuf_alloc(struct rte_mempool *mp)\r\n-{\r\n-\tstruct rte_mbuf *m;\r\n-\tif ((m = __rte_mbuf_raw_alloc(mp)) != NULL) {\r\n-\t\tm->ctrl.data = m->buf_addr;\r\n-\t\tm->ctrl.data_len = 0;\r\n-\t\t__rte_mbuf_sanity_check(m, RTE_MBUF_CTRL, 0);\r\n-\t}\r\n-\treturn (m);\r\n-}\r\n+#define rte_ctrlmbuf_alloc(mp) rte_pktmbuf_alloc(mp)\r\n \r\n /**\r\n  * Free a control mbuf back into its original mempool.\r\n@@ -506,14 +468,7 @@ static inline struct rte_mbuf *rte_ctrlmbuf_alloc(struct rte_mempool *mp)\r\n  * @param m\r\n  *   The control mbuf to be freed.\r\n  */\r\n-static inline void rte_ctrlmbuf_free(struct rte_mbuf *m)\r\n-{\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_CTRL, 0);\r\n-#ifdef RTE_MBUF_REFCNT\r\n-\tif (rte_mbuf_refcnt_update(m, -1) == 0)\r\n-#endif /* RTE_MBUF_REFCNT */\r\n-\t\t__rte_mbuf_raw_free(m);\r\n-}\r\n+#define rte_ctrlmbuf_free(m) rte_pktmbuf_free(m)\r\n \r\n /**\r\n  * A macro that returns the pointer to the carried data.\r\n@@ -523,7 +478,7 @@ static inline void rte_ctrlmbuf_free(struct rte_mbuf *m)\r\n  * @param m\r\n  *   The control mbuf.\r\n  */\r\n-#define rte_ctrlmbuf_data(m) ((m)->ctrl.data)\r\n+#define rte_ctrlmbuf_data(m) ((m)->pkt.data)\r\n \r\n /**\r\n  * A macro that returns the length of the carried data.\r\n@@ -533,15 +488,15 @@ static inline void rte_ctrlmbuf_free(struct rte_mbuf *m)\r\n  * @param m\r\n  *   The control mbuf.\r\n  */\r\n-#define rte_ctrlmbuf_len(m) ((m)->ctrl.data_len)\r\n+#define rte_ctrlmbuf_len(m) rte_pktmbuf_data_len(m)\r\n \r\n /* Operations on pkt mbuf */\r\n \r\n /**\r\n  * The packet mbuf constructor.\r\n  *\r\n- * This function initializes some fields in the mbuf structure that are not\r\n- * modified by the user once created (mbuf type, origin pool, buffer start\r\n+ * This function initializes some fields in the mbuf structure that are\r\n+ * not modified by the user once created (origin pool, buffer start\r\n  * address, and so on). This function is given as a callback function to\r\n  * rte_mempool_create() at pool creation time.\r\n  *\r\n@@ -602,11 +557,11 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)\r\n \tm->pkt.data = (char*) m->buf_addr + buf_ofs;\r\n \r\n \tm->pkt.data_len = 0;\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n }\r\n \r\n /**\r\n- * Allocate a new mbuf (type is pkt) from a mempool.\r\n+ * Allocate a new mbuf from a mempool.\r\n  *\r\n  * This new mbuf contains one segment, which has a length of 0. The pointer\r\n  * to data is initialized to have some bytes of headroom in the buffer\r\n@@ -662,8 +617,8 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *md)\r\n \tmi->pkt.nb_segs = 1;\r\n \tmi->ol_flags = md->ol_flags;\r\n \r\n-\t__rte_mbuf_sanity_check(mi, RTE_MBUF_PKT, 1);\r\n-\t__rte_mbuf_sanity_check(md, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check(mi, 1);\r\n+\t__rte_mbuf_sanity_check(md, 0);\r\n }\r\n \r\n /**\r\n@@ -700,7 +655,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)\r\n static inline struct rte_mbuf* __attribute__((always_inline))\r\n __rte_pktmbuf_prefree_seg(struct rte_mbuf *m)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check(m, 0);\r\n \r\n #ifdef RTE_MBUF_REFCNT\r\n \tif (likely (rte_mbuf_refcnt_read(m) == 1) ||\r\n@@ -755,7 +710,7 @@ static inline void rte_pktmbuf_free(struct rte_mbuf *m)\r\n {\r\n \tstruct rte_mbuf *m_next;\r\n \r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \twhile (m != NULL) {\r\n \t\tm_next = m->pkt.next;\r\n@@ -816,7 +771,7 @@ static inline struct rte_mbuf *rte_pktmbuf_clone(struct rte_mbuf *md,\r\n \t\treturn (NULL);\r\n \t}\r\n \r\n-\t__rte_mbuf_sanity_check(mc, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(mc, 1);\r\n \treturn (mc);\r\n }\r\n \r\n@@ -833,7 +788,7 @@ static inline struct rte_mbuf *rte_pktmbuf_clone(struct rte_mbuf *md,\r\n  */\r\n static inline void rte_pktmbuf_refcnt_update(struct rte_mbuf *m, int16_t v)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \tdo {\r\n \t\trte_mbuf_refcnt_update(m, v);\r\n@@ -852,7 +807,7 @@ static inline void rte_pktmbuf_refcnt_update(struct rte_mbuf *m, int16_t v)\r\n  */\r\n static inline uint16_t rte_pktmbuf_headroom(const struct rte_mbuf *m)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \treturn (uint16_t) ((char*) m->pkt.data - (char*) m->buf_addr);\r\n }\r\n \r\n@@ -866,7 +821,7 @@ static inline uint16_t rte_pktmbuf_headroom(const struct rte_mbuf *m)\r\n  */\r\n static inline uint16_t rte_pktmbuf_tailroom(const struct rte_mbuf *m)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \treturn (uint16_t)(m->buf_len - rte_pktmbuf_headroom(m) -\r\n \t\t\t  m->pkt.data_len);\r\n }\r\n@@ -883,7 +838,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)\r\n {\r\n \tstruct rte_mbuf *m2 = (struct rte_mbuf *)m;\r\n \r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \twhile (m2->pkt.next != NULL)\r\n \t\tm2 = m2->pkt.next;\r\n \treturn m2;\r\n@@ -941,7 +896,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)\r\n static inline char *rte_pktmbuf_prepend(struct rte_mbuf *m,\r\n \t\t\t\t\tuint16_t len)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \tif (unlikely(len > rte_pktmbuf_headroom(m)))\r\n \t\treturn NULL;\r\n@@ -973,7 +928,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len)\r\n \tvoid *tail;\r\n \tstruct rte_mbuf *m_last;\r\n \r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \tm_last = rte_pktmbuf_lastseg(m);\r\n \tif (unlikely(len > rte_pktmbuf_tailroom(m_last)))\r\n@@ -1001,7 +956,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len)\r\n  */\r\n static inline char *rte_pktmbuf_adj(struct rte_mbuf *m, uint16_t len)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \tif (unlikely(len > m->pkt.data_len))\r\n \t\treturn NULL;\r\n@@ -1030,7 +985,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len)\r\n {\r\n \tstruct rte_mbuf *m_last;\r\n \r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \r\n \tm_last = rte_pktmbuf_lastseg(m);\r\n \tif (unlikely(len > m_last->pkt.data_len))\r\n@@ -1052,7 +1007,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len)\r\n  */\r\n static inline int rte_pktmbuf_is_contiguous(const struct rte_mbuf *m)\r\n {\r\n-\t__rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);\r\n+\t__rte_mbuf_sanity_check(m, 1);\r\n \treturn !!(m->pkt.nb_segs == 1);\r\n }\r\n \r\ndiff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c\r\nindex f254858..3304f50 100644\r\n--- a/lib/librte_pmd_e1000/em_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/em_rxtx.c\r\n@@ -85,7 +85,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \treturn (m);\r\n }\r\n \r\ndiff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c\r\nindex 977c4a2..b0112be 100644\r\n--- a/lib/librte_pmd_e1000/igb_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/igb_rxtx.c\r\n@@ -90,7 +90,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \treturn (m);\r\n }\r\n \r\ndiff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c\r\nindex 83b9462..76ff019 100644\r\n--- a/lib/librte_pmd_i40e/i40e_rxtx.c\r\n+++ b/lib/librte_pmd_i40e/i40e_rxtx.c\r\n@@ -473,7 +473,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \r\n \treturn m;\r\n }\r\n@@ -687,7 +687,6 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)\r\n \tfor (i = 0; i < rxq->rx_free_thresh; i++) {\r\n \t\tmb = rxep[i].mbuf;\r\n \t\trte_mbuf_refcnt_set(mb, 1);\r\n-\t\tmb->type = RTE_MBUF_PKT;\r\n \t\tmb->pkt.next = NULL;\r\n \t\tmb->pkt.data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmb->pkt.nb_segs = 1;\r\n@@ -2020,7 +2019,6 @@ i40e_alloc_rx_queue_mbufs(struct i40e_rx_queue *rxq)\r\n \t\t}\r\n \r\n \t\trte_mbuf_refcnt_set(mbuf, 1);\r\n-\t\tmbuf->type = RTE_MBUF_PKT;\r\n \t\tmbuf->pkt.next = NULL;\r\n \t\tmbuf->pkt.data = (char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmbuf->pkt.nb_segs = 1;\r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\nindex dfc2076..40ea4f8 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n@@ -96,7 +96,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \treturn (m);\r\n }\r\n \r\n@@ -995,7 +995,6 @@ ixgbe_rx_alloc_bufs(struct igb_rx_queue *rxq)\r\n \t\t/* populate the static rte mbuf fields */\r\n \t\tmb = rxep[i].mbuf;\r\n \t\trte_mbuf_refcnt_set(mb, 1);\r\n-\t\tmb->type = RTE_MBUF_PKT;\r\n \t\tmb->pkt.next = NULL;\r\n \t\tmb->pkt.data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmb->pkt.nb_segs = 1;\r\n@@ -3213,7 +3212,6 @@ ixgbe_alloc_rx_queue_mbufs(struct igb_rx_queue *rxq)\r\n \t\t}\r\n \r\n \t\trte_mbuf_refcnt_set(mbuf, 1);\r\n-\t\tmbuf->type = RTE_MBUF_PKT;\r\n \t\tmbuf->pkt.next = NULL;\r\n \t\tmbuf->pkt.data = (char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \t\tmbuf->pkt.nb_segs = 1;\r\ndiff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c\r\nindex fcd8bd1..186514d 100644\r\n--- a/lib/librte_pmd_virtio/virtio_rxtx.c\r\n+++ b/lib/librte_pmd_virtio/virtio_rxtx.c\r\n@@ -227,7 +227,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \r\n \treturn m;\r\n }\r\ndiff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\nindex 2d9f5e0..2470c8e 100644\r\n--- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n+++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n@@ -100,7 +100,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \treturn m;\r\n }\r\n \r\ndiff --git a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c\r\nindex 450332a..ba82319 100644\r\n--- a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c\r\n+++ b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c\r\n@@ -81,7 +81,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n \tstruct rte_mbuf *m;\r\n \r\n \tm = __rte_mbuf_raw_alloc(mp);\r\n-\t__rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);\r\n+\t__rte_mbuf_sanity_check_raw(m, 0);\r\n \r\n \treturn m;\r\n }\r\n",
    "prefixes": [
        "dpdk-dev",
        "3/6"
    ]
}