From: Intel Date: Mon, 3 Jun 2013 00:00:00 +0000 (+0000) Subject: app: add a test on mbuf alignment X-Git-Tag: spdx-start~11201 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a8afb5e2806ea887909edd493e64b8320ac32a68;p=dpdk.git app: add a test on mbuf alignment Signed-off-by: Intel --- 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