From patchwork Sun Mar 5 15:39:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zohar Ben Aharon X-Patchwork-Id: 9604691 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 1DC3F604E2 for ; Sun, 5 Mar 2017 16:16:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 226A327F8C for ; Sun, 5 Mar 2017 16:16:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1756A2808C; Sun, 5 Mar 2017 16:16:04 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 4695527F8C for ; Sun, 5 Mar 2017 16:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752568AbdCEQPd (ORCPT ); Sun, 5 Mar 2017 11:15:33 -0500 Received: from mail-db5eur01on0075.outbound.protection.outlook.com ([104.47.2.75]:44536 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752425AbdCEQPb (ORCPT ); Sun, 5 Mar 2017 11:15:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=EOvrMCLRcWvhfhEcRRE5ibk9N7GzsXplytba++rhCGo=; b=UGKnwl7LtD61oWmpQFwcISpfvQg/XbRKn0YYukX4RT4uF3J7fEvTEZRMrH0c950CpJYhV3nXTWkhAs71d7UgK50PC8LoDZpdUWlIKXpnfbwEVsveyQG+h/hKCF2tLv02H5M3FjmIOP1YOsu/LTwgOI5YZy4fEPWmB+WqgN97NbY= Received: from AM5PR0501MB2532.eurprd05.prod.outlook.com (10.169.150.140) by VI1PR05MB1165.eurprd05.prod.outlook.com (10.162.15.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Sun, 5 Mar 2017 15:39:39 +0000 Received: from AM5PR0501MB2532.eurprd05.prod.outlook.com ([10.169.150.140]) by AM5PR0501MB2532.eurprd05.prod.outlook.com ([10.169.150.140]) with mapi id 15.01.0947.018; Sun, 5 Mar 2017 15:39:39 +0000 From: Zohar Ben Aharon To: Ram Amrani , Gil Rockah CC: "linux-rdma@vger.kernel.org" , "Ariel.Elior@cavium.com" , "leon@kernel.org" Subject: RE: [PATCH perftest v2] Bug fix write latency Thread-Topic: [PATCH perftest v2] Bug fix write latency Thread-Index: AQHSlcRl5kJNjxcPmEa7ckOaxBlJJaGGYTqQ Date: Sun, 5 Mar 2017 15:39:39 +0000 Message-ID: References: <1488727361-23364-1-git-send-email-Ram.Amrani@cavium.com> In-Reply-To: <1488727361-23364-1-git-send-email-Ram.Amrani@cavium.com> Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: cavium.com; dkim=none (message not signed) header.d=none; cavium.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [193.47.165.251] x-ms-office365-filtering-correlation-id: 0a0c7d5a-a8fa-452d-77ed-08d463ddd611 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:VI1PR05MB1165; x-microsoft-exchange-diagnostics: 1; VI1PR05MB1165; 7:wJMa4aqn4K0PcaIyb676SmiaYaDNZu0AtTmU5NzwMI+V7/bObckJ/M48z4QWqmPZSKDJ7MuebiLTDR+7rAxxWVlN1xmAEpeCc731DAuPYKwtZPr3Lw2KYtxwy9OShjI9e92PWWIxmlhjs0c4Il/fPedrT5aQ+dKILxTSu8n5CZFWrinnS5rrWMZiHhX4kc1LKBNzRdDRKh3ZKbKyvZgknboD2+QHtqnQPitIGiL1obFD/P+gnzVd9DtxuhFj0AxHPnH8TjCs4sJUdmI8jJM+4giXaZ/b3NM81UdZ2Hw0w6qYjlkQAACk7tlZELyV2t8/2zRAzNjfGDka1FtmlchXng== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(166708455590820)(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123558025)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:VI1PR05MB1165; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1165; x-forefront-prvs: 02379661A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39860400002)(39840400002)(39850400002)(39410400002)(39450400003)(377454003)(13464003)(6116002)(6306002)(54906002)(9686003)(33656002)(53546006)(53936002)(55016002)(6246003)(3846002)(76176999)(229853002)(6506006)(25786008)(102836003)(99286003)(2900100001)(38730400002)(6436002)(77096006)(66066001)(92566002)(2950100002)(54356999)(5660300001)(7696004)(50986999)(6636002)(7736002)(4326008)(106116001)(189998001)(122556002)(8936002)(86362001)(305945005)(3660700001)(3280700002)(74316002)(2906002)(81166006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1165; H:AM5PR0501MB2532.eurprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Mar 2017 15:39:39.5903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1165 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 Thanks Ram for the quick response!!! it will be pushed to main branch within a few days. Do you familiar with Perftest Git-hub repository ? https://github.com/linux-rdma/perftest you can use it to push patches as well. Thanks , Zohar Ben Aharon -----Original Message----- From: Ram Amrani [mailto:Ram.Amrani@cavium.com] Sent: Sunday, March 05, 2017 5:23 PM To: Zohar Ben Aharon ; Gil Rockah Cc: linux-rdma@vger.kernel.org; Ariel.Elior@cavium.com; leon@kernel.org; Ram Amrani Subject: [PATCH perftest v2] Bug fix write latency Avoid setting the value '1' in the MR. If this does happen 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 hang in the loop forever, waiting for the value of the first write. Signed-off-by: Ram Amrani --- src/perftest_resources.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/perftest_resources.c b/src/perftest_resources.c index afae5f2..21ff972 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 + ((unsigned char)rand() % 255); } return 0;