From patchwork Sun Feb 26 12:21:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Amrani, Ram" X-Patchwork-Id: 9592273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CF7860459 for ; Sun, 26 Feb 2017 13:31:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E87D2846C for ; Sun, 26 Feb 2017 13:31:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4088228482; Sun, 26 Feb 2017 13:31:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3529E2846C for ; Sun, 26 Feb 2017 13:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbdBZNb0 (ORCPT ); Sun, 26 Feb 2017 08:31:26 -0500 Received: from mx0a-0016ce01.pphosted.com ([67.231.148.157]:53451 "EHLO mx0b-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752106AbdBZNb0 (ORCPT ); Sun, 26 Feb 2017 08:31:26 -0500 Received: from pps.filterd (m0095336.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1QCLm1B031264; Sun, 26 Feb 2017 04:21:48 -0800 Received: from avcashub1.qlogic.com ([198.186.0.115]) by mx0a-0016ce01.pphosted.com with ESMTP id 28u8w8hhj6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 26 Feb 2017 04:21:48 -0800 Received: from lb-tlvb-ramrani.il.qlogic.org (10.185.6.119) by avcashub1.qlogic.org (10.1.4.190) with Microsoft SMTP Server id 14.3.235.1; Sun, 26 Feb 2017 04:21:47 -0800 From: Ram Amrani To: CC: , , Ram Amrani Subject: [PATCH perftest] Avoid configuring the MRs with 1's Date: Sun, 26 Feb 2017 14:21:31 +0200 Message-ID: <1488111691-23620-1-git-send-email-Ram.Amrani@cavium.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8450 signatures=669242 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1702260128 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid setting the value '1' in the MR. If this happens in a write latency test then the server will send two consecutive packets, regardless of the client's state. This can cause the application to hang - If the client reaches the busy-wait loop after the second write then it'll keep waiting for the value of the first write forever. Signed-off-by: Ram Amrani --- src/perftest_resources.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/perftest_resources.c b/src/perftest_resources.c index afae5f2..dc768c4 100755 --- a/src/perftest_resources.c +++ b/src/perftest_resources.c @@ -1252,7 +1252,11 @@ int create_single_mr(struct pingpong_context *ctx, struct perftest_parameters *u /* Initialize buffer with random numbers */ srand(time(NULL)); for (i = 0; i < ctx->buff_size; i++) { - ((char*)ctx->buf[qp_index])[i] = (char)rand(); + /* prevent the value 1 from being written into the buffer so in, + * e.g., write latency test, the server won't send two packets + * consecutively without receiving a packet from the client first. + */ + ((char*)ctx->buf[qp_index])[i] = 2 + ((char)rand() % 255); } return 0;