diff options
author | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-04-16 16:03:37 +0100 |
---|---|---|
committer | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-04-23 21:06:11 +0100 |
commit | afc919408d5990745e5ea373c8394f8df36a83e8 (patch) | |
tree | e2213d6da0ad422613a3186d2a880e7f2f42d0a6 | |
parent | 97a22cbc86d87b9ec113113386a29604bdcb812b (diff) |
pool: associate raw and timeout buffers with RTE_MBUF_CTRL type
Packet buffers remain the same. Save the ODP type as well.
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
-rw-r--r-- | platform/linux-dpdk/odp_pool.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_pool.c index 7a78bd05f..250da8e0a 100644 --- a/platform/linux-dpdk/odp_pool.c +++ b/platform/linux-dpdk/odp_pool.c @@ -161,25 +161,26 @@ odp_dpdk_mbuf_ctor(struct rte_mempool *mp, mb->buf_len = mb_ctor_arg->seg_buf_size; /* keep some headroom between start of buffer and data */ - if (mb_ctor_arg->type == ODP_POOL_PACKET) + if (mb_ctor_arg->type == ODP_POOL_PACKET) { + mb->type = RTE_MBUF_PKT; mb->pkt.data = (char *)mb->buf_addr + ODP_CONFIG_PACKET_HEADROOM; - else - mb->pkt.data = mb->buf_addr; + mb->pkt.nb_segs = 1; + mb->pkt.in_port = 0xff; + } else { + mb->type = RTE_MBUF_CTRL; + mb->ctrl.data = mb->buf_addr; + } /* init some constant fields */ - mb->type = RTE_MBUF_PKT; mb->pool = mp; - mb->pkt.nb_segs = 1; - mb->pkt.in_port = 0xff; mb->ol_flags = 0; - mb->pkt.vlan_macip.data = 0; - mb->pkt.hash.rss = 0; /* Save index, might be useful for debugging purposes */ buf_hdr = (struct odp_buffer_hdr_t *)raw_mbuf; buf_hdr->index = i; buf_hdr->pool_hdl = mbp_ctor_arg->pool_hdl; + buf_hdr->type = mb_ctor_arg->type; } #define CHECK_U16_OVERFLOW(X) do { \ |