X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_kni.c;h=7243ade100cf5c385b60f0d07f257b2c96169d86;hb=7a7122edf1c8d63e516d1b2c2eff6fa9b54e0f82;hp=608901d3ca54d713be028355603869cef9dfcda3;hpb=0c6bc8ef70ba3f3043d3fbd25cc535a4f1b8098d;p=dpdk.git diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 608901d3ca..7243ade100 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -47,8 +47,7 @@ #define NB_MBUF 8192 #define MAX_PACKET_SZ 2048 -#define MBUF_SZ \ - (MAX_PACKET_SZ + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) +#define MBUF_DATA_SZ (MAX_PACKET_SZ + RTE_PKTMBUF_HEADROOM) #define PKT_BURST_SZ 32 #define MEMPOOL_CACHE_SZ PKT_BURST_SZ #define SOCKET 0 @@ -118,17 +117,10 @@ test_kni_create_mempool(void) mp = rte_mempool_lookup("kni_mempool"); if (!mp) - mp = rte_mempool_create("kni_mempool", + mp = rte_pktmbuf_pool_create("kni_mempool", NB_MBUF, - MBUF_SZ, - MEMPOOL_CACHE_SZ, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, - NULL, - rte_pktmbuf_init, - NULL, - SOCKET, - 0); + MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, + SOCKET); return mp; } @@ -245,7 +237,7 @@ test_kni_allocate_lcores(void) } printf("count: %u\n", count); - return (count == 2 ? 0 : -1); + return count == 2 ? 0 : -1; } static int @@ -406,17 +398,6 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp) printf("fail to create kni\n"); return -1; } - if (rte_kni_get_port_id(kni) != port_id) { - printf("fail to get port id\n"); - ret = -1; - goto fail_kni; - } - - if (rte_kni_info_get(RTE_MAX_ETHPORTS)) { - printf("Unexpectedly get a KNI successfully\n"); - ret = -1; - goto fail_kni; - } test_kni_ctx = kni; test_kni_processing_flag = 0; @@ -599,14 +580,6 @@ test_kni(void) goto fail; } - /* test of getting port id according to NULL kni context */ - if (rte_kni_get_port_id(NULL) < RTE_MAX_ETHPORTS) { - ret = -1; - printf("unexpectedly get port id successfully by NULL kni " - "pointer\n"); - goto fail; - } - /* test of releasing NULL kni context */ ret = rte_kni_release(NULL); if (ret == 0) { @@ -652,23 +625,6 @@ test_kni(void) "a never used name string\n"); goto fail; } - - /* test the interface of creating a KNI, for backward compatibility */ - memset(&ops, 0, sizeof(ops)); - ops = kni_ops; - kni = rte_kni_create(port_id, MAX_PACKET_SZ, mp, &ops); - if (!kni) { - ret = -1; - printf("Fail to create a KNI device for port %d\n", port_id); - goto fail; - } - - ret = rte_kni_release(kni); - if (ret < 0) { - printf("Fail to release a KNI device\n"); - goto fail; - } - ret = 0; fail: