From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8265DA046B for ; Fri, 23 Aug 2019 10:17:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6377A1BF8C; Fri, 23 Aug 2019 10:17:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 6811D1BF7E for ; Fri, 23 Aug 2019 10:17:29 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7N8Fq60032425; Fri, 23 Aug 2019 01:17:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=zKjTFpoChUuWu0yLF3eAZV9X/GiZJmUG6ou15WiDLII=; b=DagkuRx9gQ5x/RUXNbnKMk5J8X58e1UyRmPLXWwaBj0VO7CN1ucZXSDQ4yfyIR6UURir jsu2BPOSEw9W2UoMgjhLMGUuJl6dkp/GLCpQEpdhhauLvNX8VfPPn0iQklp/sAUMafNv Ok7IePvwMcsdrN53UphInsTYee/MI/uKBrrkFyVo22pUvRGUGo9Zy2SwcYXiEaD5aPl3 jUogGCoIVsXjujflUfF/WsySNNH5SVX8hY/iBci1hQUAQEFvZnnmv6Ln0aQ5ffJTEvrN CLEDQOoXs76GbvI8wzG/6adNMrMgj6hjXw7q+673GJQJNx/Jk9CIezYbKTvBye8Ql4Rc Tw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2uhag27gv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 23 Aug 2019 01:17:27 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 23 Aug 2019 01:17:25 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 23 Aug 2019 01:17:25 -0700 Received: from kk-box-0.marvell.com (unknown [10.95.130.43]) by maili.marvell.com (Postfix) with ESMTP id 402FB3F7040; Fri, 23 Aug 2019 01:17:24 -0700 (PDT) From: To: , Chas Williams CC: Krzysztof Kanas , Date: Fri, 23 Aug 2019 10:16:58 +0200 Message-ID: <20190823081659.27793-1-kkanas@marvell.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-23_02:2019-08-21,2019-08-23 signatures=0 Subject: [dpdk-dev] [PATCH 1/2] test/bonding: fix LSC related test cases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Krzysztof Kanas 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 --- 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