From patchwork Wed Aug 2 20:10:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9877635 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 7185A60360 for ; Wed, 2 Aug 2017 20:22:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 620982856D for ; Wed, 2 Aug 2017 20:22:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 557B9287A8; Wed, 2 Aug 2017 20:22:43 +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 F03402856D for ; Wed, 2 Aug 2017 20:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbdHBUWO (ORCPT ); Wed, 2 Aug 2017 16:22:14 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:56584 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981AbdHBUMY (ORCPT ); Wed, 2 Aug 2017 16:12:24 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id czzHdRhD0hEkZczzHdWmnt; 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 1dczzH-0005Gu-Ca; Wed, 02 Aug 2017 13:11:23 -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] 12/37] [CIFS] SMBD: Handle send completion from CQ Date: Wed, 2 Aug 2017 13:10:23 -0700 Message-Id: <1501704648-20159-13-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: MS4wfLSz2A45cJVIT0DFJ7nuOvb0c5pEo4KOXo+l5y34B2aex66k3NoSHbIxqOAk9KFYVNTuBL9zpwDXjZdTN5ro4YS/IlENVWl17mXNGa2tOWOW6MUbXqVs DoEV/de+FAQ/N/zyS57gvq52Ks3ILnFSVMTlwC/4uUCSQM4JJ5V+dFUI3NIAgasoATJZQEG44vbrBlTI4Xl+xUIaqZFY4urLbfGUmkMKV03HES+2t6eCkXoA tzuV+BgSCZyajMLv2VeSGhBAY/uzE9YGLn751FTOWBnnX2r7KxvdTzj2BSyGW4vwfd7ijex7qdeBzOE4+midzig+rk1hJ9ykJca15gB0rPo= 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 In preparation for handling sending SMBD requests, add code to handle the send completion. In send complemention, the SMBD transport is responsible for freeing resources used in send. Signed-off-by: Long Li --- fs/cifs/cifsrdma.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/fs/cifs/cifsrdma.c b/fs/cifs/cifsrdma.c index 20237b7..ecbc832 100644 --- a/fs/cifs/cifsrdma.c +++ b/fs/cifs/cifsrdma.c @@ -197,6 +197,31 @@ cifs_rdma_qp_async_error_upcall(struct ib_event *event, void *context) } } +/* Called in softirq, when a RDMA send is donea */ +static void send_done(struct ib_cq *cq, struct ib_wc *wc) +{ + int i; + struct cifs_rdma_request *request = + container_of(wc->wr_cqe, struct cifs_rdma_request, cqe); + + log_rdma_send("cifs_rdma_request %p completed wc->status=%d\n", + request, wc->status); + + if (wc->status != IB_WC_SUCCESS || wc->opcode != IB_WC_SEND) { + log_rdma_send("wc->status=%d wc->opcode=%d\n", + wc->status, wc->opcode); + } + + for (i=0; inum_sge; i++) + ib_dma_unmap_single(request->info->id->device, + request->sge[i].addr, + request->sge[i].length, + DMA_TO_DEVICE); + + kfree(request->sge); + mempool_free(request, request->info->request_mempool); +} + /* Called from softirq, when recv is done */ static void recv_done(struct ib_cq *cq, struct ib_wc *wc) {