doc: update release notes for 19.11
[dpdk.git] / app / test / test_link_bonding.c
index a9b9d0c..3a46f94 100644 (file)
@@ -1168,7 +1168,7 @@ test_adding_slave_after_bonded_device_started(void)
 }
 
 #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;
 
@@ -1202,6 +1202,11 @@ lsc_timeout(int wait_us)
        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)
@@ -1256,7 +1261,7 @@ test_status_interrupt(void)
        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,
@@ -1275,7 +1280,7 @@ test_status_interrupt(void)
        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 */
@@ -1289,7 +1294,7 @@ test_status_interrupt(void)
        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,