test/crypto: remove illegal PMD header include
[dpdk.git] / app / test / test_pmd_ring.c
index 6414bbd..86b1db2 100644 (file)
@@ -24,6 +24,7 @@ test_ethdev_configure_port(int port)
 {
        struct rte_eth_conf null_conf;
        struct rte_eth_link link;
+       int ret;
 
        memset(&null_conf, 0, sizeof(struct rte_eth_conf));
 
@@ -54,7 +55,12 @@ test_ethdev_configure_port(int port)
                return -1;
        }
 
-       rte_eth_link_get(port, &link);
+       ret = rte_eth_link_get(port, &link);
+       if (ret < 0) {
+               printf("Link get failed for port %u: %s",
+                      port, rte_strerror(-ret));
+               return -1;
+       }
 
        return 0;
 }
@@ -219,6 +225,7 @@ test_pmd_ring_pair_create_attach(void)
        struct rte_eth_stats stats, stats2;
        struct rte_mbuf buf, *pbuf = &buf;
        struct rte_eth_conf null_conf;
+       int ret;
 
        memset(&null_conf, 0, sizeof(struct rte_eth_conf));
 
@@ -406,8 +413,14 @@ test_pmd_ring_pair_create_attach(void)
                return TEST_FAILED;
        }
 
-       rte_eth_dev_stop(rxtx_portd);
-       rte_eth_dev_stop(rxtx_porte);
+       ret = rte_eth_dev_stop(rxtx_portd);
+       if (ret != 0)
+               printf("Error: failed to stop port %u: %s\n",
+                      rxtx_portd, rte_strerror(-ret));
+       ret = rte_eth_dev_stop(rxtx_porte);
+       if (ret != 0)
+               printf("Error: failed to stop port %u: %s\n",
+                      rxtx_porte, rte_strerror(-ret));
 
        return TEST_SUCCESS;
 }
@@ -415,13 +428,22 @@ test_pmd_ring_pair_create_attach(void)
 static void
 test_cleanup_resources(void)
 {
-       int itr;
+       int itr, ret;
        for (itr = 0; itr < NUM_RINGS; itr++)
                rte_ring_free(rxtx[itr]);
 
-       rte_eth_dev_stop(tx_porta);
-       rte_eth_dev_stop(rx_portb);
-       rte_eth_dev_stop(rxtx_portc);
+       ret = rte_eth_dev_stop(tx_porta);
+       if (ret != 0)
+               printf("Error: failed to stop port %u: %s\n",
+                      tx_porta, rte_strerror(-ret));
+       ret = rte_eth_dev_stop(rx_portb);
+       if (ret != 0)
+               printf("Error: failed to stop port %u: %s\n",
+                      rx_portb, rte_strerror(-ret));
+       ret = rte_eth_dev_stop(rxtx_portc);
+       if (ret != 0)
+               printf("Error: failed to stop port %u: %s\n",
+                      rxtx_portc, rte_strerror(-ret));
 
        rte_mempool_free(mp);
        rte_vdev_uninit("net_ring_net_ringa");
@@ -490,10 +512,17 @@ static int
 test_command_line_ring_port(void)
 {
        int port, cmdl_port0 = -1;
+       int ret;
+
        /* find a port created with the --vdev=net_ring0 command line option */
        RTE_ETH_FOREACH_DEV(port) {
                struct rte_eth_dev_info dev_info;
-               rte_eth_dev_info_get(port, &dev_info);
+
+               ret = rte_eth_dev_info_get(port, &dev_info);
+               TEST_ASSERT((ret == 0),
+                               "Error during getting device (port %d) info: %s\n",
+                               port, strerror(-ret));
+
                if (!strcmp(dev_info.driver_name, "Rings PMD")) {
                        printf("found a command line ring port=%d\n", port);
                        cmdl_port0 = port;
@@ -509,7 +538,8 @@ test_command_line_ring_port(void)
                                "test stats reset cmdl_port0 is failed");
                TEST_ASSERT((test_get_stats(cmdl_port0) < 0),
                                "test get stats cmdl_port0 is failed");
-               rte_eth_dev_stop(cmdl_port0);
+               TEST_ASSERT((rte_eth_dev_stop(cmdl_port0) == 0),
+                               "test stop cmdl_port0 is failed");
        }
        return TEST_SUCCESS;
 }