X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_table_acl.c;h=e4e9b9cbba242272359616aaeb863b1276095080;hb=edef7d1f4d93de5cff595a0ce26e4b02f8a9f7cc;hp=4db680a6a6d14a0cb2ebd1d822cd6aee6ff1ba7e;hpb=ea672a8b1655bbb44876d2550ff56f384968a43b;p=dpdk.git diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index 4db680a6a6..e4e9b9cbba 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -513,7 +513,12 @@ test_pipeline_single_filter(int expected_count) struct rte_mbuf *mbuf; mbuf = rte_pktmbuf_alloc(pool); - memset(mbuf->data, 0x00, + if (mbuf == NULL) + /* this will cause test failure after cleanup + * of already enqueued mbufs, as the mbuf + * counts won't match */ + break; + memset(rte_pktmbuf_mtod(mbuf, char *), 0x00, sizeof(struct ipv4_5tuple)); five_tuple.proto = j; @@ -522,7 +527,7 @@ test_pipeline_single_filter(int expected_count) five_tuple.port_src = rte_bswap16(100 + j); five_tuple.port_dst = rte_bswap16(200 + j); - memcpy(mbuf->data, &five_tuple, + memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", __func__, i); @@ -549,7 +554,8 @@ test_pipeline_single_filter(int expected_count) printf("Got %d object(s) from ring %d!\n", ret, i); for (j = 0; j < ret; j++) { mbuf = (struct rte_mbuf *)objs[j]; - rte_hexdump(stdout, "mbuf", mbuf->data, 64); + rte_hexdump(stdout, "mbuf", + rte_pktmbuf_mtod(mbuf, char *), 64); rte_pktmbuf_free(mbuf); } tx_count += ret;