app/testpmd: fix L4 checksum in multi-segments
[dpdk.git] / app / test / test_bitratestats.c
index fb4203c..1ff540f 100644 (file)
@@ -11,6 +11,7 @@
 #include <rte_memzone.h>
 #include <rte_metrics.h>
 #include <rte_bitrate.h>
+#include <rte_ethdev.h>
 
 #include "sample_packet_forward.h"
 #include "test.h"
@@ -32,12 +33,14 @@ test_stats_bitrate_create(void)
        return TEST_SUCCESS;
 }
 
-/* To test free the resources from bitrate_reg test */
+/* To test free the resources from bitrate_create test */
 static int
 test_stats_bitrate_free(void)
 {
        int ret = 0;
 
+       rte_stats_bitrate_free(bitrate_data);
+
        ret = rte_metrics_deinit();
        TEST_ASSERT(ret >= 0, "Test Failed: rte_metrics_deinit failed");
 
@@ -157,12 +160,21 @@ test_bit_packet_forward(void)
                printf("allocate mbuf pool Failed\n");
                return TEST_FAILED;
        }
+       ret = test_dev_start(portid, mp);
+       if (ret < 0) {
+               printf("test_dev_start(%hu, %p) failed, error code: %d\n",
+                       portid, mp, ret);
+               return TEST_FAILED;
+       }
+
        ret = test_packet_forward(pbuf, portid, QUEUE_ID);
        if (ret < 0)
                printf("send pkts Failed\n");
+
+       rte_eth_dev_stop(portid);
        test_put_mbuf_to_pool(mp, pbuf);
 
-       return TEST_SUCCESS;
+       return (ret >= 0) ? TEST_SUCCESS : TEST_FAILED;
 }
 
 static int