From patchwork Fri Jan 29 23:12:28 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: 8168521 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE0979F96D for ; Fri, 29 Jan 2016 23:13:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD00620398 for ; Fri, 29 Jan 2016 23:13:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BE4E2039D for ; Fri, 29 Jan 2016 23:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753351AbcA2XNN (ORCPT ); Fri, 29 Jan 2016 18:13:13 -0500 Received: from mail-bl2on0092.outbound.protection.outlook.com ([65.55.169.92]:11232 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753397AbcA2XNK (ORCPT ); Fri, 29 Jan 2016 18:13:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=W2ZIril0MQfzKfDsCMU34n6WkIyepd/cJQMLM5P5jXk=; b=QQnd9/pScgvyro94v9A4uiCmPH23ZbQlHHHWsq/JbM6Ie4RLY0VTeWZ4noUUAGcXXqpEMefR4c3TaqprHKAwMGUQDBYRXxP7MVkKMayiqiS9zyhdb4yMg/ru4bBsN1XL06ZBUPSjgeGpa1o6+eOoNFgvdfUhNtbenICWmKmHdmI= Received: from BY2PR02CA0022.namprd02.prod.outlook.com (10.141.216.12) by BL2PR02MB290.namprd02.prod.outlook.com (10.141.90.145) with Microsoft SMTP Server (TLS) id 15.1.396.15; Fri, 29 Jan 2016 23:13:08 +0000 Received: from BN1AFFO11FD034.protection.gbl (2a01:111:f400:7c10::107) by BY2PR02CA0022.outlook.office365.com (2a01:111:e400:2c40::12) with Microsoft SMTP Server (TLS) id 15.1.396.15 via Frontend Transport; Fri, 29 Jan 2016 23:13:08 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.174) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.174 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.174; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.174) by BN1AFFO11FD034.mail.protection.outlook.com (10.58.52.158) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 29 Jan 2016 23:13:06 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id A5.A8.25823.102FBA65; Fri, 29 Jan 2016 15:13:05 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Fri, 29 Jan 2016 15:12:29 -0800 X-AuditID: ac160a69-a17cc980000064df-60-56abf20144e0 Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id FB.47.02700.CD1FBA65; Fri, 29 Jan 2016 15:12:28 -0800 (PST) Subject: [PATCH v2 04/22] IB/srpt: Inline srpt_get_ch_state() To: Doug Ledford References: <56ABF16E.7070006@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56ABF1DC.7000904@sandisk.com> Date: Fri, 29 Jan 2016 15:12:28 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56ABF16E.7070006@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsWyRoxnkS7jp9VhBt9fCFhcePqdyeLl+Q+s FitXH2WyeHaol8XiRtsDNgdWj8V7XjJ57L7ZwObxbPphJo/3+66yeXzeJBfAGsVlk5Kak1mW WqRvl8CV8W/qLMaCT2oVi49cYGpgPCLfxcjJISFgIvHs1QPWLkYuDiGBTYwSnZsmskA4Oxgl jt27xA5TtWbjBKjEHEaJ2fsPsYAkhAVsJXoW9IDZIgJqEpteLQJrEBLQkjh34Qs7SAOzwCpG iU1Xr4Ml2ASMJL69nwnWwAtU9GbhazYQm0VAVeL+twWsILaoQITE4c4udogaQYmTM5+A1XMK aEssmX0ByOYAGqopsX6XPkiYWUBeYvvbOcwguyQE9rJKPD1/mhHiCHWJk0vmM01gFJ6FZNQs hPZZSNoXMDKvYhTLzcwpzk1PLTA00itOzEvJLM7WS87P3cQIjg+uzB2MKyaZH2IU4GBU4uFd sGJ1mBBrYllxZe4hRgkOZiUR3roXQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK81i1qYUIC6Ykl qdmpqQWpRTBZJg5OqQZGUYNCxwc/2+/9LHo+2dN5tizjuhLh6WarlyQ+jKsNt7RdKSXy6fX7 p+zm2vER2u/SZVbey1x5TNr7YOOPGaphYc8mrjCuLV+/7smG4+/lwt3bni6rerz/zElBKYcc 6ZdT53ML+BVe+mbC4zwxO3kJr8wuEfFbJ2/pFaXb33vVqDU57Mnt3RcblViKMxINtZiLihMB vUUpWosCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsXCtZEjRffOx9VhBtMe2FhcePqdyeLl+Q+s FitXH2WyeHaol8XiRtsDNgdWj8V7XjJ57L7ZwObxbPphJo/3+66yeXzeJBfAGsVlk5Kak1mW WqRvl8CV8W/qLMaCT2oVi49cYGpgPCLfxcjJISFgIrFm4wSWLkYuDiGBWYwSb188YwZJCAvY SvQs6GEBsUUE1CQ2vVrEDmILCWhJnLvwhR2kgVlgFaPE75Uf2EASbAJGEt/ezwRr4AUqerPw NVicRUBV4v63BawgtqhAhMThzi52iBpBiZMzn4DVcwpoSyyZfQHMZhZQl/gz7xIzhC0vsf3t HOYJjHyzkLTMQlI2C0nZAkbmVYxiuZk5xbnpmQWGhnrFiXkpmcXZesn5uZsYwUHKGbmD8elE 80OMTBycUg2MXjxbYzaLaKiF2NY99lhkrFeU5vrdRWO/+Msd2RMb0+O1GlbP41fcav3JcxJb p9QJ7dve2wI7boRW73otxrvm+BVNp4n97zdWXX24JWxi7sKF3lnNgWf0FNqComzMNqg/Dz/4 dmKXUsCJo+UWD599cZwdZP88QrfhzqvMF+EPssVCk57quDgqsRRnJBpqMRcVJwIAg1KMswIC AAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD034; 1:OVJfXfa2diaeTJ9bnBTkO3klf8rdGpdr/PiRCyKyOdlqh4C7CrG3/KG6rcwmBspzfAFN6VI6kMO6wv/7+NNqAHZP7btmnj9rtIGknkMdH2+/7ZLlAFyRnBWu771vIKBz6mHnDrX0t7n+jA0iZJVufnrACB4mYMgulXEGk7LpwTqrVv65MfwyXF8eraDGU0jkqkow3fK71+AHO3whG0O1JGkeTa3CKHW8eKykF0qZSGs/0eOz4FQ2/jTdn4e7mgOouaXtnfnpkVoZOSjSWpVKoOvN5XpNWf3XFhm2p7K0w9zFqO3UINRh92fM/ROKB+lZiFX8b1AtIfsB9PWt0yQiT4rNJPWdzEtj3MQFVA1mIgqhU7/3jbcgQLDvOPhcixEJqWUwNCVAHsTeZSCMc+l2IS4bMjFUyt1cY2IJ5950fK0= X-Forefront-Antispam-Report: CIP:63.163.107.174; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(77096005)(50466002)(65816999)(86362001)(106466001)(19580395003)(80316001)(19580405001)(36756003)(83506001)(87936001)(76176999)(87266999)(54356999)(229853001)(2950100001)(50986999)(65806001)(23676002)(1096002)(230700001)(65956001)(1220700001)(47776003)(5001960100002)(586003)(2906002)(189998001)(33656002)(4326007)(92566002)(64126003)(4001350100001)(5008740100001)(11100500001)(110136002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB290; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB290; 2:TDBrpI4x7+lMm9iuBEhjr4v0AJic9civHwXjzyWBBZ6MhGjqyAFgfSS4sIe2E4IAtCFl0rtZWht8STpcrNcyqOm1jXBcG9+/nkibxKZMCM+mKQP6qUnaWoKvLSao3M137miJevxs9WTRXGYShyIQHQ==; 3:X7QnjQoU9bnSzn+PuOU6Loh7SeBJBuLmU19sR1ggDfEwW7ttBGRg5ohjlQKPesEY+4FUrerw3GrZ6G3Fc6QKhmx95jG3T7MNpjyAL6W/DIyvLZ2BfXktsfwRilp0weGbpXo2SvxPI+d2FtoI0Du6rEpdJ4yEtAWeaYAklUntOVA1WvV/rFRUSv0o+dFLeSfCqNDGPNOhRzOVdG9cypLPyVEAEFj+J+WHos26MztW7voaKgIQ49JqgOXzzH480lc939FFl5X/wn+tCBly1cxEBA==; 25:iWY+tP0kzqFXskb5pnKN1uXoHVmeE7nq8PdVoBf+jmfioV7Zzqo6pZJvwoLk6Rs2lu5Za5NdoD09aWbPZ7vdO69bnIpdGvQGLwjFXj8QeEHqcGagtQrFuvSwgNsUdIFr5Bsw8XvNaW7CTSGrQx8zperh71csSI1gXXlKv/omXcFsZegiwfj3UJ1VB7PX0s2a06jAbBL028r908p7EU6SSglS4LKoiStcr+mSr6kl6wIo+7cdEreEVK+rWhENdkpB X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BL2PR02MB290; X-MS-Office365-Filtering-Correlation-Id: 7da7edd3-e0c7-4b06-669e-08d32901bf8c X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB290; 20:9la1wfX1X+7m3mDxEhOcAxOc+CiDhRQzp50mAWoYAZVF1yGNiQ4R+ycFAE+Uq35oVo/rE4mFGzzGO4b1x166x9G+G5beQZ8+EmNskGKVPjyxvE/cRii29ESqqXxTcJfk7tvU37w1NBZoX18bIGNyyDR8xRu589kYrZYaJy+2tvdN1Xn/k5QHcHvEGpjYC+fl5V1yZmHeU7hGdpr9g5xvE+yibWUUNP4lSFTzk+6gTwXH9pdQr0WBGr+a2pngEcl0sWjnVn3jGOROPt4g+P1Ehbeh/4y7aGCctNAdwexmWNvtNJRphkC1eXteYfgkstmiRxxTAWF5eI9aIYoBiM58zE9w1bXsI/fotS1eq7JrczjmvskBdJBBkoGmPjTrvj8wmWYvjtj65i3ffGI2udFSpJsBWeLSttg38gS6dy+zBxt/jf01jepduXEKg50khaju2TpiJqzprhiZJTA7j1iACa2ajcoMnq8bt2zp09VWj4foIUPiE3M9IEOLuCZwhk1j X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13017025)(13024025)(13018025)(13023025)(13015025)(3002001)(10201501046); SRVR:BL2PR02MB290; BCL:0; PCL:0; RULEID:; SRVR:BL2PR02MB290; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB290; 4:reQcYb1mqxaYF3Pyf5DMUXlS57DNJReXx6ThgbkT+4bJBigazxq/zbwnsflWFLbVY7Qjk7+t9/gBj6Gu1bWDYVbPY4gfarogZeU3I3kJKG62KhHABQuGO04T67yJphggdbolEi+XtTivMfBj64Ok3astWlodorPvRbvxqRvNYfhWibbgw0nU6SPU9rqo/v4ccCoN9SAUKEz+Y4VRBiOlm6X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diagnostics: 1; BL2PR02MB290; 5:Y+AN6aUz87trG/uyolYbo33bH0Gw3wCdj7C/BqEbhTSHAsFZNBxp/+3Y69cf1zjbpvgC4YN+AUk+/5VCSnSUnqXcrx/QKhkfdWi/xa7RDpZdC1ycjbXG7gsu1eD/+Trw3oQwM/aEakO83+Kp8LdUHQ==; 24:l7H0S20FDj4SJFBgc9DJyuEGgx0HEw9wNmgelyFPSedb0BFnqNfh6TmAy26g1jXMAwFocs2pzhol4XxJlD4WZJcUjJ8l8qCDNvhzwQ2d3rI=; 20:YkBWRjWpKBReCOGx4QRIGOQd8HVWFGrU5otjpc3nBn8A0VxgNPe12Xw8hZA+BhK/qztGlyZX0IHH+q7ZOI6ec1/SqWrXOKcudiZnD6B3lonYbRYBoMtY9NTw6rmRw9B/h2zmXalndnpLtigQw2foeI1tc3m3rmC9XzBPOZgKEInDuAKensvE1eC/sxLX2d7MBgomLtSWp5yhCieLwMygLNMZyCmytk9FtZLW7crkEErbL9ohqD3B4/HnZ1gB4AQU SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 23:13:06.9579 (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.174]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR02MB290 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 The callers of srpt_get_ch_state() can access ch->state safely without using locking. Hence inline this function. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- drivers/infiniband/ulp/srpt/ib_srpt.c | 42 ++++++++++------------------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 0194624..018be38 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -109,17 +109,6 @@ enum dma_data_direction opposite_dma_dir(enum dma_data_direction dir) } } -static enum rdma_ch_state srpt_get_ch_state(struct srpt_rdma_ch *ch) -{ - unsigned long flags; - enum rdma_ch_state state; - - spin_lock_irqsave(&ch->spinlock, flags); - state = ch->state; - spin_unlock_irqrestore(&ch->spinlock, flags); - return state; -} - static enum rdma_ch_state srpt_set_ch_state(struct srpt_rdma_ch *ch, enum rdma_ch_state new_state) { @@ -216,7 +205,7 @@ static void srpt_srq_event(struct ib_event *event, void *ctx) static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch) { pr_debug("QP event %d on cm_id=%p sess_name=%s state=%d\n", - event->event, ch->cm_id, ch->sess_name, srpt_get_ch_state(ch)); + event->event, ch->cm_id, ch->sess_name, ch->state); switch (event->event) { case IB_EVENT_COMM_EST: @@ -228,7 +217,7 @@ static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch) srpt_release_channel(ch); else pr_debug("%s: state %d - ignored LAST_WQE.\n", - ch->sess_name, srpt_get_ch_state(ch)); + ch->sess_name, ch->state); break; default: pr_err("received unrecognized IB QP event %d\n", event->event); @@ -1790,7 +1779,6 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch, struct srpt_send_ioctx *send_ioctx) { struct srp_cmd *srp_cmd; - enum rdma_ch_state ch_state; BUG_ON(!ch); BUG_ON(!recv_ioctx); @@ -1799,13 +1787,12 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch, recv_ioctx->ioctx.dma, srp_max_req_size, DMA_FROM_DEVICE); - ch_state = srpt_get_ch_state(ch); - if (unlikely(ch_state == CH_CONNECTING)) { + if (unlikely(ch->state == CH_CONNECTING)) { list_add_tail(&recv_ioctx->wait_list, &ch->cmd_wait_list); goto out; } - if (unlikely(ch_state != CH_LIVE)) + if (unlikely(ch->state != CH_LIVE)) goto out; srp_cmd = recv_ioctx->ioctx.buf; @@ -1914,7 +1901,7 @@ static void srpt_send_done(struct ib_cq *cq, struct ib_wc *wc) out: while (!list_empty(&ch->cmd_wait_list) && - srpt_get_ch_state(ch) == CH_LIVE && + ch->state == CH_LIVE && (ioctx = srpt_get_send_ioctx(ch)) != NULL) { struct srpt_recv_ioctx *recv_ioctx; @@ -2295,17 +2282,14 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, && param->port == ch->sport->port && param->listen_id == ch->sport->sdev->cm_id && ch->cm_id) { - enum rdma_ch_state ch_state; - - ch_state = srpt_get_ch_state(ch); - if (ch_state != CH_CONNECTING - && ch_state != CH_LIVE) + if (ch->state != CH_CONNECTING + && ch->state != CH_LIVE) continue; /* found an existing channel */ pr_debug("Found existing channel %s" " cm_id= %p state= %d\n", - ch->sess_name, ch->cm_id, ch_state); + ch->sess_name, ch->cm_id, ch->state); __srpt_close_ch(ch); @@ -2556,7 +2540,7 @@ static void srpt_cm_dreq_recv(struct ib_cm_id *cm_id) ch = srpt_find_channel(cm_id->context, cm_id); BUG_ON(!ch); - pr_debug("cm_id= %p ch->state= %d\n", cm_id, srpt_get_ch_state(ch)); + pr_debug("cm_id= %p ch->state= %d\n", cm_id, ch->state); spin_lock_irqsave(&ch->spinlock, flags); switch (ch->state) { @@ -2748,7 +2732,6 @@ static int srpt_write_pending(struct se_cmd *se_cmd) struct srpt_rdma_ch *ch; struct srpt_send_ioctx *ioctx; enum srpt_command_state new_state; - enum rdma_ch_state ch_state; int ret; ioctx = container_of(se_cmd, struct srpt_send_ioctx, cmd); @@ -2759,10 +2742,9 @@ static int srpt_write_pending(struct se_cmd *se_cmd) ch = ioctx->ch; BUG_ON(!ch); - ch_state = srpt_get_ch_state(ch); - switch (ch_state) { + switch (ch->state) { case CH_CONNECTING: - WARN(true, "unexpected channel state %d\n", ch_state); + WARN(true, "unexpected channel state %d\n", ch->state); ret = -EINVAL; goto out; case CH_LIVE: @@ -3228,7 +3210,7 @@ static void srpt_close_session(struct se_session *se_sess) ch = se_sess->fabric_sess_ptr; WARN_ON(ch->sess != se_sess); - pr_debug("ch %p state %d\n", ch, srpt_get_ch_state(ch)); + pr_debug("ch %p state %d\n", ch, ch->state); sdev = ch->sport->sdev; spin_lock_irq(&sdev->spinlock);