Lines Matching +full:dma +full:- +full:write

1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (c) 2016-2018 Oracle. All rights reserved.
5 * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved.
10 * COPYING in the main directory of this source tree, or the BSD-type
50 * The passed-in svc_rqst contains a struct xdr_buf which holds an
51 * XDR-encoded RPC Reply message. sendto must construct the RPC-over-RDMA
52 * transport header, post all Write WRs needed for this Reply, then post
70 * when it completes, it is guaranteed that all previous Write WRs have
73 * Write WRs are constructed and posted. Each Write segment gets its own
74 * svc_rdma_rw_ctxt, allowing the Write completion handler to find and
75 * DMA-unmap the pages under I/O for that Write segment. The Write
86 * Completion Queue do not run in parallel. Otherwise a Write completion
88 * are still DMA-mapped.
92 * - If the Send WR is posted successfully, it will either complete
95 * - If the Send WR cannot be not posted, the forward path releases
99 * where two different Write segments send portions of the same page.
119 int node = ibdev_to_node(rdma->sc_cm_id->device); in svc_rdma_send_ctxt_alloc()
125 ctxt = kzalloc_node(struct_size(ctxt, sc_sges, rdma->sc_max_send_sges), in svc_rdma_send_ctxt_alloc()
129 buffer = kmalloc_node(rdma->sc_max_req_size, GFP_KERNEL, node); in svc_rdma_send_ctxt_alloc()
132 addr = ib_dma_map_single(rdma->sc_pd->device, buffer, in svc_rdma_send_ctxt_alloc()
133 rdma->sc_max_req_size, DMA_TO_DEVICE); in svc_rdma_send_ctxt_alloc()
134 if (ib_dma_mapping_error(rdma->sc_pd->device, addr)) in svc_rdma_send_ctxt_alloc()
137 svc_rdma_send_cid_init(rdma, &ctxt->sc_cid); in svc_rdma_send_ctxt_alloc()
139 ctxt->sc_rdma = rdma; in svc_rdma_send_ctxt_alloc()
140 ctxt->sc_send_wr.next = NULL; in svc_rdma_send_ctxt_alloc()
141 ctxt->sc_send_wr.wr_cqe = &ctxt->sc_cqe; in svc_rdma_send_ctxt_alloc()
142 ctxt->sc_send_wr.sg_list = ctxt->sc_sges; in svc_rdma_send_ctxt_alloc()
143 ctxt->sc_send_wr.send_flags = IB_SEND_SIGNALED; in svc_rdma_send_ctxt_alloc()
144 ctxt->sc_cqe.done = svc_rdma_wc_send; in svc_rdma_send_ctxt_alloc()
145 ctxt->sc_xprt_buf = buffer; in svc_rdma_send_ctxt_alloc()
146 xdr_buf_init(&ctxt->sc_hdrbuf, ctxt->sc_xprt_buf, in svc_rdma_send_ctxt_alloc()
147 rdma->sc_max_req_size); in svc_rdma_send_ctxt_alloc()
148 ctxt->sc_sges[0].addr = addr; in svc_rdma_send_ctxt_alloc()
150 for (i = 0; i < rdma->sc_max_send_sges; i++) in svc_rdma_send_ctxt_alloc()
151 ctxt->sc_sges[i].lkey = rdma->sc_pd->local_dma_lkey; in svc_rdma_send_ctxt_alloc()
163 * svc_rdma_send_ctxts_destroy - Release all send_ctxt's for an xprt
172 while ((node = llist_del_first(&rdma->sc_send_ctxts)) != NULL) { in svc_rdma_send_ctxts_destroy()
174 ib_dma_unmap_single(rdma->sc_pd->device, in svc_rdma_send_ctxts_destroy()
175 ctxt->sc_sges[0].addr, in svc_rdma_send_ctxts_destroy()
176 rdma->sc_max_req_size, in svc_rdma_send_ctxts_destroy()
178 kfree(ctxt->sc_xprt_buf); in svc_rdma_send_ctxts_destroy()
184 * svc_rdma_send_ctxt_get - Get a free send_ctxt
187 * Returns a ready-to-use send_ctxt, or NULL if none are
195 spin_lock(&rdma->sc_send_lock); in svc_rdma_send_ctxt_get()
196 node = llist_del_first(&rdma->sc_send_ctxts); in svc_rdma_send_ctxt_get()
197 spin_unlock(&rdma->sc_send_lock); in svc_rdma_send_ctxt_get()
204 rpcrdma_set_xdrlen(&ctxt->sc_hdrbuf, 0); in svc_rdma_send_ctxt_get()
205 xdr_init_encode(&ctxt->sc_stream, &ctxt->sc_hdrbuf, in svc_rdma_send_ctxt_get()
206 ctxt->sc_xprt_buf, NULL); in svc_rdma_send_ctxt_get()
208 svc_rdma_cc_init(rdma, &ctxt->sc_reply_info.wi_cc); in svc_rdma_send_ctxt_get()
209 ctxt->sc_send_wr.num_sge = 0; in svc_rdma_send_ctxt_get()
210 ctxt->sc_cur_sge_no = 0; in svc_rdma_send_ctxt_get()
211 ctxt->sc_page_count = 0; in svc_rdma_send_ctxt_get()
212 ctxt->sc_wr_chain = &ctxt->sc_send_wr; in svc_rdma_send_ctxt_get()
213 ctxt->sc_sqecount = 1; in svc_rdma_send_ctxt_get()
227 struct ib_device *device = rdma->sc_cm_id->device; in svc_rdma_send_ctxt_release()
232 if (ctxt->sc_page_count) in svc_rdma_send_ctxt_release()
233 release_pages(ctxt->sc_pages, ctxt->sc_page_count); in svc_rdma_send_ctxt_release()
238 for (i = 1; i < ctxt->sc_send_wr.num_sge; i++) { in svc_rdma_send_ctxt_release()
239 trace_svcrdma_dma_unmap_page(&ctxt->sc_cid, in svc_rdma_send_ctxt_release()
240 ctxt->sc_sges[i].addr, in svc_rdma_send_ctxt_release()
241 ctxt->sc_sges[i].length); in svc_rdma_send_ctxt_release()
243 ctxt->sc_sges[i].addr, in svc_rdma_send_ctxt_release()
244 ctxt->sc_sges[i].length, in svc_rdma_send_ctxt_release()
248 llist_add(&ctxt->sc_node, &rdma->sc_send_ctxts); in svc_rdma_send_ctxt_release()
256 svc_rdma_send_ctxt_release(ctxt->sc_rdma, ctxt); in svc_rdma_send_ctxt_put_async()
260 * svc_rdma_send_ctxt_put - Return send_ctxt to free list
264 * Pages left in sc_pages are DMA unmapped and released.
269 INIT_WORK(&ctxt->sc_work, svc_rdma_send_ctxt_put_async); in svc_rdma_send_ctxt_put()
270 queue_work(svcrdma_wq, &ctxt->sc_work); in svc_rdma_send_ctxt_put()
274 * svc_rdma_wake_send_waiters - manage Send Queue accounting
281 atomic_add(avail, &rdma->sc_sq_avail); in svc_rdma_wake_send_waiters()
283 if (unlikely(waitqueue_active(&rdma->sc_send_wait))) in svc_rdma_wake_send_waiters()
284 wake_up(&rdma->sc_send_wait); in svc_rdma_wake_send_waiters()
288 * svc_rdma_wc_send - Invoked by RDMA provider for each polled Send WC
297 struct svcxprt_rdma *rdma = cq->cq_context; in svc_rdma_wc_send()
298 struct ib_cqe *cqe = wc->wr_cqe; in svc_rdma_wc_send()
302 svc_rdma_wake_send_waiters(rdma, ctxt->sc_sqecount); in svc_rdma_wc_send()
304 if (unlikely(wc->status != IB_WC_SUCCESS)) in svc_rdma_wc_send()
307 trace_svcrdma_wc_send(&ctxt->sc_cid); in svc_rdma_wc_send()
312 if (wc->status != IB_WC_WR_FLUSH_ERR) in svc_rdma_wc_send()
313 trace_svcrdma_wc_send_err(wc, &ctxt->sc_cid); in svc_rdma_wc_send()
315 trace_svcrdma_wc_send_flush(wc, &ctxt->sc_cid); in svc_rdma_wc_send()
317 svc_xprt_deferred_close(&rdma->sc_xprt); in svc_rdma_wc_send()
321 * svc_rdma_post_send - Post a WR chain to the Send Queue
336 * %-ENOTCONN: The connection was lost
341 struct ib_send_wr *first_wr = ctxt->sc_wr_chain; in svc_rdma_post_send()
342 struct ib_send_wr *send_wr = &ctxt->sc_send_wr; in svc_rdma_post_send()
344 struct rpc_rdma_cid cid = ctxt->sc_cid; in svc_rdma_post_send()
345 int ret, sqecount = ctxt->sc_sqecount; in svc_rdma_post_send()
350 ib_dma_sync_single_for_device(rdma->sc_pd->device, in svc_rdma_post_send()
351 send_wr->sg_list[0].addr, in svc_rdma_post_send()
352 send_wr->sg_list[0].length, in svc_rdma_post_send()
356 while (!test_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags)) { in svc_rdma_post_send()
357 if (atomic_sub_return(sqecount, &rdma->sc_sq_avail) < 0) { in svc_rdma_post_send()
368 wait_event(rdma->sc_send_wait, in svc_rdma_post_send()
369 atomic_read(&rdma->sc_sq_avail) > 0); in svc_rdma_post_send()
375 ret = ib_post_send(rdma->sc_qp, first_wr, &bad_wr); in svc_rdma_post_send()
378 svc_xprt_deferred_close(&rdma->sc_xprt); in svc_rdma_post_send()
390 return -ENOTCONN; in svc_rdma_post_send()
394 * svc_rdma_encode_read_list - Encode RPC Reply's Read chunk list
400 * %-EMSGSIZE on XDR buffer overflow
404 /* RPC-over-RDMA version 1 replies never have a Read list. */ in svc_rdma_encode_read_list()
405 return xdr_stream_encode_item_absent(&sctxt->sc_stream); in svc_rdma_encode_read_list()
409 * svc_rdma_encode_write_segment - Encode one Write segment
411 * @chunk: Write chunk to push
412 * @remaining: remaining bytes of the payload left in the Write chunk
417 * that was consumed by the Write segment, and updates @remaining
418 * %-EMSGSIZE on XDR buffer overflow
424 const struct svc_rdma_segment *segment = &chunk->ch_segments[segno]; in svc_rdma_encode_write_segment()
429 p = xdr_reserve_space(&sctxt->sc_stream, len); in svc_rdma_encode_write_segment()
431 return -EMSGSIZE; in svc_rdma_encode_write_segment()
433 length = min_t(u32, *remaining, segment->rs_length); in svc_rdma_encode_write_segment()
434 *remaining -= length; in svc_rdma_encode_write_segment()
435 xdr_encode_rdma_segment(p, segment->rs_handle, length, in svc_rdma_encode_write_segment()
436 segment->rs_offset); in svc_rdma_encode_write_segment()
437 trace_svcrdma_encode_wseg(sctxt, segno, segment->rs_handle, length, in svc_rdma_encode_write_segment()
438 segment->rs_offset); in svc_rdma_encode_write_segment()
443 * svc_rdma_encode_write_chunk - Encode one Write chunk
445 * @chunk: Write chunk to push
447 * Copy a Write chunk from the Call transport header to the
453 * that was consumed by the Write chunk
454 * %-EMSGSIZE on XDR buffer overflow
459 u32 remaining = chunk->ch_payload_length; in svc_rdma_encode_write_chunk()
464 ret = xdr_stream_encode_item_present(&sctxt->sc_stream); in svc_rdma_encode_write_chunk()
469 ret = xdr_stream_encode_u32(&sctxt->sc_stream, chunk->ch_segcount); in svc_rdma_encode_write_chunk()
474 for (segno = 0; segno < chunk->ch_segcount; segno++) { in svc_rdma_encode_write_chunk()
485 * svc_rdma_encode_write_list - Encode RPC Reply's Write chunk list
491 * that was consumed by the Reply's Write list
492 * %-EMSGSIZE on XDR buffer overflow
501 pcl_for_each_chunk(chunk, &rctxt->rc_write_pcl) { in svc_rdma_encode_write_list()
508 /* Terminate the Write list */ in svc_rdma_encode_write_list()
509 ret = xdr_stream_encode_item_absent(&sctxt->sc_stream); in svc_rdma_encode_write_list()
517 * svc_rdma_encode_reply_chunk - Encode RPC Reply's Reply chunk
525 * %-EMSGSIZE on XDR buffer overflow
526 * %-E2BIG if the RPC message is larger than the Reply chunk
535 if (pcl_is_empty(&rctxt->rc_reply_pcl)) in svc_rdma_encode_reply_chunk()
536 return xdr_stream_encode_item_absent(&sctxt->sc_stream); in svc_rdma_encode_reply_chunk()
538 chunk = pcl_first_chunk(&rctxt->rc_reply_pcl); in svc_rdma_encode_reply_chunk()
539 if (length > chunk->ch_length) in svc_rdma_encode_reply_chunk()
540 return -E2BIG; in svc_rdma_encode_reply_chunk()
542 chunk->ch_payload_length = length; in svc_rdma_encode_reply_chunk()
552 * svc_rdma_page_dma_map - DMA map one page
554 * @page: struct page to DMA map
559 * %0 if DMA mapping was successful
560 * %-EIO if the page cannot be DMA mapped
566 struct svcxprt_rdma *rdma = args->md_rdma; in svc_rdma_page_dma_map()
567 struct svc_rdma_send_ctxt *ctxt = args->md_ctxt; in svc_rdma_page_dma_map()
568 struct ib_device *dev = rdma->sc_cm_id->device; in svc_rdma_page_dma_map()
571 ++ctxt->sc_cur_sge_no; in svc_rdma_page_dma_map()
577 trace_svcrdma_dma_map_page(&ctxt->sc_cid, dma_addr, len); in svc_rdma_page_dma_map()
578 ctxt->sc_sges[ctxt->sc_cur_sge_no].addr = dma_addr; in svc_rdma_page_dma_map()
579 ctxt->sc_sges[ctxt->sc_cur_sge_no].length = len; in svc_rdma_page_dma_map()
580 ctxt->sc_send_wr.num_sge++; in svc_rdma_page_dma_map()
584 trace_svcrdma_dma_map_err(&ctxt->sc_cid, dma_addr, len); in svc_rdma_page_dma_map()
585 return -EIO; in svc_rdma_page_dma_map()
589 * svc_rdma_iov_dma_map - DMA map an iovec
591 * @iov: kvec to DMA map
594 * handles DMA-unmap and it uses ib_dma_unmap_page() exclusively.
597 * %0 if DMA mapping was successful
598 * %-EIO if the iovec cannot be DMA mapped
602 if (!iov->iov_len) in svc_rdma_iov_dma_map()
604 return svc_rdma_page_dma_map(data, virt_to_page(iov->iov_base), in svc_rdma_iov_dma_map()
605 offset_in_page(iov->iov_base), in svc_rdma_iov_dma_map()
606 iov->iov_len); in svc_rdma_iov_dma_map()
610 * svc_rdma_xb_dma_map - DMA map all segments of an xdr_buf
615 * %0 if DMA mapping was successful
616 * %-EIO if DMA mapping failed
618 * On failure, any DMA mappings that have been already done must be
628 ret = svc_rdma_iov_dma_map(data, &xdr->head[0]); in svc_rdma_xb_dma_map()
632 ppages = xdr->pages + (xdr->page_base >> PAGE_SHIFT); in svc_rdma_xb_dma_map()
633 pageoff = offset_in_page(xdr->page_base); in svc_rdma_xb_dma_map()
634 remaining = xdr->page_len; in svc_rdma_xb_dma_map()
636 len = min_t(u32, PAGE_SIZE - pageoff, remaining); in svc_rdma_xb_dma_map()
642 remaining -= len; in svc_rdma_xb_dma_map()
646 ret = svc_rdma_iov_dma_map(data, &xdr->tail[0]); in svc_rdma_xb_dma_map()
650 return xdr->len; in svc_rdma_xb_dma_map()
660 * svc_rdma_xb_count_sges - Count how many SGEs will be needed
674 if (xdr->head[0].iov_len) in svc_rdma_xb_count_sges()
675 ++args->pd_num_sges; in svc_rdma_xb_count_sges()
677 offset = offset_in_page(xdr->page_base); in svc_rdma_xb_count_sges()
678 remaining = xdr->page_len; in svc_rdma_xb_count_sges()
680 ++args->pd_num_sges; in svc_rdma_xb_count_sges()
681 remaining -= min_t(u32, PAGE_SIZE - offset, remaining); in svc_rdma_xb_count_sges()
685 if (xdr->tail[0].iov_len) in svc_rdma_xb_count_sges()
686 ++args->pd_num_sges; in svc_rdma_xb_count_sges()
688 args->pd_length += xdr->len; in svc_rdma_xb_count_sges()
693 * svc_rdma_pull_up_needed - Determine whether to use pull-up
696 * @write_pcl: Write chunk list provided by client
700 * %true if pull-up must be used
710 .pd_length = sctxt->sc_hdrbuf.len, in svc_rdma_pull_up_needed()
722 return args.pd_num_sges >= rdma->sc_max_send_sges; in svc_rdma_pull_up_needed()
726 * svc_rdma_xb_linearize - Copy region of xdr_buf to flat buffer
741 if (xdr->head[0].iov_len) { in svc_rdma_xb_linearize()
742 memcpy(args->pd_dest, xdr->head[0].iov_base, xdr->head[0].iov_len); in svc_rdma_xb_linearize()
743 args->pd_dest += xdr->head[0].iov_len; in svc_rdma_xb_linearize()
746 ppages = xdr->pages + (xdr->page_base >> PAGE_SHIFT); in svc_rdma_xb_linearize()
747 pageoff = offset_in_page(xdr->page_base); in svc_rdma_xb_linearize()
748 remaining = xdr->page_len; in svc_rdma_xb_linearize()
750 len = min_t(u32, PAGE_SIZE - pageoff, remaining); in svc_rdma_xb_linearize()
751 memcpy(args->pd_dest, page_address(*ppages) + pageoff, len); in svc_rdma_xb_linearize()
752 remaining -= len; in svc_rdma_xb_linearize()
753 args->pd_dest += len; in svc_rdma_xb_linearize()
758 if (xdr->tail[0].iov_len) { in svc_rdma_xb_linearize()
759 memcpy(args->pd_dest, xdr->tail[0].iov_base, xdr->tail[0].iov_len); in svc_rdma_xb_linearize()
760 args->pd_dest += xdr->tail[0].iov_len; in svc_rdma_xb_linearize()
763 args->pd_length += xdr->len; in svc_rdma_xb_linearize()
768 * svc_rdma_pull_up_reply_msg - Copy Reply into a single buffer
771 * @write_pcl: Write chunk list provided by client
781 * %0 if pull-up was successful
782 * %-EMSGSIZE if a buffer manipulation problem occurred
790 .pd_dest = sctxt->sc_xprt_buf + sctxt->sc_hdrbuf.len, in svc_rdma_pull_up_reply_msg()
799 sctxt->sc_sges[0].length = sctxt->sc_hdrbuf.len + args.pd_length; in svc_rdma_pull_up_reply_msg()
804 /* svc_rdma_map_reply_msg - DMA map the buffer holding RPC message
807 * @write_pcl: Write chunk list provided by client
812 * %0 if DMA mapping was successful.
813 * %-EMSGSIZE if a buffer manipulation problem occurred
814 * %-EIO if DMA mapping failed
829 /* Set up the (persistently-mapped) transport header SGE. */ in svc_rdma_map_reply_msg()
830 sctxt->sc_send_wr.num_sge = 1; in svc_rdma_map_reply_msg()
831 sctxt->sc_sges[0].length = sctxt->sc_hdrbuf.len; in svc_rdma_map_reply_msg()
839 /* For pull-up, svc_rdma_send() will sync the transport header. in svc_rdma_map_reply_msg()
840 * No additional DMA mapping is necessary. in svc_rdma_map_reply_msg()
856 int i, pages = rqstp->rq_next_page - rqstp->rq_respages; in svc_rdma_save_io_pages()
858 ctxt->sc_page_count += pages; in svc_rdma_save_io_pages()
860 ctxt->sc_pages[i] = rqstp->rq_respages[i]; in svc_rdma_save_io_pages()
861 rqstp->rq_respages[i] = NULL; in svc_rdma_save_io_pages()
865 rqstp->rq_next_page = rqstp->rq_respages; in svc_rdma_save_io_pages()
869 * via RDMA Send. The RPC-over-RDMA transport header is prepared
872 * Depending on whether a Write list or Reply chunk is present,
878 * - The Reply's transport header will never be larger than a page.
885 struct ib_send_wr *send_wr = &sctxt->sc_send_wr; in svc_rdma_send_reply_msg()
888 ret = svc_rdma_map_reply_msg(rdma, sctxt, &rctxt->rc_write_pcl, in svc_rdma_send_reply_msg()
889 &rctxt->rc_reply_pcl, &rqstp->rq_res); in svc_rdma_send_reply_msg()
898 if (rctxt->rc_inv_rkey) { in svc_rdma_send_reply_msg()
899 send_wr->opcode = IB_WR_SEND_WITH_INV; in svc_rdma_send_reply_msg()
900 send_wr->ex.invalidate_rkey = rctxt->rc_inv_rkey; in svc_rdma_send_reply_msg()
902 send_wr->opcode = IB_WR_SEND; in svc_rdma_send_reply_msg()
909 * svc_rdma_send_error_msg - Send an RPC/RDMA v1 error response
915 * Given the client-provided Read, Write, and Reply chunks, the
928 __be32 *rdma_argp = rctxt->rc_recv_buf; in svc_rdma_send_error_msg()
931 rpcrdma_set_xdrlen(&sctxt->sc_hdrbuf, 0); in svc_rdma_send_error_msg()
932 xdr_init_encode(&sctxt->sc_stream, &sctxt->sc_hdrbuf, in svc_rdma_send_error_msg()
933 sctxt->sc_xprt_buf, NULL); in svc_rdma_send_error_msg()
935 p = xdr_reserve_space(&sctxt->sc_stream, in svc_rdma_send_error_msg()
942 *p++ = rdma->sc_fc_credits; in svc_rdma_send_error_msg()
946 case -EPROTONOSUPPORT: in svc_rdma_send_error_msg()
947 p = xdr_reserve_space(&sctxt->sc_stream, 3 * sizeof(*p)); in svc_rdma_send_error_msg()
957 p = xdr_reserve_space(&sctxt->sc_stream, sizeof(*p)); in svc_rdma_send_error_msg()
966 sctxt->sc_send_wr.num_sge = 1; in svc_rdma_send_error_msg()
967 sctxt->sc_send_wr.opcode = IB_WR_SEND; in svc_rdma_send_error_msg()
968 sctxt->sc_sges[0].length = sctxt->sc_hdrbuf.len; in svc_rdma_send_error_msg()
978 * svc_rdma_sendto - Transmit an RPC reply
986 * %-ENOMEM if a resource shortage occurred (connection is lost),
987 * %-ENOTCONN if posting failed (connection is lost).
991 struct svc_xprt *xprt = rqstp->rq_xprt; in svc_rdma_sendto()
994 struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt; in svc_rdma_sendto()
995 __be32 *rdma_argp = rctxt->rc_recv_buf; in svc_rdma_sendto()
1001 ret = -ENOTCONN; in svc_rdma_sendto()
1005 ret = -ENOMEM; in svc_rdma_sendto()
1010 ret = -EMSGSIZE; in svc_rdma_sendto()
1011 p = xdr_reserve_space(&sctxt->sc_stream, in svc_rdma_sendto()
1016 ret = svc_rdma_send_write_list(rdma, rctxt, &rqstp->rq_res); in svc_rdma_sendto()
1021 if (!pcl_is_empty(&rctxt->rc_reply_pcl)) { in svc_rdma_sendto()
1022 ret = svc_rdma_prepare_reply_chunk(rdma, &rctxt->rc_write_pcl, in svc_rdma_sendto()
1023 &rctxt->rc_reply_pcl, sctxt, in svc_rdma_sendto()
1024 &rqstp->rq_res); in svc_rdma_sendto()
1032 *p++ = rdma->sc_fc_credits; in svc_rdma_sendto()
1033 *p = pcl_is_empty(&rctxt->rc_reply_pcl) ? rdma_msg : rdma_nomsg; in svc_rdma_sendto()
1051 if (ret != -E2BIG && ret != -EINVAL) in svc_rdma_sendto()
1065 svc_xprt_deferred_close(&rdma->sc_xprt); in svc_rdma_sendto()
1066 return -ENOTCONN; in svc_rdma_sendto()
1070 * svc_rdma_result_payload - special processing for a result payload
1072 * @offset: payload's byte offset in @rqstp->rq_res
1075 * Assign the passed-in result payload to the current Write chunk,
1076 * and advance to cur_result_payload to the next Write chunk, if
1081 * %-E2BIG if the payload was larger than the Write chunk
1086 struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt; in svc_rdma_result_payload()
1089 chunk = rctxt->rc_cur_result_payload; in svc_rdma_result_payload()
1092 rctxt->rc_cur_result_payload = in svc_rdma_result_payload()
1093 pcl_next_chunk(&rctxt->rc_write_pcl, chunk); in svc_rdma_result_payload()
1095 if (length > chunk->ch_length) in svc_rdma_result_payload()
1096 return -E2BIG; in svc_rdma_result_payload()
1097 chunk->ch_position = offset; in svc_rdma_result_payload()
1098 chunk->ch_payload_length = length; in svc_rdma_result_payload()