From patchwork Thu Apr 30 09:02:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 6300741 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BE8F4BEEE1 for ; Thu, 30 Apr 2015 09:02:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1531201CD for ; Thu, 30 Apr 2015 09:02:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 902D0201BB for ; Thu, 30 Apr 2015 09:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750946AbbD3JCw (ORCPT ); Thu, 30 Apr 2015 05:02:52 -0400 Received: from mail-bl2on0057.outbound.protection.outlook.com ([65.55.169.57]:7968 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750803AbbD3JCu (ORCPT ); Thu, 30 Apr 2015 05:02:50 -0400 Received: from BY2PR02CA0123.namprd02.prod.outlook.com (25.163.44.177) by BY1PR0201MB1032.namprd02.prod.outlook.com (25.161.203.15) with Microsoft SMTP Server (TLS) id 15.1.148.16; Thu, 30 Apr 2015 09:02:47 +0000 Received: from BY2FFO11OLC004.protection.gbl (2a01:111:f400:7c0c::152) by BY2PR02CA0123.outlook.office365.com (2a01:111:e400:5261::49) with Microsoft SMTP Server (TLS) id 15.1.154.19 via Frontend Transport; Thu, 30 Apr 2015 09:02:47 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BY2FFO11OLC004.mail.protection.outlook.com (10.1.15.184) with Microsoft SMTP Server id 15.1.160.8 via Frontend Transport; Thu, 30 Apr 2015 09:02:45 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id EA.2A.14695.5BFE1455; Thu, 30 Apr 2015 02:02:45 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.224.2; Thu, 30 Apr 2015 02:02:45 -0700 X-AuditID: ac160a69-f79656d000003967-de-5541efb5715b Received: from [10.50.231.61] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id F9.FC.19112.3BFE1455; Thu, 30 Apr 2015 02:02:45 -0700 (PDT) Message-ID: <5541EFB3.6030704@sandisk.com> Date: Thu, 30 Apr 2015 11:02:43 +0200 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Doug Ledford CC: James Bottomley , Sagi Grimberg , Sebastian Parschauer , linux-rdma , "linux-scsi@vger.kernel.org" Subject: [PATCH 12/12] IB/srp: Make CM timeout dependent on subnet timeout References: <5541EE21.3050809@sandisk.com> In-Reply-To: <5541EE21.3050809@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeLIzCtJLcpLzFFi42JZI8azSHfre8dQg66/6hYvz39gtfi//jaL xbNDvSwW3dd3sFncaHvAZnHyNr8Dm8ez6YeZPA7/+MHs8efPZ2aP9/uusnl83iQXwBrFZZOS mpNZllqkb5fAlTHh0j+WgjVCFa8/XmduYGzh72Lk5JAQMJHY828XM4QtJnHh3n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6UTzQ4xMHJxSDYzC9zbZfKrc482em/7j1ZlJ32Z+N06e+IW3pyqiR5fryA7H SOm6oD/J7xIjAve9nhF/d8Kp+erLisRr+udvN25aZz3phnrINfH1L7QOmhjoxefMmr9H5Hii 6KMs/YhCh5PVW/RP2ab/Z/7x/+fzlbZp/T8/ZSjsfbGZbW5LZOXRP8aLjy8NX/FaiaU4I9FQ i7moOBEAUFOUGxICAAA= X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(189002)(199003)(77156002)(64126003)(106466001)(36756003)(83506001)(54356999)(86362001)(77096005)(4001350100001)(59896002)(76176999)(33656002)(65956001)(229853001)(62966003)(65816999)(65806001)(2950100001)(50986999)(92566002)(23676002)(19580395003)(87266999)(46102003)(80316001)(87936001)(50466002)(5001920100001)(19580405001)(47776003)(5001960100002)(110136002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0201MB1032; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB1032; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY1PR0201MB1032; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0201MB1032; X-Forefront-PRVS: 056297E276 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2015 09:02:45.8414 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0201MB1032 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In large networks the subnet timeout may have been set to a value above 20. In small networks it can be safe to reduce the subnet timeout below 20. The CM timeout should be proportional to the subnet timeout. Hence make the CM timeout dependent on the subnet timeout. Since the default subnet timeout used by OpenSM is 18 this patch does not change the CM timeout if the default OpenSM subnet timeout is used. Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer --- drivers/infiniband/ulp/srp/ib_srp.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 27d3a64..a18a2ae 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -704,6 +704,19 @@ static int srp_lookup_path(struct srp_rdma_ch *ch) return ch->status; } +static u8 srp_get_subnet_timeout(struct srp_host *host) +{ + struct ib_port_attr attr; + int ret; + u8 subnet_timeout = 18; + + ret = ib_query_port(host->srp_dev->dev, host->port, &attr); + if (ret == 0) + subnet_timeout = attr.subnet_timeout; + + return subnet_timeout; +} + static int srp_send_req(struct srp_rdma_ch *ch, bool multich) { struct srp_target_port *target = ch->target; @@ -711,8 +724,11 @@ static int srp_send_req(struct srp_rdma_ch *ch, bool multich) struct ib_cm_req_param param; struct srp_login_req priv; } *req = NULL; + u8 subnet_timeout; int status; + subnet_timeout = srp_get_subnet_timeout(target->srp_host); + req = kzalloc(sizeof *req, GFP_KERNEL); if (!req) return -ENOMEM; @@ -734,8 +750,8 @@ static int srp_send_req(struct srp_rdma_ch *ch, bool multich) * module parameters if anyone cared about setting them. */ req->param.responder_resources = 4; - req->param.remote_cm_response_timeout = 20; - req->param.local_cm_response_timeout = 20; + req->param.remote_cm_response_timeout = subnet_timeout + 2; + req->param.local_cm_response_timeout = subnet_timeout + 2; req->param.retry_count = target->tl_retry_count; req->param.rnr_retry_count = 7; req->param.max_cm_retries = 15;