From patchwork Mon Nov 21 21:57:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9440157 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 F25EC60235 for ; Mon, 21 Nov 2016 21:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E41D728ACF for ; Mon, 21 Nov 2016 21:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D701628AD2; Mon, 21 Nov 2016 21:57:17 +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 2B01428ACF for ; Mon, 21 Nov 2016 21:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754077AbcKUV5Q (ORCPT ); Mon, 21 Nov 2016 16:57:16 -0500 Received: from mail-bl2nam02on0054.outbound.protection.outlook.com ([104.47.38.54]:60160 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753739AbcKUV5P (ORCPT ); Mon, 21 Nov 2016 16:57:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SFdLqBNT/rKbOOGRbOI5FjTrtRmsBYQkhcHeXXVhylY=; b=an8mXL9QEeItqZKnf/RD1ke0WGppwzQo10ZEHK+xqdgB802XQuexEgY2YisLIp5NWOHhW4M3AfvbdfbtcStPF0nKkibJFv5ipvgyCpZbswxLaVkENv/WEYifQB32ucpjBTg8hMfksVfSMtjy7PhP4ZLSKaLdd54mYVaa7NB8qxc= Received: from BY2PR02CA0094.namprd02.prod.outlook.com (10.242.32.52) by MWHPR02MB2861.namprd02.prod.outlook.com (10.175.50.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8; Mon, 21 Nov 2016 21:57:11 +0000 Received: from BY2FFO11FD013.protection.gbl (2a01:111:f400:7c0c::106) by BY2PR02CA0094.outlook.office365.com (2a01:111:e400:2c2a::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8 via Frontend Transport; Mon, 21 Nov 2016 21:57:10 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BY2FFO11FD013.mail.protection.outlook.com (10.1.14.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.4 via Frontend Transport; Mon, 21 Nov 2016 21:57:08 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:2985; Count:19 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 73.84.03811.BFB63385; Mon, 21 Nov 2016 13:49:48 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Mon, 21 Nov 2016 13:57:08 -0800 X-AuditID: 0ac94371-72fff70000000ee3-37-58336bfbed4e Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id E3.56.03661.3BD63385; Mon, 21 Nov 2016 13:57:07 -0800 (PST) Subject: [PATCH 2/5] IB/srp: Introduce a local variable in srp_add_one() To: Doug Ledford References: CC: Max Gurtovoy , Christoph Hellwig , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <96a9cadd-dc31-769b-6e6a-f5553aff8ed3@sandisk.com> Date: Mon, 21 Nov 2016 13:57:07 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsXCddJ5ke6fbOMIg1urOCxenv/AarFy9VEm i2eHelksTj86wO7A4rH7ZgObx7Pph5k83u+7yubxeZNcAEsUl01Kak5mWWqRvl0CV8azDxfZ Cj5KVHx52cjUwPhZpIuRk0NCwETiTv9Sli5GLg4hgaVMEmfX9zFBODsYJeb9uc4MU3Xo+kxm qCpGiRezW9hBEsICHhLzf/SB2SICahKbXi0CsjmAiuwkep/xgNQzCzQySqxefBNsEJuAkcS3 9zNZQGxeoJqb99eB9bIIqEosfHWHFcQWFYiQ2PR1DlSNoMTJmU9YQGZyCthLNNxWBzGZBTQl 1u/SB6lgFpCX2P52DthpEgKrWCVuzjgJtkpIQF3i5JL5TBMYhWchmTQLoX0WkvYFjMyrGMVy M3OKc9NTCwxN9IoT81Iyi7P1kvNzNzFC4qBwB+Pr296HGAU4GJV4eGdwGkcIsSaWFVfmHmKU 4GBWEuF9lAEU4k1JrKxKLcqPLyrNSS0+xCjNwaIkznsx+mOYkEB6YklqdmpqQWoRTJaJg1Oq gVH86709+7Y+fLy4+drfb5XGSrzP7ar1hVNenk3lCt//5c7s5Pdmhctyr6jYxXI0aazaXX2w cM2ZA02mb/h0Ena4nO4/vFnxc/+d5T+L0vT2Xz/uFHVC5b2Yarm/sW/m496VAcdvSvArScnO mRLxLK7M6d7ims65SydKfZt89aQDU3RA+cmLxnZKLMUZiYZazEXFiQD5T6NzfwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsXCtZEjRXdzrnGEwef5RhYvz39gtVi5+iiT xbNDvSwWpx8dYHdg8dh9s4HN49n0w0we7/ddZfP4vEkugCWKyyYlNSezLLVI3y6BK+PZh4ts BR8lKr68bGRqYPws0sXIySEhYCJx6PpM5i5GLg4hgcWMEp83vWQESQgLeEjM/9HHDmKLCKhJ bHq1CMjmACqyk+h9xgNSzyzQyCjx59ZrJpAaNgEjiW/vZ7KA2LxANTfvrwPrZRFQlVj46g4r iC0qECGx6escqBpBiZMzn7CAzOQUsJdouK0OEmYWUJf4M+8SM4QtL7H97RzmCYx8s5B0zEJS NgtJ2QJG5lWMYrmZOcW56ZkFhkZ6xYl5KZnF2XrJ+bmbGMHByBm1g/H6RPNDjEwcnFINjBaC 3Vs6PBvPXyj7GfX4zrQYT67Hq/M1WTjffruhsoAnOfOhQqt54FamU0uy//ytnJ/7fNcPnfUv a08ylhcJflJIXzPVVO/1Nf/F+xq2mkQ2tt7YPcXCMMn39gv9ow88ptr2aksmMLrE5VSqJ7Ie f8d1+NyLXMazTBem+S7n60qu2xnzpGrqfSWW4oxEQy3mouJEAOEFOGv2AQAA X-IncomingHeaderCount: 19 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(33646002)(4001350100001)(65806001)(106466001)(65956001)(50466002)(8936002)(47776003)(97736004)(8676002)(2270400002)(5660300001)(2906002)(86362001)(305945005)(31686004)(356003)(31696002)(7846002)(230700001)(626004)(4326007)(2950100002)(83506001)(65826007)(36756003)(23676002)(53416004)(87936001)(6916009)(81166006)(68736007)(76176999)(77096005)(81156014)(54356999)(50986999)(110136003)(189998001)(64126003)(38730400001)(92566002)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2861; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD013; 1:/I7H7QEMogth2e8vQtFT0DYi6dk1E5Lmbk2iyVZNK0csILHqwby3l9TOoXMSvK+ViaAb8SZ2QBpy6/4xkzKr4Q6uTX9/8Kam9r1qKCOo0TfWNUfSx+8fbLkvDAKfd7Fnl5eaFVaOkYX85s+ZeVfKJ96i1RRKGj61j4DhUqa4gXT7fx7zfga/iPSzrJ00ZLiqP1+fa9XQSu68BguQPjPxq3j0JjXORtvVUe+o5W5JLuauO6Ibs7GyXGU0L/xhKh5mii2K6iEEu5r/PHdk1arCVht9yNgXWuUmc1M9BzDzvtloi1kQNjw4cCCFH+1V1oOafo016c3QiDf/dQjlPeUOa1+nwXdGEJCIcuPe1EQk8BHZJsUon1V9qYQPMcC33rZXIkVTpRuBKEMJYPF2RsRpZDLju8rQUH5xg77RR/zyhSvK2SAMwm/wGEiCxsDW/SGUj06JnEuDscG1s4bVIL94DAN5Do6XjAm8AQOQWF94jAotj/32U099y9OA9a1+OLnnziU8aRRo7KFHfX6baAu2tbXnKTbGet2H6XmzSbuTonU= X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2861; 2:iJwfRK9b3dj+q3x+5i/xbB36trpyixAo5glBdrQ7ReWMmOMvjuNunoQKz+bIbIUhkDOxA5VJMrVgXdltW77GBLzKL1tUs3Uph7+1EtTvgpmQ6Y5q5B7pvbJo39/pNF+h4bPImlTkgVLqBkZ1DxAxXhA9VJ4Sh2Hq13LOZBknmmM=; 3:bDtsLxuZIfofJCUxi19yEkf1ItFbcNxTaOELttyP3X1JAu6D0f9sqpYzdLnoPj+Nhk+/EQ3lLn2LbfTG+YhW50hjkMNU192INYuC0Fy+QDybXXLJwl8sraJLtmp+zvsFq40pbNEYxcTI/QcUaMlG9n3jrlmyLbCzLTuHfoDdsrY/hgE/XU3b9l0F1JszsmSOMU1CIgmdfaZAe0lj1zntAIL/KsMcpRvqsHGYz2n/EXLffamFHnCsphAm6rOomw0bX9MxKz4TKQqNdc6Px/CWcHCd5fZONe2PegSiV/KxGpI= X-MS-Office365-Filtering-Correlation-Id: c08640f5-599d-47ac-4f26-08d4125957d6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:MWHPR02MB2861; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2861; 25:+6oMsrdsvyjJZS1qQNzALD6DktfKGaM8AGphkGjIjmosbr36IjPmjpD5DydwvQfPFjjfWWOogAbNRnOwGbdtnxsDEQ1CjnY+lWAgzV39vIWCtKwTK3LvO+ooje6AbY3dJdzpJ4BDoSyfYswwioTESzKuTn2bzBCpqzm2SBaxjnIcxMiOwyvBJyrerXPq8ovFZKjLxMdniP3ypjoiNWQZeq50EFOUvQSRQdniFJXpg7rViR7fiOk4hjyBmBjBQ88uaFq0rSg8zlRL/QD5ycrMjWZbodDmFaEtFe7EgdvOWDs8Stcs9YFKfZGVcWvSHIOcxVN1tadbV2Q49Q6+FQn+DwIZGBbLeVLYCQ/0RKDjO2F04edcAuBLKqMnhrLY+R10wpeYQDrr3QFPyyv4/hyUGekslMnrkyJc+zEhT/d+MdRFS2s1eV/KHjRF9tFQtXeFjQkvZA8tGnK9Q3HMRcZCX02sLnpDlk6o2EU/xhRG/xpoB+2AcrS48srWGHlPSOPC5FRaiPUNkkZsQiKbah6grLijs7eL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ZqcwqCtjfPhUCGw6yff4oCoFS3QpzNQP4eU1iDhYSRDZm83O2WPK2NOXFmZI4GJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040307)(6060326)(6045199)(601004)(2401047)(13016025)(5005006)(8121501046)(13018025)(3002001)(10201501046)(6055026)(6041248)(6061324)(6072148)(6042181); SRVR:MWHPR02MB2861; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB2861; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB2861; 4:/1Jq83C6U5Ia9caG9PXwbaI6eME6dq6w4oAKrAMeFdXfNlBtl5lVknhZDtDgibTbgUdNVJJbAicba/hw0wgGdz+sYsduqBg87Tjh6QHln4JutuSlu72OEmq+1RDkIXrDuZ9e11IQf+cjrcWH5qeIDvJuILDXw64Lg7TfGcNkRHvN5AdJd+672TtVrPn/GXHB3JqfpPD0P5ltZrNhj75MXdBHulFx87CiVBrbjhjYOdgIAJcEeOx8TasiTxM3uL3JlTRMx5IsIm8OIBRhTq0YGeuJhYWdS9p5tQIhcjqVasBMPCd/nYPdw5dA0dB988EfR1qaA3GKvrNIFFnSGxzhuqGQcH+a5xEpVl4KC1jJHwbDaO25oHkGnskkoiJhtibtIvWncyrSvYqNffgkGgl66cE6KxgaUjmMFTaADwEvbj8eKgbga07g/TFGVLw5PMo7Nx/bGorKAnOOUx4kFdsxe6yzYzEWgIyoi5Z/sRuAZxwCuGPd1j1Xu6562nn+eswBNaO15foo3bFPgA1JGjB0UV30Ivny78Za0S6TECw4ejPIk9evDdnZ1f7HHViTxwjylEzcrHN2E0r9fBbfXJqNcW1KBrKg3vmhFLntTcBd2pU= X-Forefront-PRVS: 01334458E5 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjAyTUIyODYxOzIzOkVOT2lRUmlnY3NGRVdZMHBOMStFWC9pV1pH?= =?utf-8?B?WjhxcE9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wHVBh01289C5vKR4zUuiQePEmef3n6gfH3HPV X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2016 21:57:08.6626 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2861 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 This patch makes the srp_add_one() code more compact and does not change any functionality. Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srp/ib_srp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 8bb720c..c216c6e 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3527,6 +3527,7 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port) static void srp_add_one(struct ib_device *device) { struct srp_device *srp_dev; + struct ib_device_attr *attr = &device->attrs; struct srp_host *host; int mr_page_shift, p; u64 max_pages_per_mr; @@ -3541,25 +3542,25 @@ static void srp_add_one(struct ib_device *device) * minimum of 4096 bytes. We're unlikely to build large sglists * out of smaller entries. */ - mr_page_shift = max(12, ffs(device->attrs.page_size_cap) - 1); + mr_page_shift = max(12, ffs(attr->page_size_cap) - 1); srp_dev->mr_page_size = 1 << mr_page_shift; srp_dev->mr_page_mask = ~((u64) srp_dev->mr_page_size - 1); - max_pages_per_mr = device->attrs.max_mr_size; + max_pages_per_mr = attr->max_mr_size; do_div(max_pages_per_mr, srp_dev->mr_page_size); pr_debug("%s: %llu / %u = %llu <> %u\n", __func__, - device->attrs.max_mr_size, srp_dev->mr_page_size, + attr->max_mr_size, srp_dev->mr_page_size, max_pages_per_mr, SRP_MAX_PAGES_PER_MR); srp_dev->max_pages_per_mr = min_t(u64, SRP_MAX_PAGES_PER_MR, max_pages_per_mr); srp_dev->has_fmr = (device->alloc_fmr && device->dealloc_fmr && device->map_phys_fmr && device->unmap_fmr); - srp_dev->has_fr = (device->attrs.device_cap_flags & + srp_dev->has_fr = (attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS); if (!never_register && !srp_dev->has_fmr && !srp_dev->has_fr) { dev_warn(&device->dev, "neither FMR nor FR is supported\n"); } else if (!never_register && - device->attrs.max_mr_size >= 2 * srp_dev->mr_page_size) { + attr->max_mr_size >= 2 * srp_dev->mr_page_size) { srp_dev->use_fast_reg = (srp_dev->has_fr && (!srp_dev->has_fmr || prefer_fr)); srp_dev->use_fmr = !srp_dev->use_fast_reg && srp_dev->has_fmr; @@ -3572,13 +3573,13 @@ static void srp_add_one(struct ib_device *device) if (srp_dev->use_fast_reg) { srp_dev->max_pages_per_mr = min_t(u32, srp_dev->max_pages_per_mr, - device->attrs.max_fast_reg_page_list_len); + attr->max_fast_reg_page_list_len); } srp_dev->mr_max_size = srp_dev->mr_page_size * srp_dev->max_pages_per_mr; pr_debug("%s: mr_page_shift = %d, device->max_mr_size = %#llx, device->max_fast_reg_page_list_len = %u, max_pages_per_mr = %d, mr_max_size = %#x\n", - device->name, mr_page_shift, device->attrs.max_mr_size, - device->attrs.max_fast_reg_page_list_len, + device->name, mr_page_shift, attr->max_mr_size, + attr->max_fast_reg_page_list_len, srp_dev->max_pages_per_mr, srp_dev->mr_max_size); INIT_LIST_HEAD(&srp_dev->dev_list);