Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755421AbbKRJP7 (ORCPT ); Wed, 18 Nov 2015 04:15:59 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34759 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754045AbbKRJPm (ORCPT ); Wed, 18 Nov 2015 04:15:42 -0500 Subject: Re: [PATCH 4/9] srpt: chain RDMA READ/WRITE requests To: Bart Van Assche , Christoph Hellwig , linux-rdma@vger.kernel.org References: <1447422410-20891-1-git-send-email-hch@lst.de> <1447422410-20891-5-git-send-email-hch@lst.de> <564BD1AF.60200@sandisk.com> Cc: axboe@fb.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org From: Sagi Grimberg Message-ID: <564C41B8.2080904@dev.mellanox.co.il> Date: Wed, 18 Nov 2015 11:15:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564BD1AF.60200@sandisk.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2057 Lines: 51 On 18/11/2015 03:17, Bart Van Assche wrote: > On 11/13/2015 05:46 AM, Christoph Hellwig wrote: >> - ret = ib_post_send(ch->qp, &wr.wr, &bad_wr); >> - if (ret) >> - break; >> + if (i == n_rdma - 1) { >> + /* only get completion event for the last rdma read */ >> + if (dir == DMA_TO_DEVICE) >> + wr->wr.send_flags = IB_SEND_SIGNALED; >> + wr->wr.next = NULL; >> + } else { >> + wr->wr.next = &ioctx->rdma_ius[i + 1].wr; >> + } >> } >> >> + ret = ib_post_send(ch->qp, &ioctx->rdma_ius->wr, &bad_wr); >> if (ret) >> pr_err("%s[%d]: ib_post_send() returned %d for %d/%d\n", >> __func__, __LINE__, ret, i, n_rdma); > > Hello Christoph, Hi Bart, > > Chaining RDMA requests is a great idea. But it seems to me that this > patch is based on the assumption that posting multiple RDMA requests > either succeeds as a whole or fails as a whole. Sorry but I'm not sure > that the verbs API guarantees this. In the ib_srpt driver a QP can be > changed at any time into the error state and there might be drivers that > report an immediate failure in that case. I'm not so sure it actually matters if some WRs succeeded. In the normal flow when srpt has enough available work requests (sq_wr_avail) they should all succeed otherwise we're in trouble. If the QP transitioned to ERROR state, then some failed, but those that succeeded will generate flush completions, and srpt should handle it correctly shouldn't it? > I think even when chaining > RDMA requests that we still need a mechanism to wait until ongoing RDMA > transfers have finished if some but not all RDMA requests have been posted. I'm not an expert on srpt, can you explain how this mechanism will help? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/