Show a patch.

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

{
    "id": 308,
    "url": "http://patches.dpdk.org/api/patches/308/",
    "web_url": "http://patches.dpdk.org/patch/308/",
    "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": "<1409759378-10113-2-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-09-03T15:49:26",
    "name": "[dpdk-dev,01/13] mbuf: replace data pointer by an offset",
    "commit_ref": "",
    "pull_url": "",
    "state": "superseded",
    "archived": true,
    "hash": "06b05f421a2ccad8c8a3050bde612f555e344066",
    "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/308/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/308/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/308/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<bricha3@ecsmtp.ir.intel.com>",
        "References": "<1409759378-10113-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,458,1406617200\"; d=\"scan'208\";a=\"585697552\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "X-List-Received-Date": "Wed, 03 Sep 2014 15:45:44 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1409759378-10113-2-git-send-email-bruce.richardson@intel.com>",
        "Received": [
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\r\n\tby dpdk.org (Postfix) with ESMTP id A2B0BB39F\r\n\tfor <dev@dpdk.org>; Wed,  3 Sep 2014 17:45:42 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\r\n\tby fmsmga102.fm.intel.com with ESMTP; 03 Sep 2014 08:49:46 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby fmsmga001.fm.intel.com with ESMTP; 03 Sep 2014 08:49:40 -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\ts83FnduT025414; Wed, 3 Sep 2014 16:49:39 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s83FndCj010418;\r\n\tWed, 3 Sep 2014 16:49:39 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s83FncJ2010413;\r\n\tWed, 3 Sep 2014 16:49:38 +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,  3 Sep 2014 16:49:26 +0100",
        "Subject": "[dpdk-dev] [PATCH 01/13] mbuf: replace data pointer by an offset",
        "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": "<1409759378-10113-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\nOriginal patch:\n The mbuf structure already contains a pointer to the beginning of the\n buffer (m->buf_addr). It is not needed to use 8 bytes again to store\n another pointer to the beginning of the data.\n\n Using a 16 bits unsigned integer is enough as we know that a mbuf is\n never longer than 64KB. We gain 6 bytes in the structure thanks to\n this modification.\n\n Signed-off-by: Olivier Matz <olivier.matz@6wind.com>\n\nThis version:\n* Updated original patch to apply to latest on mainline.\n* Disabled vector PMD in config as it relies heavily on the mbuf layout\n  This will be re-enabled in a subsequent commit once vPMD has been\n  reworked to take account of mbuf changes.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/test-pmd/csumonly.c                     |  2 +-\n app/test-pmd/flowgen.c                      |  2 +-\n app/test-pmd/icmpecho.c                     |  2 +-\n app/test-pmd/ieee1588fwd.c                  |  4 +--\n app/test-pmd/macfwd-retry.c                 |  2 +-\n app/test-pmd/macfwd.c                       |  2 +-\n app/test-pmd/macswap.c                      |  2 +-\n app/test-pmd/rxonly.c                       |  2 +-\n app/test-pmd/testpmd.c                      |  2 +-\n app/test-pmd/txonly.c                       |  7 ++---\n app/test/packet_burst_generator.c           |  7 ++---\n app/test/test_mbuf.c                        |  6 ++---\n app/test/test_table_acl.c                   |  7 ++---\n app/test/test_table_pipeline.c              |  8 ++----\n config/common_linuxapp                      |  2 +-\n examples/exception_path/main.c              |  3 ++-\n examples/vhost/main.c                       | 37 +++++++++++++------------\n examples/vhost_xen/main.c                   | 14 +++++-----\n lib/librte_ip_frag/rte_ipv4_fragmentation.c |  6 ++---\n lib/librte_ip_frag/rte_ipv6_fragmentation.c |  6 ++---\n lib/librte_mbuf/rte_mbuf.c                  |  6 ++---\n lib/librte_mbuf/rte_mbuf.h                  | 42 +++++++++++++----------------\n lib/librte_pmd_bond/rte_eth_bond_pmd.c      |  4 +--\n lib/librte_pmd_e1000/em_rxtx.c              | 12 ++++-----\n lib/librte_pmd_e1000/igb_rxtx.c             | 13 +++++----\n lib/librte_pmd_i40e/i40e_rxtx.c             | 17 ++++++------\n lib/librte_pmd_ixgbe/ixgbe_rxtx.c           | 13 ++++-----\n lib/librte_pmd_ixgbe/ixgbe_rxtx.h           |  3 +--\n lib/librte_pmd_pcap/rte_eth_pcap.c          |  9 ++++---\n lib/librte_pmd_virtio/virtio_rxtx.c         | 10 +++----\n lib/librte_pmd_virtio/virtqueue.h           |  3 +--\n lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c       |  5 ++--\n lib/librte_pmd_xenvirt/rte_eth_xenvirt.c    |  2 +-\n 33 files changed, 130 insertions(+), 132 deletions(-)",
    "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\r\nindex 28b66f5..2ce4c42 100644\r\n--- a/app/test-pmd/csumonly.c\r\n+++ b/app/test-pmd/csumonly.c\r\n@@ -263,7 +263,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\r\n \t\tpkt_ol_flags = mb->ol_flags;\r\n \t\tol_flags = (uint16_t) (pkt_ol_flags & (~PKT_TX_L4_MASK));\r\n \r\n-\t\teth_hdr = (struct ether_hdr *) mb->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\r\n \t\teth_type = rte_be_to_cpu_16(eth_hdr->ether_type);\r\n \t\tif (eth_type == ETHER_TYPE_VLAN) {\r\n \t\t\t/* Only allow single VLAN label here */\r\ndiff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c\r\nindex b091b6d..8b4ed9a 100644\r\n--- a/app/test-pmd/flowgen.c\r\n+++ b/app/test-pmd/flowgen.c\r\n@@ -175,7 +175,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)\r\n \t\tpkt->next = NULL;\r\n \r\n \t\t/* Initialize Ethernet header. */\r\n-\t\teth_hdr = (struct ether_hdr *)pkt->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);\r\n \t\tether_addr_copy(&cfg_ether_dst, &eth_hdr->d_addr);\r\n \t\tether_addr_copy(&cfg_ether_src, &eth_hdr->s_addr);\r\n \t\teth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);\r\ndiff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c\r\nindex 4a277b8..7fd4b6d 100644\r\n--- a/app/test-pmd/icmpecho.c\r\n+++ b/app/test-pmd/icmpecho.c\r\n@@ -330,7 +330,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)\r\n \tnb_replies = 0;\r\n \tfor (i = 0; i < nb_rx; i++) {\r\n \t\tpkt = pkts_burst[i];\r\n-\t\teth_h = (struct ether_hdr *) pkt->data;\r\n+\t\teth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *);\r\n \t\teth_type = RTE_BE_TO_CPU_16(eth_h->ether_type);\r\n \t\tl2_len = sizeof(struct ether_hdr);\r\n \t\tif (verbose_level > 0) {\r\ndiff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c\r\nindex ab5e06e..976aa28 100644\r\n--- a/app/test-pmd/ieee1588fwd.c\r\n+++ b/app/test-pmd/ieee1588fwd.c\r\n@@ -546,7 +546,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)\r\n \t * Check that the received packet is a PTP packet that was detected\r\n \t * by the hardware.\r\n \t */\r\n-\teth_hdr = (struct ether_hdr *)mb->data;\r\n+\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\r\n \teth_type = rte_be_to_cpu_16(eth_hdr->ether_type);\r\n \tif (! (mb->ol_flags & PKT_RX_IEEE1588_PTP)) {\r\n \t\tif (eth_type == ETHER_TYPE_1588) {\r\n@@ -574,7 +574,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)\r\n \t * Check that the received PTP packet is a PTP V2 packet of type\r\n \t * PTP_SYNC_MESSAGE.\r\n \t */\r\n-\tptp_hdr = (struct ptpv2_msg *) ((char *) mb->data +\r\n+\tptp_hdr = (struct ptpv2_msg *) (rte_pktmbuf_mtod(mb, char *) +\r\n \t\t\t\t\tsizeof(struct ether_hdr));\r\n \tif (ptp_hdr->version != 0x02) {\r\n \t\tprintf(\"Port %u Received PTP V2 Ethernet frame with wrong PTP\"\r\ndiff --git a/app/test-pmd/macfwd-retry.c b/app/test-pmd/macfwd-retry.c\r\nindex 5122983..83da26f 100644\r\n--- a/app/test-pmd/macfwd-retry.c\r\n+++ b/app/test-pmd/macfwd-retry.c\r\n@@ -119,7 +119,7 @@ pkt_burst_mac_retry_forward(struct fwd_stream *fs)\r\n \tfs->rx_packets += nb_rx;\r\n \tfor (i = 0; i < nb_rx; i++) {\r\n \t\tmb = pkts_burst[i];\r\n-\t\teth_hdr = (struct ether_hdr *) mb->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\r\n \t\tether_addr_copy(&peer_eth_addrs[fs->peer_addr],\r\n \t\t\t\t&eth_hdr->d_addr);\r\n \t\tether_addr_copy(&ports[fs->tx_port].eth_addr,\r\ndiff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c\r\nindex 4b905cd..38bae23 100644\r\n--- a/app/test-pmd/macfwd.c\r\n+++ b/app/test-pmd/macfwd.c\r\n@@ -110,7 +110,7 @@ pkt_burst_mac_forward(struct fwd_stream *fs)\r\n \ttxp = &ports[fs->tx_port];\r\n \tfor (i = 0; i < nb_rx; i++) {\r\n \t\tmb = pkts_burst[i];\r\n-\t\teth_hdr = (struct ether_hdr *) mb->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\r\n \t\tether_addr_copy(&peer_eth_addrs[fs->peer_addr],\r\n \t\t\t\t&eth_hdr->d_addr);\r\n \t\tether_addr_copy(&ports[fs->tx_port].eth_addr,\r\ndiff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c\r\nindex c5b3a0c..1786095 100644\r\n--- a/app/test-pmd/macswap.c\r\n+++ b/app/test-pmd/macswap.c\r\n@@ -110,7 +110,7 @@ pkt_burst_mac_swap(struct fwd_stream *fs)\r\n \ttxp = &ports[fs->tx_port];\r\n \tfor (i = 0; i < nb_rx; i++) {\r\n \t\tmb = pkts_burst[i];\r\n-\t\teth_hdr = (struct ether_hdr *) mb->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\r\n \r\n \t\t/* Swap dest and src mac addresses. */\r\n \t\tether_addr_copy(&eth_hdr->d_addr, &addr);\r\ndiff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c\r\nindex 5bc74da..7ba36a1 100644\r\n--- a/app/test-pmd/rxonly.c\r\n+++ b/app/test-pmd/rxonly.c\r\n@@ -149,7 +149,7 @@ pkt_burst_receive(struct fwd_stream *fs)\r\n \t\t\trte_pktmbuf_free(mb);\r\n \t\t\tcontinue;\r\n \t\t}\r\n-\t\teth_hdr = (struct ether_hdr *) mb->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *);\r\n \t\teth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type);\r\n \t\tol_flags = mb->ol_flags;\r\n \t\tprint_ether_addr(\"  src=\", &eth_hdr->s_addr);\r\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\r\nindex b6596f8..32b705e 100644\r\n--- a/app/test-pmd/testpmd.c\r\n+++ b/app/test-pmd/testpmd.c\r\n@@ -404,7 +404,7 @@ testpmd_mbuf_ctor(struct rte_mempool *mp,\r\n \t\t\tmb_ctor_arg->seg_buf_offset);\r\n \tmb->buf_len      = mb_ctor_arg->seg_buf_size;\r\n \tmb->ol_flags     = 0;\r\n-\tmb->data         = (char *) mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\tmb->data_off     = RTE_PKTMBUF_HEADROOM;\r\n \tmb->nb_segs      = 1;\r\n \tmb->l2_len       = 0;\r\n \tmb->l3_len       = 0;\r\ndiff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c\r\nindex 8135264..2b3f0b9 100644\r\n--- a/app/test-pmd/txonly.c\r\n+++ b/app/test-pmd/txonly.c\r\n@@ -111,13 +111,13 @@ copy_buf_to_pkt_segs(void* buf, unsigned len, struct rte_mbuf *pkt,\r\n \t\tseg = seg->next;\r\n \t}\r\n \tcopy_len = seg->data_len - offset;\r\n-\tseg_buf = ((char *) seg->data + offset);\r\n+\tseg_buf = (rte_pktmbuf_mtod(seg, char *) + offset);\r\n \twhile (len > copy_len) {\r\n \t\trte_memcpy(seg_buf, buf, (size_t) copy_len);\r\n \t\tlen -= copy_len;\r\n \t\tbuf = ((char*) buf + copy_len);\r\n \t\tseg = seg->next;\r\n-\t\tseg_buf = seg->data;\r\n+\t\tseg_buf = rte_pktmbuf_mtod(seg, char *);\r\n \t}\r\n \trte_memcpy(seg_buf, buf, (size_t) len);\r\n }\r\n@@ -126,7 +126,8 @@ static inline void\r\n copy_buf_to_pkt(void* buf, unsigned len, struct rte_mbuf *pkt, unsigned offset)\r\n {\r\n \tif (offset + len <= pkt->data_len) {\r\n-\t\trte_memcpy(((char *) pkt->data + offset), buf, (size_t) len);\r\n+\t\trte_memcpy((rte_pktmbuf_mtod(pkt, char *) + offset),\r\n+\t\t\tbuf, (size_t) len);\r\n \t\treturn;\r\n \t}\r\n \tcopy_buf_to_pkt_segs(buf, len, pkt, offset);\r\ndiff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c\r\nindex db7f023..9e747a4 100644\r\n--- a/app/test/packet_burst_generator.c\r\n+++ b/app/test/packet_burst_generator.c\r\n@@ -59,13 +59,13 @@ copy_buf_to_pkt_segs(void *buf, unsigned len, struct rte_mbuf *pkt,\r\n \t\tseg = seg->next;\r\n \t}\r\n \tcopy_len = seg->data_len - offset;\r\n-\tseg_buf = ((char *) seg->data + offset);\r\n+\tseg_buf = rte_pktmbuf_mtod(seg, char *) + offset;\r\n \twhile (len > copy_len) {\r\n \t\trte_memcpy(seg_buf, buf, (size_t) copy_len);\r\n \t\tlen -= copy_len;\r\n \t\tbuf = ((char *) buf + copy_len);\r\n \t\tseg = seg->next;\r\n-\t\tseg_buf = seg->data;\r\n+\t\tseg_buf = rte_pktmbuf_mtod(seg, void *);\r\n \t}\r\n \trte_memcpy(seg_buf, buf, (size_t) len);\r\n }\r\n@@ -74,7 +74,8 @@ static inline void\r\n copy_buf_to_pkt(void *buf, unsigned len, struct rte_mbuf *pkt, unsigned offset)\r\n {\r\n \tif (offset + len <= pkt->data_len) {\r\n-\t\trte_memcpy(((char *) pkt->data + offset), buf, (size_t) len);\r\n+\t\trte_memcpy(rte_pktmbuf_mtod(pkt, char *) + offset,\r\n+\t\t\t\tbuf, (size_t) len);\r\n \t\treturn;\r\n \t}\r\n \tcopy_buf_to_pkt_segs(buf, len, pkt, offset);\r\ndiff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c\r\nindex b81e622..e3d896b 100644\r\n--- a/app/test/test_mbuf.c\r\n+++ b/app/test/test_mbuf.c\r\n@@ -432,7 +432,7 @@ test_pktmbuf_pool_ptr(void)\r\n \t\t\tprintf(\"rte_pktmbuf_alloc() failed (%u)\\n\", i);\r\n \t\t\tret = -1;\r\n \t\t}\r\n-\t\tm[i]->data = RTE_PTR_ADD(m[i]->data, 64);\r\n+\t\tm[i]->data_off += 64;\r\n \t}\r\n \r\n \t/* free them */\r\n@@ -451,8 +451,8 @@ test_pktmbuf_pool_ptr(void)\r\n \t\t\tprintf(\"rte_pktmbuf_alloc() failed (%u)\\n\", i);\r\n \t\t\tret = -1;\r\n \t\t}\r\n-\t\tif (m[i]->data != RTE_PTR_ADD(m[i]->buf_addr, RTE_PKTMBUF_HEADROOM)) {\r\n-\t\t\tprintf (\"data pointer not set properly\\n\");\r\n+\t\tif (m[i]->data_off != RTE_PKTMBUF_HEADROOM) {\r\n+\t\t\tprintf (\"invalid data_off\\n\");\r\n \t\t\tret = -1;\r\n \t\t}\r\n \t}\r\ndiff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c\r\nindex 4db680a..0f2b57e 100644\r\n--- a/app/test/test_table_acl.c\r\n+++ b/app/test/test_table_acl.c\r\n@@ -513,7 +513,7 @@ test_pipeline_single_filter(int expected_count)\r\n \t\t\tstruct rte_mbuf *mbuf;\r\n \r\n \t\t\tmbuf = rte_pktmbuf_alloc(pool);\r\n-\t\t\tmemset(mbuf->data, 0x00,\r\n+\t\t\tmemset(rte_pktmbuf_mtod(mbuf, char *), 0x00,\r\n \t\t\t\tsizeof(struct ipv4_5tuple));\r\n \r\n \t\t\tfive_tuple.proto = j;\r\n@@ -522,7 +522,7 @@ test_pipeline_single_filter(int expected_count)\r\n \t\t\tfive_tuple.port_src = rte_bswap16(100 + j);\r\n \t\t\tfive_tuple.port_dst = rte_bswap16(200 + j);\r\n \r\n-\t\t\tmemcpy(mbuf->data, &five_tuple,\r\n+\t\t\tmemcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple,\r\n \t\t\t\tsizeof(struct ipv4_5tuple));\r\n \t\t\tRTE_LOG(INFO, PIPELINE, \"%s: Enqueue onto ring %d\\n\",\r\n \t\t\t\t__func__, i);\r\n@@ -549,7 +549,8 @@ test_pipeline_single_filter(int expected_count)\r\n \t\t\tprintf(\"Got %d object(s) from ring %d!\\n\", ret, i);\r\n \t\t\tfor (j = 0; j < ret; j++) {\r\n \t\t\t\tmbuf = (struct rte_mbuf *)objs[j];\r\n-\t\t\t\trte_hexdump(stdout, \"mbuf\", mbuf->data, 64);\r\n+\t\t\t\trte_hexdump(stdout, \"mbuf\",\r\n+\t\t\t\t\trte_pktmbuf_mtod(mbuf, char *), 64);\r\n \t\t\t\trte_pktmbuf_free(mbuf);\r\n \t\t\t}\r\n \t\t\ttx_count += ret;\r\ndiff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c\r\nindex 15a038b..a0a9e04 100644\r\n--- a/app/test/test_table_pipeline.c\r\n+++ b/app/test/test_table_pipeline.c\r\n@@ -39,11 +39,6 @@\r\n #include \"test_table.h\"\r\n #include \"test_table_pipeline.h\"\r\n \r\n-#define RTE_CBUF_UINT8_PTR(cbuf, offset)\t\t\t\\\r\n-\t(&cbuf->data[offset])\r\n-#define RTE_CBUF_UINT32_PTR(cbuf, offset)\t\t\t\\\r\n-\t(&cbuf->data32[offset/sizeof(uint32_t)])\r\n-\r\n #if 0\r\n \r\n static rte_pipeline_port_out_action_handler port_action_0x00\r\n@@ -498,7 +493,8 @@ test_pipeline_single_filter(int test_type, int expected_count)\r\n \t\t\tprintf(\"Got %d object(s) from ring %d!\\n\", ret, i);\r\n \t\t\tfor (j = 0; j < ret; j++) {\r\n \t\t\t\tmbuf = (struct rte_mbuf *)objs[j];\r\n-\t\t\t\trte_hexdump(stdout, \"Object:\", mbuf->data,\r\n+\t\t\t\trte_hexdump(stdout, \"Object:\",\r\n+\t\t\t\t\trte_pktmbuf_mtod(mbuf, char *),\r\n \t\t\t\t\tmbuf->data_len);\r\n \t\t\t\trte_pktmbuf_free(mbuf);\r\n \t\t\t}\r\ndiff --git a/config/common_linuxapp b/config/common_linuxapp\r\nindex 5bee910..b140af7 100644\r\n--- a/config/common_linuxapp\r\n+++ b/config/common_linuxapp\r\n@@ -191,7 +191,7 @@ CONFIG_RTE_LIBRTE_IXGBE_DEBUG_DRIVER=n\r\n CONFIG_RTE_LIBRTE_IXGBE_PF_DISABLE_STRIP_CRC=n\r\n CONFIG_RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC=y\r\n CONFIG_RTE_LIBRTE_IXGBE_ALLOW_UNSUPPORTED_SFP=n\r\n-CONFIG_RTE_IXGBE_INC_VECTOR=y\r\n+CONFIG_RTE_IXGBE_INC_VECTOR=n\r\n CONFIG_RTE_IXGBE_RX_OLFLAGS_ENABLE=y\r\n \r\n #\r\ndiff --git a/examples/exception_path/main.c b/examples/exception_path/main.c\r\nindex 5045ef8..f286bf2 100644\r\n--- a/examples/exception_path/main.c\r\n+++ b/examples/exception_path/main.c\r\n@@ -302,7 +302,8 @@ main_loop(__attribute__((unused)) void *arg)\r\n \t\t\tif (m == NULL)\r\n \t\t\t\tcontinue;\r\n \r\n-\t\t\tret = read(tap_fd, m->data, MAX_PACKET_SZ);\r\n+\t\t\tret = read(tap_fd, rte_pktmbuf_mtod(m, void *),\r\n+\t\t\t\tMAX_PACKET_SZ);\r\n \t\t\tlcore_stats[lcore_id].rx++;\r\n \t\t\tif (unlikely(ret < 0)) {\r\n \t\t\t\tFATAL_ERROR(\"Reading from %s interface failed\",\r\ndiff --git a/examples/vhost/main.c b/examples/vhost/main.c\r\nindex 4e1c103..85ee8b8 100644\r\n--- a/examples/vhost/main.c\r\n+++ b/examples/vhost/main.c\r\n@@ -1033,7 +1033,7 @@ virtio_dev_rx(struct virtio_net *dev, struct rte_mbuf **pkts, uint32_t count)\r\n \r\n \t\t/* Copy mbuf data to buffer */\r\n \t\trte_memcpy((void *)(uintptr_t)buff_addr,\r\n-\t\t\t(const void *)buff->data,\r\n+\t\t\trte_pktmbuf_mtod(buff, const void *),\r\n \t\t\trte_pktmbuf_data_len(buff));\r\n \t\tPRINT_PACKET(dev, (uintptr_t)buff_addr,\r\n \t\t\trte_pktmbuf_data_len(buff), 0);\r\n@@ -1438,7 +1438,7 @@ link_vmdq(struct virtio_net *dev, struct rte_mbuf *m)\r\n \tint i, ret;\r\n \r\n \t/* Learn MAC address of guest device from packet */\r\n-\tpkt_hdr = (struct ether_hdr *)m->data;\r\n+\tpkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);\r\n \r\n \tdev_ll = ll_root_used;\r\n \r\n@@ -1525,7 +1525,7 @@ virtio_tx_local(struct virtio_net *dev, struct rte_mbuf *m)\r\n \tstruct ether_hdr *pkt_hdr;\r\n \tuint64_t ret = 0;\r\n \r\n-\tpkt_hdr = (struct ether_hdr *)m->data;\r\n+\tpkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);\r\n \r\n \t/*get the used devices list*/\r\n \tdev_ll = ll_root_used;\r\n@@ -1593,7 +1593,7 @@ virtio_tx_route(struct virtio_net* dev, struct rte_mbuf *m, struct rte_mempool *\r\n \tunsigned len, ret, offset = 0;\r\n \tconst uint16_t lcore_id = rte_lcore_id();\r\n \tstruct virtio_net_data_ll *dev_ll = ll_root_used;\r\n-\tstruct ether_hdr *pkt_hdr = (struct ether_hdr *)m->data;\r\n+\tstruct ether_hdr *pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);\r\n \r\n \t/*check if destination is local VM*/\r\n \tif ((vm2vm_mode == VM2VM_SOFTWARE) && (virtio_tx_local(dev, m) == 0))\r\n@@ -1652,18 +1652,21 @@ virtio_tx_route(struct virtio_net* dev, struct rte_mbuf *m, struct rte_mempool *\r\n \tmbuf->nb_segs = m->nb_segs;\r\n \r\n \t/* Copy ethernet header to mbuf. */\r\n-\trte_memcpy((void*)mbuf->data, (const void*)m->data, ETH_HLEN);\r\n+\trte_memcpy(rte_pktmbuf_mtod(mbuf, void *),\r\n+\t\trte_pktmbuf_mtod(m, const void *),\r\n+\t\tETH_HLEN);\r\n \r\n \r\n \t/* Setup vlan header. Bytes need to be re-ordered for network with htons()*/\r\n-\tvlan_hdr = (struct vlan_ethhdr *) mbuf->data;\r\n+\tvlan_hdr = rte_pktmbuf_mtod(mbuf, struct vlan_ethhdr *);\r\n \tvlan_hdr->h_vlan_encapsulated_proto = vlan_hdr->h_vlan_proto;\r\n \tvlan_hdr->h_vlan_proto = htons(ETH_P_8021Q);\r\n \tvlan_hdr->h_vlan_TCI = htons(vlan_tag);\r\n \r\n \t/* Copy the remaining packet contents to the mbuf. */\r\n-\trte_memcpy((void*) ((uint8_t*)mbuf->data + VLAN_ETH_HLEN),\r\n-\t\t(const void*) ((uint8_t*)m->data + ETH_HLEN), (m->data_len - ETH_HLEN));\r\n+\trte_memcpy((void *)(rte_pktmbuf_mtod(mbuf, uint8_t *) + VLAN_ETH_HLEN),\r\n+\t\t(const void *)(rte_pktmbuf_mtod(m, uint8_t *) + ETH_HLEN),\r\n+\t\t(m->data_len - ETH_HLEN));\r\n \r\n \t/* Copy the remaining segments for the whole packet. */\r\n \tprev = mbuf;\r\n@@ -1778,7 +1781,7 @@ virtio_dev_tx(struct virtio_net* dev, struct rte_mempool *mbuf_pool)\r\n \t\t/* Setup dummy mbuf. This is copied to a real mbuf if transmitted out the physical port. */\r\n \t\tm.data_len = desc->len;\r\n \t\tm.pkt_len = desc->len;\r\n-\t\tm.data = (void*)(uintptr_t)buff_addr;\r\n+\t\tm.data_off = 0;\r\n \r\n \t\tPRINT_PACKET(dev, (uintptr_t)buff_addr, desc->len, 0);\r\n \r\n@@ -2333,7 +2336,7 @@ attach_rxmbuf_zcp(struct virtio_net *dev)\r\n \t}\r\n \r\n \tmbuf->buf_addr = (void *)(uintptr_t)(buff_addr - RTE_PKTMBUF_HEADROOM);\r\n-\tmbuf->data = (void *)(uintptr_t)(buff_addr);\r\n+\tmbuf->data_off = RTE_PKTMBUF_HEADROOM;\r\n \tmbuf->buf_physaddr = phys_addr - RTE_PKTMBUF_HEADROOM;\r\n \tmbuf->data_len = desc->len;\r\n \tMBUF_HEADROOM_UINT32(mbuf) = (uint32_t)desc_idx;\r\n@@ -2370,7 +2373,7 @@ static inline void pktmbuf_detach_zcp(struct rte_mbuf *m)\r\n \r\n \tbuf_ofs = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?\r\n \t\t\tRTE_PKTMBUF_HEADROOM : m->buf_len;\r\n-\tm->data = (char *) m->buf_addr + buf_ofs;\r\n+\tm->data_off = buf_ofs;\r\n \r\n \tm->data_len = 0;\r\n }\r\n@@ -2604,7 +2607,7 @@ virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,\r\n \tunsigned len, ret, offset = 0;\r\n \tstruct vpool *vpool;\r\n \tstruct virtio_net_data_ll *dev_ll = ll_root_used;\r\n-\tstruct ether_hdr *pkt_hdr = (struct ether_hdr *)m->data;\r\n+\tstruct ether_hdr *pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);\r\n \tuint16_t vlan_tag = (uint16_t)vlan_tags[(uint16_t)dev->device_fh];\r\n \r\n \t/*Add packet to the port tx queue*/\r\n@@ -2681,11 +2684,11 @@ virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,\r\n \tmbuf->pkt_len = mbuf->data_len;\r\n \tif (unlikely(need_copy)) {\r\n \t\t/* Copy the packet contents to the mbuf. */\r\n-\t\trte_memcpy((void *)((uint8_t *)mbuf->data),\r\n-\t\t\t(const void *) ((uint8_t *)m->data),\r\n+\t\trte_memcpy(rte_pktmbuf_mtod(mbuf, void *),\r\n+\t\t\trte_pktmbuf_mtod(m, void *),\r\n \t\t\tm->data_len);\r\n \t} else {\r\n-\t\tmbuf->data = m->data;\r\n+\t\tmbuf->data_off = m->data_off;\r\n \t\tmbuf->buf_physaddr = m->buf_physaddr;\r\n \t\tmbuf->buf_addr = m->buf_addr;\r\n \t}\r\n@@ -2819,8 +2822,8 @@ virtio_dev_tx_zcp(struct virtio_net *dev)\r\n \t\tm.data_len = desc->len;\r\n \t\tm.nb_segs = 1;\r\n \t\tm.next = NULL;\r\n-\t\tm.data = (void *)(uintptr_t)buff_addr;\r\n-\t\tm.buf_addr = m.data;\r\n+\t\tm.data_off = 0;\r\n+\t\tm.buf_addr = (void *)(uintptr_t)buff_addr;\r\n \t\tm.buf_physaddr = phys_addr;\r\n \r\n \t\t/*\r\ndiff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c\r\nindex 8162cd8..56ffec8 100644\r\n--- a/examples/vhost_xen/main.c\r\n+++ b/examples/vhost_xen/main.c\r\n@@ -808,7 +808,7 @@ virtio_tx_local(struct virtio_net *dev, struct rte_mbuf *m)\r\n \tstruct ether_hdr *pkt_hdr;\r\n \tuint64_t ret = 0;\r\n \r\n-\tpkt_hdr = (struct ether_hdr *)m->data;\r\n+\tpkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);\r\n \r\n \t/*get the used devices list*/\r\n \tdev_ll = ll_root_used;\r\n@@ -883,18 +883,20 @@ virtio_tx_route(struct virtio_net* dev, struct rte_mbuf *m, struct rte_mempool *\r\n \tmbuf->pkt_len = mbuf->data_len;\r\n \r\n \t/* Copy ethernet header to mbuf. */\r\n-\trte_memcpy((void*)mbuf->data, (const void*)m->data, ETH_HLEN);\r\n+\trte_memcpy(rte_pktmbuf_mtod(mbuf, void*),\r\n+\t\t\trte_pktmbuf_mtod(m, const void*), ETH_HLEN);\r\n \r\n \r\n \t/* Setup vlan header. Bytes need to be re-ordered for network with htons()*/\r\n-\tvlan_hdr = (struct vlan_ethhdr *) mbuf->data;\r\n+\tvlan_hdr = rte_pktmbuf_mtod(mbuf, struct vlan_ethhdr *);\r\n \tvlan_hdr->h_vlan_encapsulated_proto = vlan_hdr->h_vlan_proto;\r\n \tvlan_hdr->h_vlan_proto = htons(ETH_P_8021Q);\r\n \tvlan_hdr->h_vlan_TCI = htons(vlan_tag);\r\n \r\n \t/* Copy the remaining packet contents to the mbuf. */\r\n-\trte_memcpy((void*) ((uint8_t*)mbuf->data + VLAN_ETH_HLEN),\r\n-\t\t(const void*) ((uint8_t*)m->data + ETH_HLEN), (m->data_len - ETH_HLEN));\r\n+\trte_memcpy((void *)(rte_pktmbuf_mtod(mbuf, uint8_t *) + VLAN_ETH_HLEN),\r\n+\t\t(const void *)(rte_pktmbuf_mtod(m, uint8_t *) + ETH_HLEN),\r\n+\t\t(m->data_len - ETH_HLEN));\r\n \ttx_q->m_table[len] = mbuf;\r\n \tlen++;\r\n \tif (enable_stats) {\r\n@@ -981,7 +983,7 @@ virtio_dev_tx(struct virtio_net* dev, struct rte_mempool *mbuf_pool)\r\n \r\n \t\t/* Setup dummy mbuf. This is copied to a real mbuf if transmitted out the physical port. */\r\n \t\tm.data_len = desc->len;\r\n-\t\tm.data = (void*)(uintptr_t)buff_addr;\r\n+\t\tm.data_off = 0;\r\n \t\tm.nb_segs = 1;\r\n \r\n \t\tvirtio_tx_route(dev, &m, mbuf_pool, 0);\r\ndiff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c\r\nindex 6b9f07d..a4ed923 100644\r\n--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c\r\n+++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c\r\n@@ -109,7 +109,7 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in,\r\n \t/* Fragment size should be a multiply of 8. */\r\n \tIP_FRAG_ASSERT((frag_size & IPV4_HDR_FO_MASK) == 0);\r\n \r\n-\tin_hdr = (struct ipv4_hdr *) pkt_in->data;\r\n+\tin_hdr = rte_pktmbuf_mtod(pkt_in, struct ipv4_hdr *);\r\n \tflag_offset = rte_cpu_to_be_16(in_hdr->fragment_offset);\r\n \r\n \t/* If Don't Fragment flag is set */\r\n@@ -165,7 +165,7 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in,\r\n \t\t\tif (len > (in_seg->data_len - in_seg_data_pos)) {\r\n \t\t\t\tlen = in_seg->data_len - in_seg_data_pos;\r\n \t\t\t}\r\n-\t\t\tout_seg->data = (char*) in_seg->data + (uint16_t)in_seg_data_pos;\r\n+\t\t\tout_seg->data_off = in_seg->data_off + in_seg_data_pos;\r\n \t\t\tout_seg->data_len = (uint16_t)len;\r\n \t\t\tout_pkt->pkt_len = (uint16_t)(len +\r\n \t\t\t    out_pkt->pkt_len);\r\n@@ -188,7 +188,7 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in,\r\n \r\n \t\t/* Build the IP header */\r\n \r\n-\t\tout_hdr = (struct ipv4_hdr*) out_pkt->data;\r\n+\t\tout_hdr = rte_pktmbuf_mtod(out_pkt, struct ipv4_hdr *);\r\n \r\n \t\t__fill_ipv4hdr_frag(out_hdr, in_hdr,\r\n \t\t    (uint16_t)out_pkt->pkt_len,\r\ndiff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c\r\nindex e007662..4ffcc7c 100644\r\n--- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c\r\n+++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c\r\n@@ -125,7 +125,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,\r\n \t    (uint16_t)(pkt_in->pkt_len - sizeof (struct ipv6_hdr))))\r\n \t\treturn (-EINVAL);\r\n \r\n-\tin_hdr = (struct ipv6_hdr *) pkt_in->data;\r\n+\tin_hdr = rte_pktmbuf_mtod(pkt_in, struct ipv6_hdr *);\r\n \r\n \tin_seg = pkt_in;\r\n \tin_seg_data_pos = sizeof(struct ipv6_hdr);\r\n@@ -171,7 +171,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,\r\n \t\t\tif (len > (in_seg->data_len - in_seg_data_pos)) {\r\n \t\t\t\tlen = in_seg->data_len - in_seg_data_pos;\r\n \t\t\t}\r\n-\t\t\tout_seg->data = (char *) in_seg->data + (uint16_t) in_seg_data_pos;\r\n+\t\t\tout_seg->data_off = in_seg->data_off + in_seg_data_pos;\r\n \t\t\tout_seg->data_len = (uint16_t)len;\r\n \t\t\tout_pkt->pkt_len = (uint16_t)(len +\r\n \t\t\t    out_pkt->pkt_len);\r\n@@ -196,7 +196,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,\r\n \r\n \t\t/* Build the IP header */\r\n \r\n-\t\tout_hdr = (struct ipv6_hdr *) out_pkt->data;\r\n+\t\tout_hdr = rte_pktmbuf_mtod(out_pkt, struct ipv6_hdr *);\r\n \r\n \t\t__fill_ipv6hdr_frag(out_hdr, in_hdr,\r\n \t\t    (uint16_t) out_pkt->pkt_len - sizeof(struct ipv6_hdr),\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\r\nindex c1b2176..26e36eb 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.c\r\n+++ b/lib/librte_mbuf/rte_mbuf.c\r\n@@ -117,7 +117,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,\r\n \tm->buf_len = (uint16_t)buf_len;\r\n \r\n \t/* keep some headroom between start of buffer and data */\r\n-\tm->data = (char*) m->buf_addr + RTE_MIN(RTE_PKTMBUF_HEADROOM, m->buf_len);\r\n+\tm->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->buf_len);\r\n \r\n \t/* init some constant fields */\r\n \tm->pool = mp;\r\n@@ -183,12 +183,12 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)\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->data, (unsigned)m->data_len);\r\n+\t\t\tm, rte_pktmbuf_mtod(m, void *), (unsigned)m->data_len);\r\n \t\tlen = dump_len;\r\n \t\tif (len > m->data_len)\r\n \t\t\tlen = m->data_len;\r\n \t\tif (len != 0)\r\n-\t\t\trte_hexdump(f, NULL, m->data, len);\r\n+\t\t\trte_hexdump(f, NULL, rte_pktmbuf_mtod(m, void *), len);\r\n \t\tdump_len -= len;\r\n \t\tm = m->next;\r\n \t\tnb_segs --;\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex 32e8474..669e7f5 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -119,6 +119,13 @@ struct rte_mbuf {\r\n \tvoid *buf_addr;           /**< Virtual address of segment buffer. */\r\n \tphys_addr_t buf_physaddr; /**< Physical address of segment buffer. */\r\n \tuint16_t buf_len;         /**< Length of segment buffer. */\r\n+\r\n+\t/* valid for any segment */\r\n+\tstruct rte_mbuf *next;    /**< Next segment of scattered packet. */\r\n+\tuint16_t data_off;\r\n+\tuint16_t data_len;        /**< Amount of data in segment buffer. */\r\n+\tuint32_t pkt_len;         /**< Total pkt len: sum of all segments. */\r\n+\r\n #ifdef RTE_MBUF_REFCNT\r\n \t/**\r\n \t * 16-bit Reference counter.\r\n@@ -138,15 +145,9 @@ struct rte_mbuf {\r\n \tuint16_t reserved;            /**< Unused field. Required for padding */\r\n \tuint16_t ol_flags;            /**< Offload features. */\r\n \r\n-\t/* valid for any segment */\r\n-\tstruct rte_mbuf *next;  /**< Next segment of scattered packet. */\r\n-\tvoid* data;             /**< Start address of data in segment buffer. */\r\n-\tuint16_t data_len;      /**< Amount of data in segment buffer. */\r\n-\r\n \t/* these fields are valid for first segment only */\r\n \tuint8_t nb_segs;        /**< Number of segments. */\r\n \tuint8_t port;           /**< Input port. */\r\n-\tuint32_t pkt_len;       /**< Total pkt len: sum of all segment data_len. */\r\n \r\n \t/* offload features, valid for first segment only */\r\n \tuint16_t l3_len:9;      /**< L3 (IP) Header Length. */\r\n@@ -166,7 +167,7 @@ struct rte_mbuf {\r\n \t\tuint16_t metadata16[0];\r\n \t\tuint32_t metadata32[0];\r\n \t\tuint64_t metadata64[0];\r\n-\t};\r\n+\t} __rte_cache_aligned;\r\n } __rte_cache_aligned;\r\n \r\n #define RTE_MBUF_METADATA_UINT8(mbuf, offset)              \\\r\n@@ -452,7 +453,7 @@ void rte_ctrlmbuf_init(struct rte_mempool *mp, void *opaque_arg,\r\n  * @param m\r\n  *   The control mbuf.\r\n  */\r\n-#define rte_ctrlmbuf_data(m) ((m)->data)\r\n+#define rte_ctrlmbuf_data(m) ((char *)((m)->buf_addr) + (m)->data_off)\r\n \r\n /**\r\n  * A macro that returns the length of the carried data.\r\n@@ -517,8 +518,6 @@ void rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaque_arg);\r\n  */\r\n static inline void rte_pktmbuf_reset(struct rte_mbuf *m)\r\n {\r\n-\tuint32_t buf_ofs;\r\n-\r\n \tm->next = NULL;\r\n \tm->pkt_len = 0;\r\n \tm->l2_len = 0;\r\n@@ -528,9 +527,8 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)\r\n \tm->port = 0xff;\r\n \r\n \tm->ol_flags = 0;\r\n-\tbuf_ofs = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?\r\n+\tm->data_off = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?\r\n \t\t\tRTE_PKTMBUF_HEADROOM : m->buf_len;\r\n-\tm->data = (char*) m->buf_addr + buf_ofs;\r\n \r\n \tm->data_len = 0;\r\n \t__rte_mbuf_sanity_check(m, 1);\r\n@@ -587,7 +585,7 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *md)\r\n \tmi->buf_len = md->buf_len;\r\n \r\n \tmi->next = md->next;\r\n-\tmi->data = md->data;\r\n+\tmi->data_off = md->data_off;\r\n \tmi->data_len = md->data_len;\r\n \tmi->port = md->port;\r\n \tmi->vlan_tci = md->vlan_tci;\r\n@@ -618,16 +616,14 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)\r\n {\r\n \tconst struct rte_mempool *mp = m->pool;\r\n \tvoid *buf = RTE_MBUF_TO_BADDR(m);\r\n-\tuint32_t buf_ofs;\r\n \tuint32_t buf_len = mp->elt_size - sizeof(*m);\r\n \tm->buf_physaddr = rte_mempool_virt2phy(mp, m) + sizeof (*m);\r\n \r\n \tm->buf_addr = buf;\r\n \tm->buf_len = (uint16_t)buf_len;\r\n \r\n-\tbuf_ofs = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?\r\n+\tm->data_off = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?\r\n \t\t\tRTE_PKTMBUF_HEADROOM : m->buf_len;\r\n-\tm->data = (char*) m->buf_addr + buf_ofs;\r\n \r\n \tm->data_len = 0;\r\n }\r\n@@ -791,7 +787,7 @@ static inline void rte_pktmbuf_refcnt_update(struct rte_mbuf *m, int16_t v)\r\n static inline uint16_t rte_pktmbuf_headroom(const struct rte_mbuf *m)\r\n {\r\n \t__rte_mbuf_sanity_check(m, 1);\r\n-\treturn (uint16_t) ((char*) m->data - (char*) m->buf_addr);\r\n+\treturn m->data_off;\r\n }\r\n \r\n /**\r\n@@ -839,7 +835,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)\r\n  * @param t\r\n  *   The type to cast the result into.\r\n  */\r\n-#define rte_pktmbuf_mtod(m, t) ((t)((m)->data))\r\n+#define rte_pktmbuf_mtod(m, t) ((t)((char *)(m)->buf_addr + (m)->data_off))\r\n \r\n /**\r\n  * A macro that returns the length of the packet.\r\n@@ -884,11 +880,11 @@ static inline char *rte_pktmbuf_prepend(struct rte_mbuf *m,\r\n \tif (unlikely(len > rte_pktmbuf_headroom(m)))\r\n \t\treturn NULL;\r\n \r\n-\tm->data = (char*) m->data - len;\r\n+\tm->data_off -= len;\r\n \tm->data_len = (uint16_t)(m->data_len + len);\r\n \tm->pkt_len  = (m->pkt_len + len);\r\n \r\n-\treturn (char*) m->data;\r\n+\treturn (char*) m->buf_addr + m->data_off;\r\n }\r\n \r\n /**\r\n@@ -917,7 +913,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len)\r\n \tif (unlikely(len > rte_pktmbuf_tailroom(m_last)))\r\n \t\treturn NULL;\r\n \r\n-\ttail = (char*) m_last->data + m_last->data_len;\r\n+\ttail = (char*) m_last->buf_addr + m_last->data_off + m_last->data_len;\r\n \tm_last->data_len = (uint16_t)(m_last->data_len + len);\r\n \tm->pkt_len  = (m->pkt_len + len);\r\n \treturn (char*) tail;\r\n@@ -945,9 +941,9 @@ static inline char *rte_pktmbuf_adj(struct rte_mbuf *m, uint16_t len)\r\n \t\treturn NULL;\r\n \r\n \tm->data_len = (uint16_t)(m->data_len - len);\r\n-\tm->data = ((char*) m->data + len);\r\n+\tm->data_off += len;\r\n \tm->pkt_len  = (m->pkt_len - len);\r\n-\treturn (char*) m->data;\r\n+\treturn (char *)m->buf_addr + m->data_off;\r\n }\r\n \r\n /**\r\ndiff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c\r\nindex 5979ce5..506a448 100644\r\n--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c\r\n+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c\r\n@@ -198,14 +198,14 @@ xmit_slave_hash(const struct rte_mbuf *buf, uint8_t slave_count, uint8_t policy)\r\n \r\n \tswitch (policy) {\r\n \tcase BALANCE_XMIT_POLICY_LAYER2:\r\n-\t\teth_hdr = (struct ether_hdr *)buf->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(buf, struct ether_hdr *);\r\n \r\n \t\thash = ether_hash(eth_hdr);\r\n \t\thash ^= hash >> 8;\r\n \t\treturn hash % slave_count;\r\n \r\n \tcase BALANCE_XMIT_POLICY_LAYER23:\r\n-\t\teth_hdr = (struct ether_hdr *)buf->data;\r\n+\t\teth_hdr = rte_pktmbuf_mtod(buf, struct ether_hdr *);\r\n \r\n \t\tif (buf->ol_flags & PKT_RX_VLAN_PKT)\r\n \t\t\teth_offset = sizeof(struct ether_hdr) + sizeof(struct vlan_hdr);\r\ndiff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c\r\nindex 4f46bdf..67736d6 100644\r\n--- a/lib/librte_pmd_e1000/em_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/em_rxtx.c\r\n@@ -90,8 +90,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n }\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR(mb)             \\\r\n-\t(uint64_t) ((mb)->buf_physaddr +       \\\r\n-\t(uint64_t) ((char *)((mb)->data) - (char *)(mb)->buf_addr))\r\n+\t(uint64_t) ((mb)->buf_physaddr + (mb)->data_off)\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb) \\\r\n \t(uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)\r\n@@ -793,8 +792,8 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t */\r\n \t\tpkt_len = (uint16_t) (rte_le_to_cpu_16(rxd.length) -\r\n \t\t\t\trxq->crc_len);\r\n-\t\trxm->data = (char*) rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n-\t\trte_packet_prefetch(rxm->data);\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n+\t\trte_packet_prefetch((char *)rxm->buf_addr + rxm->data_off);\r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = pkt_len;\r\n@@ -963,7 +962,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t */\r\n \t\tdata_len = rte_le_to_cpu_16(rxd.length);\r\n \t\trxm->data_len = data_len;\r\n-\t\trxm->data = (char*) rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\t/*\r\n \t\t * If this is the first buffer of the received packet,\r\n@@ -1035,7 +1034,8 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\trxm->vlan_tci = rte_le_to_cpu_16(rxd.special);\r\n \r\n \t\t/* Prefetch data of first segment, if configured to do so. */\r\n-\t\trte_packet_prefetch(first_seg->data);\r\n+\t\trte_packet_prefetch((char *)first_seg->buf_addr +\r\n+\t\t\tfirst_seg->data_off);\r\n \r\n \t\t/*\r\n \t\t * Store the mbuf address into the next entry of the array\r\ndiff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c\r\nindex 4e9f42e..e364dda 100644\r\n--- a/lib/librte_pmd_e1000/igb_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/igb_rxtx.c\r\n@@ -95,9 +95,7 @@ rte_rxmbuf_alloc(struct rte_mempool *mp)\r\n }\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR(mb) \\\r\n-\t(uint64_t) ((mb)->buf_physaddr +\t\t   \\\r\n-\t\t\t(uint64_t) ((char *)((mb)->data) -     \\\r\n-\t\t\t\t(char *)(mb)->buf_addr))\r\n+\t(uint64_t) ((mb)->buf_physaddr + (mb)->data_off)\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb) \\\r\n \t(uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)\r\n@@ -776,8 +774,8 @@ eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t */\r\n \t\tpkt_len = (uint16_t) (rte_le_to_cpu_16(rxd.wb.upper.length) -\r\n \t\t\t\t      rxq->crc_len);\r\n-\t\trxm->data = (char*) rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n-\t\trte_packet_prefetch(rxm->data);\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n+\t\trte_packet_prefetch((char *)rxm->buf_addr + rxm->data_off);\r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = pkt_len;\r\n@@ -952,7 +950,7 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t */\r\n \t\tdata_len = rte_le_to_cpu_16(rxd.wb.upper.length);\r\n \t\trxm->data_len = data_len;\r\n-\t\trxm->data = (char*) rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\t/*\r\n \t\t * If this is the first buffer of the received packet,\r\n@@ -1033,7 +1031,8 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\tfirst_seg->ol_flags = pkt_flags;\r\n \r\n \t\t/* Prefetch data of first segment, if configured to do so. */\r\n-\t\trte_packet_prefetch(first_seg->data);\r\n+\t\trte_packet_prefetch((char *)first_seg->buf_addr +\r\n+\t\t\tfirst_seg->data_off);\r\n \r\n \t\t/*\r\n \t\t * Store the mbuf address into the next entry of the array\r\ndiff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c\r\nindex e41e8d0..25a5f6f 100644\r\n--- a/lib/librte_pmd_i40e/i40e_rxtx.c\r\n+++ b/lib/librte_pmd_i40e/i40e_rxtx.c\r\n@@ -78,9 +78,7 @@\r\n \t(uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR(mb) \\\r\n-\t((uint64_t)((mb)->buf_physaddr + \\\r\n-\t(uint64_t)((char *)((mb)->data) - \\\r\n-\t(char *)(mb)->buf_addr)))\r\n+\t((uint64_t)((mb)->buf_physaddr + (mb)->data_off))\r\n \r\n static const struct rte_memzone *\r\n i40e_ring_dma_zone_reserve(struct rte_eth_dev *dev,\r\n@@ -685,7 +683,7 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)\r\n \t\tmb = rxep[i].mbuf;\r\n \t\trte_mbuf_refcnt_set(mb, 1);\r\n \t\tmb->next = NULL;\r\n-\t\tmb->data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\tmb->data_off = RTE_PKTMBUF_HEADROOM;\r\n \t\tmb->nb_segs = 1;\r\n \t\tmb->port = rxq->port_id;\r\n \t\tdma_addr = rte_cpu_to_le_64(\\\r\n@@ -842,8 +840,8 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\trx_packet_len = ((qword1 & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>\r\n \t\t\t\tI40E_RXD_QW1_LENGTH_PBUF_SHIFT) - rxq->crc_len;\r\n \r\n-\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n-\t\trte_prefetch0(rxm->data);\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n+\t\trte_prefetch0(RTE_PTR_ADD(rxm->buf_addr, RTE_PKTMBUF_HEADROOM));\r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = rx_packet_len;\r\n@@ -946,7 +944,7 @@ i40e_recv_scattered_pkts(void *rx_queue,\r\n \t\trx_packet_len = (qword1 & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>\r\n \t\t\t\t\tI40E_RXD_QW1_LENGTH_PBUF_SHIFT;\r\n \t\trxm->data_len = rx_packet_len;\r\n-\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\t/**\r\n \t\t * If this is the first buffer of the received packet, set the\r\n@@ -1015,7 +1013,8 @@ i40e_recv_scattered_pkts(void *rx_queue,\r\n \t\t\t\trte_le_to_cpu_32(rxd.wb.qword0.hi_dword.rss);\r\n \r\n \t\t/* Prefetch data of first segment, if configured to do so. */\r\n-\t\trte_prefetch0(first_seg->data);\r\n+\t\trte_prefetch0(RTE_PTR_ADD(first_seg->buf_addr,\r\n+\t\t\tfirst_seg->data_off));\r\n \t\trx_pkts[nb_rx++] = first_seg;\r\n \t\tfirst_seg = NULL;\r\n \t}\r\n@@ -2131,7 +2130,7 @@ i40e_alloc_rx_queue_mbufs(struct i40e_rx_queue *rxq)\r\n \r\n \t\trte_mbuf_refcnt_set(mbuf, 1);\r\n \t\tmbuf->next = NULL;\r\n-\t\tmbuf->data = (char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\tmbuf->data_off = RTE_PKTMBUF_HEADROOM;\r\n \t\tmbuf->nb_segs = 1;\r\n \t\tmbuf->port = rxq->port_id;\r\n \r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\nindex b897b1e..964ae06 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n@@ -998,7 +998,7 @@ ixgbe_rx_alloc_bufs(struct igb_rx_queue *rxq)\r\n \t\tmb = rxep[i].mbuf;\r\n \t\trte_mbuf_refcnt_set(mb, 1);\r\n \t\tmb->next = NULL;\r\n-\t\tmb->data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\tmb->data_off = RTE_PKTMBUF_HEADROOM;\r\n \t\tmb->nb_segs = 1;\r\n \t\tmb->port = rxq->port_id;\r\n \r\n@@ -1249,8 +1249,8 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t */\r\n \t\tpkt_len = (uint16_t) (rte_le_to_cpu_16(rxd.wb.upper.length) -\r\n \t\t\t\t      rxq->crc_len);\r\n-\t\trxm->data = (char*) rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n-\t\trte_packet_prefetch(rxm->data);\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n+\t\trte_packet_prefetch((char *)rxm->buf_addr + rxm->data_off);\r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = pkt_len;\r\n@@ -1432,7 +1432,7 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t */\r\n \t\tdata_len = rte_le_to_cpu_16(rxd.wb.upper.length);\r\n \t\trxm->data_len = data_len;\r\n-\t\trxm->data = (char*) rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\t/*\r\n \t\t * If this is the first buffer of the received packet,\r\n@@ -1523,7 +1523,8 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t}\r\n \r\n \t\t/* Prefetch data of first segment, if configured to do so. */\r\n-\t\trte_packet_prefetch(first_seg->data);\r\n+\t\trte_packet_prefetch((char *)first_seg->buf_addr +\r\n+\t\t\tfirst_seg->data_off);\r\n \r\n \t\t/*\r\n \t\t * Store the mbuf address into the next entry of the array\r\n@@ -3213,7 +3214,7 @@ ixgbe_alloc_rx_queue_mbufs(struct igb_rx_queue *rxq)\r\n \r\n \t\trte_mbuf_refcnt_set(mbuf, 1);\r\n \t\tmbuf->next = NULL;\r\n-\t\tmbuf->data = (char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\tmbuf->data_off = RTE_PKTMBUF_HEADROOM;\r\n \t\tmbuf->nb_segs = 1;\r\n \t\tmbuf->port = rxq->port_id;\r\n \r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\nindex 2f1f40c..38a3a03 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\n@@ -47,8 +47,7 @@\r\n #endif\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR(mb) \\\r\n-\t(uint64_t) ((mb)->buf_physaddr + (uint64_t)((char *)((mb)->data) - \\\r\n-\t(char *)(mb)->buf_addr))\r\n+\t(uint64_t) ((mb)->buf_physaddr + (mb)->data_off)\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb) \\\r\n \t(uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)\r\ndiff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c\r\nindex 121de65..e60982e 100644\r\n--- a/lib/librte_pmd_pcap/rte_eth_pcap.c\r\n+++ b/lib/librte_pmd_pcap/rte_eth_pcap.c\r\n@@ -151,7 +151,8 @@ eth_pcap_rx(void *queue,\r\n \r\n \t\tif (header.len <= buf_size) {\r\n \t\t\t/* pcap packet will fit in the mbuf, go ahead and copy */\r\n-\t\t\trte_memcpy(mbuf->data, packet, header.len);\r\n+\t\t\trte_memcpy(rte_pktmbuf_mtod(mbuf, void *), packet,\r\n+\t\t\t\t\theader.len);\r\n \t\t\tmbuf->data_len = (uint16_t)header.len;\r\n \t\t\tmbuf->pkt_len = mbuf->data_len;\r\n \t\t\tbufs[num_rx] = mbuf;\r\n@@ -202,7 +203,8 @@ eth_pcap_tx_dumper(void *queue,\r\n \t\tcalculate_timestamp(&header.ts);\r\n \t\theader.len = mbuf->data_len;\r\n \t\theader.caplen = header.len;\r\n-\t\tpcap_dump((u_char*) dumper_q->dumper, &header, mbuf->data);\r\n+\t\tpcap_dump((u_char*) dumper_q->dumper, &header,\r\n+\t\t\t\trte_pktmbuf_mtod(mbuf, void*));\r\n \t\trte_pktmbuf_free(mbuf);\r\n \t\tnum_tx++;\r\n \t}\r\n@@ -237,7 +239,8 @@ eth_pcap_tx(void *queue,\r\n \r\n \tfor (i = 0; i < nb_pkts; i++) {\r\n \t\tmbuf = bufs[i];\r\n-\t\tret = pcap_sendpacket(tx_queue->pcap, (u_char*) mbuf->data,\r\n+\t\tret = pcap_sendpacket(tx_queue->pcap,\r\n+\t\t\t\trte_pktmbuf_mtod(mbuf, u_char *),\r\n \t\t\t\tmbuf->data_len);\r\n \t\tif (unlikely(ret != 0))\r\n \t\t\tbreak;\r\ndiff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c\r\nindex 132ee45..29c9cea 100644\r\n--- a/lib/librte_pmd_virtio/virtio_rxtx.c\r\n+++ b/lib/librte_pmd_virtio/virtio_rxtx.c\r\n@@ -118,7 +118,7 @@ virtqueue_dequeue_burst_rx(struct virtqueue *vq, struct rte_mbuf **rx_pkts,\r\n \t\t}\r\n \r\n \t\trte_prefetch0(cookie);\r\n-\t\trte_packet_prefetch(cookie->data);\r\n+\t\trte_packet_prefetch(rte_pktmbuf_mtod(cookie, void *));\r\n \t\trx_pkts[i]  = cookie;\r\n \t\tvq->vq_used_cons_idx++;\r\n \t\tvq_ring_free_chain(vq, desc_idx);\r\n@@ -480,7 +480,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\t}\r\n \r\n \t\trxm->port = rxvq->port_id;\r\n-\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->next = NULL;\r\n@@ -584,7 +584,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,\r\n \t\tif (seg_num == 0)\r\n \t\t\tseg_num = 1;\r\n \r\n-\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \t\trxm->nb_segs = seg_num;\r\n \t\trxm->next = NULL;\r\n \t\trxm->pkt_len = (uint32_t)(len[0] - hdr_size);\r\n@@ -622,9 +622,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,\r\n \t\t\twhile (extra_idx < rcv_cnt) {\r\n \t\t\t\trxm = rcv_pkts[extra_idx];\r\n \r\n-\t\t\t\trxm->data =\r\n-\t\t\t\t\t(char *)rxm->buf_addr +\r\n-\t\t\t\t\tRTE_PKTMBUF_HEADROOM - hdr_size;\r\n+\t\t\t\trxm->data_off = RTE_PKTMBUF_HEADROOM - hdr_size;\r\n \t\t\t\trxm->next = NULL;\r\n \t\t\t\trxm->pkt_len = (uint32_t)(len[extra_idx]);\r\n \t\t\t\trxm->data_len = (uint16_t)(len[extra_idx]);\r\ndiff --git a/lib/librte_pmd_virtio/virtqueue.h b/lib/librte_pmd_virtio/virtqueue.h\r\nindex d777feb..fdee054 100644\r\n--- a/lib/librte_pmd_virtio/virtqueue.h\r\n+++ b/lib/librte_pmd_virtio/virtqueue.h\r\n@@ -59,8 +59,7 @@\r\n #define VIRTQUEUE_MAX_NAME_SZ 32\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR(mb) \\\r\n-\t(uint64_t) ((mb)->buf_physaddr + (uint64_t)((char *)((mb)->data) - \\\r\n-\t(char *)(mb)->buf_addr))\r\n+\t(uint64_t) ((mb)->buf_physaddr + (mb)->data_off)\r\n \r\n #define VTNET_SQ_RQ_QUEUE_IDX 0\r\n #define VTNET_SQ_TQ_QUEUE_IDX 1\r\ndiff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\nindex e74b6fd..263f9ce 100644\r\n--- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n+++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n@@ -79,8 +79,7 @@\r\n \r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR(mb) \\\r\n-\t(uint64_t) ((mb)->buf_physaddr + (uint64_t)((char *)((mb)->data) - \\\r\n-\t(char *)(mb)->buf_addr))\r\n+\t(uint64_t) ((mb)->buf_physaddr + (mb)->data_off)\r\n \r\n #define RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb) \\\r\n \t(uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM)\r\n@@ -565,7 +564,7 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\t\trxm->data_len = (uint16_t)rcd->len;\r\n \t\t\trxm->port = rxq->port_id;\r\n \t\t\trxm->vlan_tci = 0;\r\n-\t\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\t\trx_pkts[nb_rx++] = rxm;\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 22215ed..891cb58 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@@ -110,7 +110,7 @@ eth_xenvirt_rx(void *q, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\trxm = rx_pkts[i];\r\n \t\tPMD_RX_LOG(DEBUG, \"packet len:%d\\n\", len[i]);\r\n \t\trxm->next = NULL;\r\n-\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n+\t\trxm->data_off = RTE_PKTMBUF_HEADROOM;\r\n \t\trxm->data_len = (uint16_t)(len[i] - sizeof(struct virtio_net_hdr));\r\n \t\trxm->nb_segs = 1;\r\n \t\trxm->port = pi->port_id;\r\n",
    "prefixes": [
        "dpdk-dev",
        "01/13"
    ]
}