Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbdHBURI (ORCPT ); Wed, 2 Aug 2017 16:17:08 -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 x-originating-ip: 107.180.71.197 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1144 Lines: 37 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; -- 2.7.4