From patchwork Wed Aug 2 20:10:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9877571 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 185EB60360 for ; Wed, 2 Aug 2017 20:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A612286BB for ; Wed, 2 Aug 2017 20:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3324287F8; Wed, 2 Aug 2017 20:17:58 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 95AB6286BB for ; Wed, 2 Aug 2017 20:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753194AbdHBURG (ORCPT ); Wed, 2 Aug 2017 16:17:06 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:50852 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753018AbdHBUMZ (ORCPT ); Wed, 2 Aug 2017 16:12:25 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id czzEdALVbP2LIczzEdEdrW; Wed, 02 Aug 2017 13:11:23 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dczzE-0005Gi-Oi; Wed, 02 Aug 2017 13:11:20 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [[PATCH v1] 10/37] [CIFS] SMBD: Introduce wait queue when sending SMBD request Date: Wed, 2 Aug 2017 13:10:21 -0700 Message-Id: <1501704648-20159-11-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfJzJqxxyELfUPnhAhTmldre6xss+33ppDHdXq/FvwBjK8wkc84D4KMXYvHrfoxthBPKf7VQ+U7/8sPIzq1kIaPh+0s4ewgSpQwqdxvaHgQ0wgtBrlR+R jUE1Y7wE1jp6jeOOed350RUhNxkjJURBnwlHo7bElPfPJK1LLIr/kqkydsZi33mh2E+unhTEUDd/qVw9MTedymCu7uzXnyO7Fk6rhKMaV6M88NZ1oGT+1PJx tMXUP/5azO86XiNKy6FhNZQrLHq/V2wtxGc3EleYyYRMgvb6QCR54bfukXk2/NVRQ8MZSx27X8WrC+okltk4dX7mYcWrOrBOZnSfs2NZtZI= Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li Define wait queue in preparation for implement SMBD send. SMBD uses credit based flow control system, if the client doesn't have enough credits then it must wait for credits. Signed-off-by: Long Li --- fs/cifs/cifsrdma.c | 1 + fs/cifs/cifsrdma.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fs/cifs/cifsrdma.c b/fs/cifs/cifsrdma.c index 9610897..8aa8a47 100644 --- a/fs/cifs/cifsrdma.c +++ b/fs/cifs/cifsrdma.c @@ -484,6 +484,7 @@ struct cifs_rdma_info* cifs_create_rdma_session( mempool_free_slab, info->response_cache); allocate_receive_buffers(info, info->receive_credit_max); + init_waitqueue_head(&info->wait_send_queue); out2: rdma_destroy_id(info->id); diff --git a/fs/cifs/cifsrdma.h b/fs/cifs/cifsrdma.h index e925aa4..287b5b1 100644 --- a/fs/cifs/cifsrdma.h +++ b/fs/cifs/cifsrdma.h @@ -62,6 +62,8 @@ struct cifs_rdma_info { struct list_head receive_queue; spinlock_t receive_queue_lock; + wait_queue_head_t wait_send_queue; + // request pool for RDMA send struct kmem_cache *request_cache; mempool_t *request_mempool;