DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH 1/2] test/bonding: fix LSC related test cases
@ 2019-08-23  8:16 kkanas
  2019-08-23  8:16 ` [dpdk-dev] [PATCH 2/2] test/bonding: fix LSC timeout unit kkanas
  2019-10-08 18:48 ` [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases Yigit, Ferruh
  0 siblings, 2 replies; 3+ messages in thread
From: kkanas @ 2019-08-23  8:16 UTC (permalink / raw)
  To: dev, Chas Williams; +Cc: Krzysztof Kanas, declan.doherty

From: Krzysztof Kanas <kkanas@marvell.com>

On rare situation test_link_bonding test case fail due to timespec
tv_nsec overflow, which causes pthread_cond_timedwait to return EINVAL
and test to fail.

Fixes: 76d29903f5f5 ("bond: support link status interrupt")
Cc: declan.doherty@intel.com

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
---
 app/test/test_link_bonding.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 938fafca3a95..1cfa77278376 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -1160,6 +1160,12 @@ 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)
-- 
2.21.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev]  [PATCH 2/2] test/bonding: fix LSC timeout unit
  2019-08-23  8:16 [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases kkanas
@ 2019-08-23  8:16 ` kkanas
  2019-10-08 18:48 ` [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases Yigit, Ferruh
  1 sibling, 0 replies; 3+ messages in thread
From: kkanas @ 2019-08-23  8:16 UTC (permalink / raw)
  To: dev, Chas Williams; +Cc: Krzysztof Kanas, declan.doherty

From: Krzysztof Kanas <kkanas@marvell.com>

Fixes: 76d29903f5f5 ("bond: support link status interrupt")
Cc: declan.doherty@intel.com

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
---
 app/test/test_link_bonding.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 1cfa77278376..76505ec12a44 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -1126,7 +1126,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;
 
@@ -1220,7 +1220,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,
@@ -1239,7 +1239,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 */
@@ -1253,7 +1253,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,
-- 
2.21.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases
  2019-08-23  8:16 [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases kkanas
  2019-08-23  8:16 ` [dpdk-dev] [PATCH 2/2] test/bonding: fix LSC timeout unit kkanas
@ 2019-10-08 18:48 ` Yigit, Ferruh
  1 sibling, 0 replies; 3+ messages in thread
From: Yigit, Ferruh @ 2019-10-08 18:48 UTC (permalink / raw)
  To: kkanas, dev, Chas Williams; +Cc: declan.doherty

On 8/23/2019 9:16 AM, kkanas@marvell.com wrote:
> From: Krzysztof Kanas <kkanas@marvell.com>
> 
> On rare situation test_link_bonding test case fail due to timespec
> tv_nsec overflow, which causes pthread_cond_timedwait to return EINVAL
> and test to fail.
> 
> Fixes: 76d29903f5f5 ("bond: support link status interrupt")
> Cc: declan.doherty@intel.com
> 
> Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-08 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23  8:16 [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases kkanas
2019-08-23  8:16 ` [dpdk-dev] [PATCH 2/2] test/bonding: fix LSC timeout unit kkanas
2019-10-08 18:48 ` [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases Yigit, Ferruh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).