#include <rte_common.h>
#include <rte_debug.h>
#include <rte_ethdev.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
#include <rte_log.h>
#include <rte_lcore.h>
#include <rte_memory.h>
struct rte_eth_link link_status;
int retval;
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
retval = rte_eth_link_get(test_params->bonded_port_id, &link_status);
TEST_ASSERT(retval >= 0,
TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),
"test_remove_slave_from_bonded_device failed");
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
+
rte_eth_stats_reset(test_params->bonded_port_id);
rte_eth_bond_mac_address_reset(test_params->bonded_port_id);
test_params->slave_port_ids[i]);
/* stop/start bonded eth dev to apply new MAC */
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded port %d",
slave_port_ids[2]),
"failed to set primary port on bonded device.");
- rte_eth_dev_stop(bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id),
+ "Failed to stop bonded port %u",
+ bonded_port_id);
+
TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonded_port_id),
"Failed to start bonded pmd eth device %d.",
bonded_port_id);
* b - remove slave ethdevs
* c - Verify slave ethdevs MACs are restored
*/
- rte_eth_dev_stop(bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id),
+ "Failed to stop bonded port %u",
+ bonded_port_id);
for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) {
TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(bonded_port_id,
}
#define TEST_STATUS_INTERRUPT_SLAVE_COUNT 4
-#define TEST_LSC_WAIT_TIMEOUT_MS 500
+#define TEST_LSC_WAIT_TIMEOUT_US 500000
int test_lsc_interrupt_count;
ts.tv_sec = tp.tv_sec;
ts.tv_nsec = tp.tv_usec * 1000;
ts.tv_nsec += wait_us * 1000;
+ /* Normalize tv_nsec to [0,999999999L] */
+ while (ts.tv_nsec > 1000000000L) {
+ ts.tv_nsec -= 1000000000L;
+ ts.tv_sec += 1;
+ }
pthread_mutex_lock(&mutex);
if (test_lsc_interrupt_count < 1)
virtual_ethdev_simulate_link_status_interrupt(
test_params->slave_port_ids[3], 0);
- TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) == 0,
+ TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0,
"timed out waiting for interrupt");
TEST_ASSERT(test_lsc_interrupt_count > 0,
virtual_ethdev_simulate_link_status_interrupt(
test_params->slave_port_ids[0], 1);
- TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) == 0,
+ TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0,
"timed out waiting for interrupt");
/* test that we have received another lsc interrupt */
virtual_ethdev_simulate_link_status_interrupt(
test_params->slave_port_ids[0], 1);
- TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) != 0,
+ TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) != 0,
"received unexpected interrupt");
TEST_ASSERT_EQUAL(test_lsc_interrupt_count, 0,
/* stop / start bonded device and verify that primary MAC address is
* propagate to bonded device and slaves */
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
/* stop / start bonded device and verify that primary MAC address is
* propagated to bonded device and slaves */
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start device");
/* stop / start bonded device and verify that primary MAC address is
* propagated to bonded device and slaves */
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
/* stop / start bonded device and verify that primary MAC address is
* propagated to bonded device and slaves */
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
/* stop / start bonded device and verify that primary MAC address is
* propagated to bonded device and slaves */
- rte_eth_dev_stop(test_params->bonded_port_id);
+ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
+ "Failed to stop bonded port %u",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start device");