From patchwork Thu Feb 11 19:04:43 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: 8284531 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 7242E9F38B for ; Thu, 11 Feb 2016 19:04:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5696A20221 for ; Thu, 11 Feb 2016 19:04:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 250FC20121 for ; Thu, 11 Feb 2016 19:04:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750812AbcBKTEr (ORCPT ); Thu, 11 Feb 2016 14:04:47 -0500 Received: from mail-by2on0085.outbound.protection.outlook.com ([207.46.100.85]:30784 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750735AbcBKTEq (ORCPT ); Thu, 11 Feb 2016 14:04:46 -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=YHVP/JlYHjFphpGvqiY84LZSQjj39+JNq42trdyD7wc=; b=u2tdxNl62JNhNQqZYdQHzv5jDj0pVWgQkf6+372XVmLeJBenesTLu8DyIDtEbLS37993s/IilQnqNjjtCbIp/PnETVZOUvJlAPZx0uMiBWDwSKvf/AQOIAUnjwjAma6uX+NePnA1xSDK0L6wCZBtmAx7EAi/Aj8bys8ODfIJVys= Received: from BN1PR02CA0049.namprd02.prod.outlook.com (10.141.56.49) by BLUPR02MB294.namprd02.prod.outlook.com (10.141.77.18) with Microsoft SMTP Server (TLS) id 15.1.403.16; Thu, 11 Feb 2016 19:04:44 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::186) by BN1PR02CA0049.outlook.office365.com (2a01:111:e400:2a::49) with Microsoft SMTP Server (TLS) id 15.1.403.16 via Frontend Transport; Thu, 11 Feb 2016 19:04:44 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.174) smtp.mailfrom=sandisk.com; intel.com; dkim=none (message not signed) header.d=none;intel.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 BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) with Microsoft SMTP Server id 15.1.415.6 via Frontend Transport; Thu, 11 Feb 2016 19:04:44 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id 51.2E.03682.B4BDCB65; Thu, 11 Feb 2016 11:04:43 -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.248.2; Thu, 11 Feb 2016 11:04:43 -0800 X-AuditID: ac160a69-d23ff70000000e62-64-56bcdb4b61e3 Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 9F.73.03361.B4BDCB65; Thu, 11 Feb 2016 11:04:43 -0800 (PST) Subject: [PATCH v4 05/21] IB/srpt: Inline srpt_get_ch_state() To: Doug Ledford References: <56BCDAAD.7030906@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56BCDB4B.1090904@sandisk.com> Date: Thu, 11 Feb 2016 11:04:43 -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: <56BCDAAD.7030906@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKLMWRmVeSWpSXmKPExsWyRoxnka737T1hBou7LS0uPP3OZPHy/AdW i5WrjzJZPDvUy2Jxo+0BmwOrx+I9L5k8dt9sYPN4Nv0wk8f7fVfZPD5vkgtgjeKySUnNySxL LdK3S+DKWDX1NGPBbPWKR7PPszcwvpDvYuTkkBAwkXi19BZTFyMXh5DAJkaJh0s2sEM4Oxgl ll08xwZT1bN2LzNEYg6jxOnLd4BaODiEBWwlVr21B6kREVCT2PRqETuILSSgJfG8v58VpJ5Z YBWjxKar18ESbAJGEt/ez2QB6eUFKto0JxYkzCKgKvGgdTMTiC0qECFxuLMLrJxXQFDi5Mwn YOWcAtoSM69EgJjMApoS63fpg1QwC8hLbH87B+wyCYGDrBKb9pxjhThBXeLkkvlMExiFZyGZ NAuhfRaS9gWMzKsYxXIzc4pz01MLDI30ihPzUjKLs/WS83M3MYIjgytzB+OKSeaHGAU4GJV4 eA1u7QkTYk0sK67MPcQowcGsJMJ7fxNQiDclsbIqtSg/vqg0J7X4EKM0B4uSOK91i1qYkEB6 YklqdmpqQWoRTJaJg1OqgTGHcaZIU34Pb+ARloLVC5+2XOTlrYkVm1fKqajDtuPh0l2vozZn FoqqOTVpf2NMS50oPV1g7eddLyZPXvbsosW1xjNMTGan7iw/vVDy69xDT28pnvFWNt79Nbgn O3aS4vZYPf2DFZt9n0YzFouxCrYHPE2T3XJ7WTtzraeNm6XNFWGT1oKNnUosxRmJhlrMRcWJ AHJ68BeIAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDJMWRmVeSWpSXmKPExsXCtZEjRdf79p4wgwsrlS0uPP3OZPHy/AdW i5WrjzJZPDvUy2Jxo+0BmwOrx+I9L5k8dt9sYPN4Nv0wk8f7fVfZPD5vkg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yDBCKcQu/ X-Forefront-Antispam-Report: CIP:63.163.107.174; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(3190300001)(199003)(189002)(64126003)(2950100001)(11100500001)(586003)(230700001)(23676002)(1220700001)(65806001)(65956001)(87936001)(59896002)(5008740100001)(33656002)(47776003)(229853001)(77096005)(4001350100001)(36756003)(83506001)(4326007)(1096002)(54356999)(87266999)(76176999)(5001960100002)(50466002)(92566002)(19580405001)(50986999)(2906002)(65816999)(80316001)(19580395003)(189998001)(86362001)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB294; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB294; 2:6khQlh9TET8d3SSTdpQWPg9lgQ/VaPzmUi4txmxzNaA5gUnKZGNVBWZg2qS7eccyRgzp8hUzy8JzpzWVUIN5SCahuHgo14tqzTsnNgLRZnsdLZVid2rIFj79nfqmqeU1KkaZVMrFegBiqsnZLH0+yQ==; 3:/CJiYvQZiIOUoWcUTn0pXcJdTjxzGgJvmnG1R/JIVPJm7BHwJb0QZoTUCjcYEJ91A+3uDZadLscLTmU0LYdRVDbKOpLx6mY6fbMzsGlY1gysPG39FMi68fh8cuRXkf77aWNloeIvv8nomqjtftEoI5/5oTquy1s6zZuwG/hVN2VyzzzoWT6BxPNkmOL3lFyUmMPaLNyGKTOJHoi5CBQXrAc3Oj0iJxlqXn4QqdJjPytuxGXnh2UhlXlPwDC+66ZJkHbNyPtznhQa3V8HSWj4vw==; 25:YHSgUS2IeX2f+ILxeMKio1BE5nEx/JdnKGwl1RPZZ+FVu7i7IQmN2h0n3pqx1+LXeCU/wvVBelTQjDePke4XNCZlOW5XhKaQD0Nxtu7tr3gg+fNXsTwBkZK9gnkSLnuTGsgU3pVAHrQsvx3RwHGp35j8xt5x6tRMHuANoDNMiCgVCYSSNuXzdWA5se/kz9458zsGl4r/W1f5OPIhjftl1ZM1UY/RzUIJQk8JfUg82Izo/16fTFTgeUl6F7fF8Snesurk9LqkH+5JHwvx4xn11CbbXQcpAqf+0Y5lAvIICYcFHAnPsZH90bkwFCuoF1+A X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BLUPR02MB294; X-MS-Office365-Filtering-Correlation-Id: da156634-8a74-45c9-ff6c-08d3331633c8 X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB294; 20:2gzbTdsfEtLbCprkIt2VNlNV76qfAgc69hkUMUG4FpLDfKQ79H3RhuH5raOS6h1NldVADBEmH3s2wwrADQeug9l+sAR13Wa31G+8iJFe6D+FIB40QgMkVsRcdbBmV6sYlitqU5sf2MVWBnZM6osyiJ5qRGV9cAirQmSIJR8H00qxWOHmCNwCfn7C8BA/93+0WRgZdmoRBRpJVbehan1cAu3Cuqxg86przh7Qaw6ZQW9kTHMIOmhCh8Q0hv/3Lh3+YtV9PGJNSNkcU2/bc5ObVmRoc6eHBAcqptMfeXLz+VURDSigXlZ+PU0m59dvpjjMmBElMf9fgxk4tkc5FJsvEmAU5wIrE3LBq9CBZsXGAkAM8mJM+aWaTVUugt5po9/3mcdQDevGQby3kMNnRz6M8Mwm6DsOsPeI2U1dzTENV9M/aj5dy8SgnBWaNwGS7lxC9J4eUR9keFiE3VooLGaqsaXoM9hibtgfD8Z1T5WpdMvbJ7SQQLrnulYRoWPZqoDz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(5005006)(13024025)(13015025)(8121501046)(13023025)(13018025)(3002001)(10201501046); SRVR:BLUPR02MB294; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB294; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB294; 4:TFFQVMZZyiaDD6LeI7vHX3ogu45vhsZdyThdQGkud1yf6wP+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cXBSSFRZMFU4TEpHcnFG?= =?utf-8?B?RXNvdWVQSGtvMHY0WFBpbUpRYUhhRys0eDViL1ptZFlkVi90UHkwTThDUXJn?= =?utf-8?B?ckp4QUJSeWsrUnJwOUlmRHB0QThLTDA3QlRNUjNNRDN1aTVJMEVKYWVaUFNz?= =?utf-8?B?YUNRPT0=?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB294; 5:ai6FAaR9eY4K60aXGFlOJBYZC8PQMT5nGW2l4Q33Hmol8RsK+gEFGt7IJ+F9puSMUDsct8zevlNU+EPWE81Iwif8IDoiWAIwnaXWtRo+j2KlHXwOZiNBptR7Gk1PVOjPpPfZwO0z9zdQ07t5bYWYjw==; 24:fKefQH26TUdBGe8ReQqcXInUZ21jqOXf7K2Sj0QIwQE496KRoVtOo9OpcSp4WRN2iRmEjrAGxoIfEV98vXc1VhTqqky/757DQjrlVfrLxNs=; 20:D8XrRQdoFAhiwEatIuYsqw3b9idiTjrr/sZC96EaI8+QXrkisfuroEi4CIgQC/j+WhUA0mZ6I2ViTRBo438Wh4mYlIHhCqLFNCA1t9TYYH0HQOiwgxFYQsrVtW7ld4g3hZYSXUtlBX1vbGvjJx9cxH3eu0+VpAeF5scGsgkVFA3ipoR9XRLYWS3TrVT8TOB5pZ2ARxgvdPoi21FB6lvuZ0FdGy8LCetZHkdi/cNqfoMKBxgriqf+6DTwwr/mwHke SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2016 19:04:44.0011 (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: BLUPR02MB294 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 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 Cc: Alex Estrin --- 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 babc15b..6d1a137 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); @@ -1733,7 +1722,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); @@ -1742,13 +1730,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; @@ -1857,7 +1844,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; @@ -2238,17 +2225,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); @@ -2499,7 +2483,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) { @@ -2691,7 +2675,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); @@ -2702,10 +2685,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: @@ -3171,7 +3153,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);