From a8afb5e2806ea887909edd493e64b8320ac32a68 Mon Sep 17 00:00:00 2001 From: Intel Date: Mon, 3 Jun 2013 00:00:00 +0000 Subject: [PATCH] app: add a test on mbuf alignment Signed-off-by: Intel --- app/test/test_mbuf.c | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 24b6895be0..3efad0fae8 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -458,7 +458,59 @@ test_pktmbuf_pool(void) return ret; } +/* + * test that the pointer to the data on a packet mbuf is set properly + */ +static int +test_pktmbuf_pool_ptr(void) +{ + unsigned i; + struct rte_mbuf *m[NB_MBUF]; + int ret = 0; + + for (i=0; ipkt.data = RTE_PTR_ADD(m[i]->pkt.data, 64); + } + + /* free them */ + for (i=0; ipkt.data != RTE_PTR_ADD(m[i]->buf_addr, RTE_PKTMBUF_HEADROOM)) { + printf ("pkt.data pointer not set properly\n"); + ret = -1; + } + } + /* free them */ + for (i=0; i