From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id AC587325F for ; Mon, 6 May 2019 21:24:02 +0200 (CEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x46JN8XO025118 for ; Mon, 6 May 2019 15:24:01 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sau1n81ak-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 May 2019 15:24:01 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 May 2019 20:24:00 +0100 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 6 May 2019 20:23:57 +0100 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x46JNu5925034860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2019 19:23:56 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5C7FAC05B; Mon, 6 May 2019 19:23:56 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D303AC059; Mon, 6 May 2019 19:23:56 +0000 (GMT) Received: from oprom9.localdomain (unknown [9.40.204.34]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 6 May 2019 19:23:56 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: David Christensen Date: Mon, 6 May 2019 14:23:54 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 19050619-0060-0000-0000-0000033BF31D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011061; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01199531; UDB=6.00629314; IPR=6.00980407; MB=3.00026760; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-06 19:23:59 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050619-0061-0000-0000-0000493EE2A6 Message-Id: <1557170634-99830-1-git-send-email-drc@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-06_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905060160 Subject: [dpdk-dev] [PATCH v2 3/4] test: change memory barrier variables to uint64_t 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: , X-List-Received-Date: Mon, 06 May 2019 19:24:03 -0000 Memory barrier failures can be intermittent. Increase the size of the sum/val/iteration variables to allow tests that can run for days so that sporadic errors can be identified. Signed-off-by: David Christensen --- v2: * Removed change to ITER_MAX app/test/test_barrier.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c index ae37b1e..a022708 100644 --- a/app/test/test_barrier.c +++ b/app/test/test_barrier.c @@ -55,8 +55,8 @@ struct plock { */ struct plock_test { struct plock lock; - uint32_t val; - uint32_t iter; + uint64_t val; + uint64_t iter; }; /* @@ -65,8 +65,8 @@ struct plock_test { */ struct lcore_plock_test { struct plock_test *pt[2]; /* shared, lock-protected data */ - uint32_t sum[2]; /* local copy of the shared data */ - uint32_t iter; /* number of iterations to perfom */ + uint64_t sum[2]; /* local copy of the shared data */ + uint64_t iter; /* number of iterations to perfom */ uint32_t lc; /* given lcore id */ }; @@ -130,7 +130,8 @@ struct lcore_plock_test { plock_test1_lcore(void *data) { uint64_t tm; - uint32_t i, lc, ln, n; + uint32_t lc, ln; + uint64_t i, n; struct lcore_plock_test *lpt; lpt = data; @@ -166,9 +167,9 @@ struct lcore_plock_test { tm = rte_get_timer_cycles() - tm; - printf("%s(%u): %u iterations finished, in %" PRIu64 + printf("%s(%u): %lu iterations finished, in %" PRIu64 " cycles, %#Lf cycles/iteration, " - "local sum={%u, %u}\n", + "local sum={%lu, %lu}\n", __func__, lc, i, tm, (long double)tm / i, lpt->sum[0], lpt->sum[1]); return 0; @@ -184,11 +185,11 @@ struct lcore_plock_test { * and local data are the same. */ static int -plock_test(uint32_t iter, enum plock_use_type utype) +plock_test(uint64_t iter, enum plock_use_type utype) { int32_t rc; uint32_t i, lc, n; - uint32_t *sum; + uint64_t *sum; struct plock_test *pt; struct lcore_plock_test *lpt; @@ -199,7 +200,7 @@ struct lcore_plock_test { lpt = calloc(n, sizeof(*lpt)); sum = calloc(n + 1, sizeof(*sum)); - printf("%s(iter=%u, utype=%u) started on %u lcores\n", + printf("%s(iter=%lu, utype=%u) started on %u lcores\n", __func__, iter, utype, n); if (pt == NULL || lpt == NULL || sum == NULL) { @@ -247,7 +248,7 @@ struct lcore_plock_test { rc = 0; for (i = 0; i != n; i++) { - printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n", + printf("%s: sum[%u]=%lu, pt[%u].val=%lu, pt[%u].iter=%lu;\n", __func__, i, sum[i], i, pt[i].val, i, pt[i].iter); /* race condition occurred, lock doesn't work properly */ -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5D08BA0096 for ; Mon, 6 May 2019 21:24:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2952C44C3; Mon, 6 May 2019 21:24:04 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id AC587325F for ; Mon, 6 May 2019 21:24:02 +0200 (CEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x46JN8XO025118 for ; Mon, 6 May 2019 15:24:01 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sau1n81ak-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 May 2019 15:24:01 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 May 2019 20:24:00 +0100 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 6 May 2019 20:23:57 +0100 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x46JNu5925034860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2019 19:23:56 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5C7FAC05B; Mon, 6 May 2019 19:23:56 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D303AC059; Mon, 6 May 2019 19:23:56 +0000 (GMT) Received: from oprom9.localdomain (unknown [9.40.204.34]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 6 May 2019 19:23:56 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: David Christensen Date: Mon, 6 May 2019 14:23:54 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 19050619-0060-0000-0000-0000033BF31D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011061; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01199531; UDB=6.00629314; IPR=6.00980407; MB=3.00026760; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-06 19:23:59 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050619-0061-0000-0000-0000493EE2A6 Message-Id: <1557170634-99830-1-git-send-email-drc@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-06_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905060160 Subject: [dpdk-dev] [PATCH v2 3/4] test: change memory barrier variables to uint64_t 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190506192354.9GiabmfdunYOs0Z4CwZ4aZY6ZFys337FHGR3AZBLqWs@z> Memory barrier failures can be intermittent. Increase the size of the sum/val/iteration variables to allow tests that can run for days so that sporadic errors can be identified. Signed-off-by: David Christensen --- v2: * Removed change to ITER_MAX app/test/test_barrier.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c index ae37b1e..a022708 100644 --- a/app/test/test_barrier.c +++ b/app/test/test_barrier.c @@ -55,8 +55,8 @@ struct plock { */ struct plock_test { struct plock lock; - uint32_t val; - uint32_t iter; + uint64_t val; + uint64_t iter; }; /* @@ -65,8 +65,8 @@ struct plock_test { */ struct lcore_plock_test { struct plock_test *pt[2]; /* shared, lock-protected data */ - uint32_t sum[2]; /* local copy of the shared data */ - uint32_t iter; /* number of iterations to perfom */ + uint64_t sum[2]; /* local copy of the shared data */ + uint64_t iter; /* number of iterations to perfom */ uint32_t lc; /* given lcore id */ }; @@ -130,7 +130,8 @@ struct lcore_plock_test { plock_test1_lcore(void *data) { uint64_t tm; - uint32_t i, lc, ln, n; + uint32_t lc, ln; + uint64_t i, n; struct lcore_plock_test *lpt; lpt = data; @@ -166,9 +167,9 @@ struct lcore_plock_test { tm = rte_get_timer_cycles() - tm; - printf("%s(%u): %u iterations finished, in %" PRIu64 + printf("%s(%u): %lu iterations finished, in %" PRIu64 " cycles, %#Lf cycles/iteration, " - "local sum={%u, %u}\n", + "local sum={%lu, %lu}\n", __func__, lc, i, tm, (long double)tm / i, lpt->sum[0], lpt->sum[1]); return 0; @@ -184,11 +185,11 @@ struct lcore_plock_test { * and local data are the same. */ static int -plock_test(uint32_t iter, enum plock_use_type utype) +plock_test(uint64_t iter, enum plock_use_type utype) { int32_t rc; uint32_t i, lc, n; - uint32_t *sum; + uint64_t *sum; struct plock_test *pt; struct lcore_plock_test *lpt; @@ -199,7 +200,7 @@ struct lcore_plock_test { lpt = calloc(n, sizeof(*lpt)); sum = calloc(n + 1, sizeof(*sum)); - printf("%s(iter=%u, utype=%u) started on %u lcores\n", + printf("%s(iter=%lu, utype=%u) started on %u lcores\n", __func__, iter, utype, n); if (pt == NULL || lpt == NULL || sum == NULL) { @@ -247,7 +248,7 @@ struct lcore_plock_test { rc = 0; for (i = 0; i != n; i++) { - printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n", + printf("%s: sum[%u]=%lu, pt[%u].val=%lu, pt[%u].iter=%lu;\n", __func__, i, sum[i], i, pt[i].val, i, pt[i].iter); /* race condition occurred, lock doesn't work properly */ -- 1.8.3.1