doc: announce API changes for device objects
[dpdk.git] / app / test / test_link_bonding_mode4.c
index c35129f..31640cd 100644 (file)
 #define RX_RING_SIZE 128
 #define TX_RING_SIZE 512
 
-#define MBUF_PAYLOAD_SIZE          (2048)
-#define MBUF_SIZE (MBUF_PAYLOAD_SIZE + sizeof(struct rte_mbuf) + \
-       RTE_PKTMBUF_HEADROOM)
 #define MBUF_CACHE_SIZE         (250)
 #define BURST_SIZE              (32)
 
-#define DEFAULT_MBUF_DATA_SIZE  (2048)
 #define TEST_RX_DESC_MAX        (2048)
 #define TEST_TX_DESC_MAX        (2048)
 #define MAX_PKT_BURST           (32)
@@ -390,11 +386,9 @@ test_setup(void)
        if (test_params.mbuf_pool == NULL) {
                nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST +
                                        TEST_TX_DESC_MAX + MAX_PKT_BURST;
-               test_params.mbuf_pool = rte_mempool_create("TEST_MODE4",
-                               nb_mbuf_per_pool, MBUF_SIZE, MBUF_CACHE_SIZE,
-                               sizeof(struct rte_pktmbuf_pool_private),
-                               rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL,
-                               socket_id, 0);
+               test_params.mbuf_pool = rte_pktmbuf_pool_create("TEST_MODE4",
+                       nb_mbuf_per_pool, MBUF_CACHE_SIZE, 0,
+                       RTE_MBUF_DEFAULT_BUF_SIZE, socket_id);
 
                TEST_ASSERT(test_params.mbuf_pool != NULL,
                        "rte_mempool_create failed\n");
@@ -459,7 +453,7 @@ test_setup(void)
        return 0;
 }
 
-static int
+static void
 testsuite_teardown(void)
 {
        struct slave_conf *port;
@@ -473,8 +467,6 @@ testsuite_teardown(void)
 
        FOR_EACH_PORT(i, port)
                rte_eth_dev_stop(port->port_id);
-
-       return 0;
 }
 
 /*
@@ -755,8 +747,11 @@ test_mode4_rx(void)
        rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac);
        ether_addr_copy(&bonded_mac, &dst_mac);
 
-       /* Assert that dst address is not bonding address */
-       dst_mac.addr_bytes[0]++;
+       /* Assert that dst address is not bonding address.  Do not set the
+        * least significant bit of the zero byte as this would create a
+        * multicast address.
+        */
+       dst_mac.addr_bytes[0] += 2;
 
        /* First try with promiscuous mode enabled.
         * Add 2 packets to each slave. First with bonding MAC address, second with
@@ -1181,7 +1176,6 @@ test_mode4_expired(void)
 {
        struct slave_conf *slave, *exp_slave = NULL;
        struct rte_mbuf *pkts[MAX_PKT_BURST];
-       struct rte_mbuf *pkt = NULL;
        int retval;
        uint32_t old_delay;
 
@@ -1239,7 +1233,9 @@ test_mode4_expired(void)
                        /* Remove replay for slave that supose to be expired. */
                        if (slave == exp_slave) {
                                while (rte_ring_count(slave->rx_queue) > 0) {
-                                       rte_ring_dequeue(slave->rx_queue, (void **)&pkt);
+                                       void *pkt = NULL;
+
+                                       rte_ring_dequeue(slave->rx_queue, &pkt);
                                        rte_pktmbuf_free(pkt);
                                }
                        }
@@ -1395,7 +1391,8 @@ static struct unit_test_suite link_bonding_mode4_test_suite  = {
                TEST_CASE_NAMED("test_mode4_tx_burst", test_mode4_tx_burst_wrapper),
                TEST_CASE_NAMED("test_mode4_marker", test_mode4_marker_wrapper),
                TEST_CASE_NAMED("test_mode4_expired", test_mode4_expired_wrapper),
-               { NULL, NULL, NULL, NULL, NULL } /**< NULL terminate unit test array */
+
+               TEST_CASES_END() /**< NULL terminate unit test array */
        }
 };