diff options
| author | zhengchao <[email protected]> | 2016-11-18 18:44:52 +0800 |
|---|---|---|
| committer | zhengchao <[email protected]> | 2016-11-18 18:44:52 +0800 |
| commit | 6da5e6f93bc47777c4210431da5213c9354490f0 (patch) | |
| tree | 5b1ae2608eef01d329a3923efd42ce6d0cc943fc /test | |
| parent | 8028cd21e1774148255f72c9fd89672ba3302eee (diff) | |
重写mr_buffer.c,实现带ctrl_zone的私有控制域。
Diffstat (limited to 'test')
| -rw-r--r-- | test/TestMrbuf.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/TestMrbuf.cc b/test/TestMrbuf.cc index 1336b30..2616d94 100644 --- a/test/TestMrbuf.cc +++ b/test/TestMrbuf.cc @@ -7,19 +7,19 @@ static struct rte_mempool * g_pktmbuf_pool = NULL; static void marsio_mbuf_test(void) { #define BATCH_TEST_NUM (32) - marsio_buf_t *mbuf, *mnext; + marsio_buff_t *mbuf, *mnext; struct rte_mbuf *rbuf; char *data; char *pri_data = (char *)"test ctrlzone"; uint32_t pkt_len; int ctrl_id = -1, i; - marsio_buf_t *batch_mbuf[BATCH_TEST_NUM]; + marsio_buff_t *batch_mbuf[BATCH_TEST_NUM]; ctrl_id = marsio_buf_ctrlzone_alloc_id(); while (1) { printf("ctrl_id = %u\n", ctrl_id); - mbuf = marsio_buf_alloc(); + mbuf = marsio_buff_alloc(); rbuf = (struct rte_mbuf *)mbuf; marsio_buf_batch_alloc(batch_mbuf, BATCH_TEST_NUM); @@ -28,25 +28,25 @@ static void marsio_mbuf_test(void) printf("tailroom = %u\n", marsio_buf_tailroom(mbuf)); printf("bufaddr-buf = %ld\n", (char *)rbuf->buf_addr - (char *)rbuf); - data = marsio_buf_mtod(mbuf); - pkt_len = marsio_buf_pkt_len(mbuf); + data = marsio_buff_mtod(mbuf); + pkt_len = marsio_buff_pkt_len(mbuf); printf("init pkt_len = %u\n", pkt_len); - marsio_buf_prepend(mbuf, 20); - pkt_len = marsio_buf_pkt_len(mbuf); + marsio_buff_prepend(mbuf, 20); + pkt_len = marsio_buff_pkt_len(mbuf); printf("after prepend, pkt_len = %u\n", pkt_len); marsio_buf_append(mbuf, 100); - pkt_len = marsio_buf_pkt_len(mbuf); + pkt_len = marsio_buff_pkt_len(mbuf); printf("after append, pkt_len = %u\n", pkt_len); marsio_buf_trim(mbuf, 60); - pkt_len = marsio_buf_pkt_len(mbuf); + pkt_len = marsio_buff_pkt_len(mbuf); printf("after trim, pkt_len = %u\n", pkt_len); printf("tailroom = %u\n", marsio_buf_tailroom(mbuf)); - mnext = marsio_buf_alloc(); + mnext = marsio_buff_alloc(); marsio_buf_append_pkt(mbuf, mnext); printf("next is :%p\n", marsio_buf_get_nextpkt(mbuf)); @@ -70,11 +70,11 @@ static void marsio_mbuf_test(void) #endif marsio_buf_batch_free(batch_mbuf, BATCH_TEST_NUM); - marsio_buf_free(mnext); + marsio_buff_free(mnext); marsio_buf_dup(mbuf); - marsio_buf_free(mbuf); - marsio_buf_free(mbuf); + marsio_buff_free(mbuf); + marsio_buff_free(mbuf); sleep(1); printf("\n ---------------------------------------------------- \n"); |
