svc_rdma_sendto.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /*
  2. * Copyright (c) 2014 Open Grid Computing, Inc. All rights reserved.
  3. * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved.
  4. *
  5. * This software is available to you under a choice of one of two
  6. * licenses. You may choose to be licensed under the terms of the GNU
  7. * General Public License (GPL) Version 2, available from the file
  8. * COPYING in the main directory of this source tree, or the BSD-type
  9. * license below:
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. *
  15. * Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. *
  18. * Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials provided
  21. * with the distribution.
  22. *
  23. * Neither the name of the Network Appliance, Inc. nor the names of
  24. * its contributors may be used to endorse or promote products
  25. * derived from this software without specific prior written
  26. * permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * Author: Tom Tucker <tom@opengridcomputing.com>
  41. */
  42. #include <linux/sunrpc/debug.h>
  43. #include <linux/sunrpc/rpc_rdma.h>
  44. #include <linux/spinlock.h>
  45. #include <asm/unaligned.h>
  46. #include <rdma/ib_verbs.h>
  47. #include <rdma/rdma_cm.h>
  48. #include <linux/sunrpc/svc_rdma.h>
  49. #define RPCDBG_FACILITY RPCDBG_SVCXPRT
  50. static int map_xdr(struct svcxprt_rdma *xprt,
  51. struct xdr_buf *xdr,
  52. struct svc_rdma_req_map *vec)
  53. {
  54. int sge_no;
  55. u32 sge_bytes;
  56. u32 page_bytes;
  57. u32 page_off;
  58. int page_no;
  59. BUG_ON(xdr->len !=
  60. (xdr->head[0].iov_len + xdr->page_len + xdr->tail[0].iov_len));
  61. /* Skip the first sge, this is for the RPCRDMA header */
  62. sge_no = 1;
  63. /* Head SGE */
  64. vec->sge[sge_no].iov_base = xdr->head[0].iov_base;
  65. vec->sge[sge_no].iov_len = xdr->head[0].iov_len;
  66. sge_no++;
  67. /* pages SGE */
  68. page_no = 0;
  69. page_bytes = xdr->page_len;
  70. page_off = xdr->page_base;
  71. while (page_bytes) {
  72. vec->sge[sge_no].iov_base =
  73. page_address(xdr->pages[page_no]) + page_off;
  74. sge_bytes = min_t(u32, page_bytes, (PAGE_SIZE - page_off));
  75. page_bytes -= sge_bytes;
  76. vec->sge[sge_no].iov_len = sge_bytes;
  77. sge_no++;
  78. page_no++;
  79. page_off = 0; /* reset for next time through loop */
  80. }
  81. /* Tail SGE */
  82. if (xdr->tail[0].iov_len) {
  83. vec->sge[sge_no].iov_base = xdr->tail[0].iov_base;
  84. vec->sge[sge_no].iov_len = xdr->tail[0].iov_len;
  85. sge_no++;
  86. }
  87. dprintk("svcrdma: map_xdr: sge_no %d page_no %d "
  88. "page_base %u page_len %u head_len %zu tail_len %zu\n",
  89. sge_no, page_no, xdr->page_base, xdr->page_len,
  90. xdr->head[0].iov_len, xdr->tail[0].iov_len);
  91. vec->count = sge_no;
  92. return 0;
  93. }
  94. static dma_addr_t dma_map_xdr(struct svcxprt_rdma *xprt,
  95. struct xdr_buf *xdr,
  96. u32 xdr_off, size_t len, int dir)
  97. {
  98. struct page *page;
  99. dma_addr_t dma_addr;
  100. if (xdr_off < xdr->head[0].iov_len) {
  101. /* This offset is in the head */
  102. xdr_off += (unsigned long)xdr->head[0].iov_base & ~PAGE_MASK;
  103. page = virt_to_page(xdr->head[0].iov_base);
  104. } else {
  105. xdr_off -= xdr->head[0].iov_len;
  106. if (xdr_off < xdr->page_len) {
  107. /* This offset is in the page list */
  108. xdr_off += xdr->page_base;
  109. page = xdr->pages[xdr_off >> PAGE_SHIFT];
  110. xdr_off &= ~PAGE_MASK;
  111. } else {
  112. /* This offset is in the tail */
  113. xdr_off -= xdr->page_len;
  114. xdr_off += (unsigned long)
  115. xdr->tail[0].iov_base & ~PAGE_MASK;
  116. page = virt_to_page(xdr->tail[0].iov_base);
  117. }
  118. }
  119. dma_addr = ib_dma_map_page(xprt->sc_cm_id->device, page, xdr_off,
  120. min_t(size_t, PAGE_SIZE, len), dir);
  121. return dma_addr;
  122. }
  123. /* Assumptions:
  124. * - The specified write_len can be represented in sc_max_sge * PAGE_SIZE
  125. */
  126. static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
  127. u32 rmr, u64 to,
  128. u32 xdr_off, int write_len,
  129. struct svc_rdma_req_map *vec)
  130. {
  131. struct ib_send_wr write_wr;
  132. struct ib_sge *sge;
  133. int xdr_sge_no;
  134. int sge_no;
  135. int sge_bytes;
  136. int sge_off;
  137. int bc;
  138. struct svc_rdma_op_ctxt *ctxt;
  139. BUG_ON(vec->count > RPCSVC_MAXPAGES);
  140. dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
  141. "write_len=%d, vec->sge=%p, vec->count=%lu\n",
  142. rmr, (unsigned long long)to, xdr_off,
  143. write_len, vec->sge, vec->count);
  144. ctxt = svc_rdma_get_context(xprt);
  145. ctxt->direction = DMA_TO_DEVICE;
  146. sge = ctxt->sge;
  147. /* Find the SGE associated with xdr_off */
  148. for (bc = xdr_off, xdr_sge_no = 1; bc && xdr_sge_no < vec->count;
  149. xdr_sge_no++) {
  150. if (vec->sge[xdr_sge_no].iov_len > bc)
  151. break;
  152. bc -= vec->sge[xdr_sge_no].iov_len;
  153. }
  154. sge_off = bc;
  155. bc = write_len;
  156. sge_no = 0;
  157. /* Copy the remaining SGE */
  158. while (bc != 0) {
  159. sge_bytes = min_t(size_t,
  160. bc, vec->sge[xdr_sge_no].iov_len-sge_off);
  161. sge[sge_no].length = sge_bytes;
  162. sge[sge_no].addr =
  163. dma_map_xdr(xprt, &rqstp->rq_res, xdr_off,
  164. sge_bytes, DMA_TO_DEVICE);
  165. xdr_off += sge_bytes;
  166. if (ib_dma_mapping_error(xprt->sc_cm_id->device,
  167. sge[sge_no].addr))
  168. goto err;
  169. atomic_inc(&xprt->sc_dma_used);
  170. sge[sge_no].lkey = xprt->sc_dma_lkey;
  171. ctxt->count++;
  172. sge_off = 0;
  173. sge_no++;
  174. xdr_sge_no++;
  175. BUG_ON(xdr_sge_no > vec->count);
  176. bc -= sge_bytes;
  177. if (sge_no == xprt->sc_max_sge)
  178. break;
  179. }
  180. /* Prepare WRITE WR */
  181. memset(&write_wr, 0, sizeof write_wr);
  182. ctxt->wr_op = IB_WR_RDMA_WRITE;
  183. write_wr.wr_id = (unsigned long)ctxt;
  184. write_wr.sg_list = &sge[0];
  185. write_wr.num_sge = sge_no;
  186. write_wr.opcode = IB_WR_RDMA_WRITE;
  187. write_wr.send_flags = IB_SEND_SIGNALED;
  188. write_wr.wr.rdma.rkey = rmr;
  189. write_wr.wr.rdma.remote_addr = to;
  190. /* Post It */
  191. atomic_inc(&rdma_stat_write);
  192. if (svc_rdma_send(xprt, &write_wr))
  193. goto err;
  194. return write_len - bc;
  195. err:
  196. svc_rdma_unmap_dma(ctxt);
  197. svc_rdma_put_context(ctxt, 0);
  198. /* Fatal error, close transport */
  199. return -EIO;
  200. }
  201. static int send_write_chunks(struct svcxprt_rdma *xprt,
  202. struct rpcrdma_msg *rdma_argp,
  203. struct rpcrdma_msg *rdma_resp,
  204. struct svc_rqst *rqstp,
  205. struct svc_rdma_req_map *vec)
  206. {
  207. u32 xfer_len = rqstp->rq_res.page_len + rqstp->rq_res.tail[0].iov_len;
  208. int write_len;
  209. u32 xdr_off;
  210. int chunk_off;
  211. int chunk_no;
  212. struct rpcrdma_write_array *arg_ary;
  213. struct rpcrdma_write_array *res_ary;
  214. int ret;
  215. arg_ary = svc_rdma_get_write_array(rdma_argp);
  216. if (!arg_ary)
  217. return 0;
  218. res_ary = (struct rpcrdma_write_array *)
  219. &rdma_resp->rm_body.rm_chunks[1];
  220. /* Write chunks start at the pagelist */
  221. for (xdr_off = rqstp->rq_res.head[0].iov_len, chunk_no = 0;
  222. xfer_len && chunk_no < arg_ary->wc_nchunks;
  223. chunk_no++) {
  224. struct rpcrdma_segment *arg_ch;
  225. u64 rs_offset;
  226. arg_ch = &arg_ary->wc_array[chunk_no].wc_target;
  227. write_len = min(xfer_len, ntohl(arg_ch->rs_length));
  228. /* Prepare the response chunk given the length actually
  229. * written */
  230. xdr_decode_hyper((__be32 *)&arg_ch->rs_offset, &rs_offset);
  231. svc_rdma_xdr_encode_array_chunk(res_ary, chunk_no,
  232. arg_ch->rs_handle,
  233. arg_ch->rs_offset,
  234. write_len);
  235. chunk_off = 0;
  236. while (write_len) {
  237. ret = send_write(xprt, rqstp,
  238. ntohl(arg_ch->rs_handle),
  239. rs_offset + chunk_off,
  240. xdr_off,
  241. write_len,
  242. vec);
  243. if (ret <= 0) {
  244. dprintk("svcrdma: RDMA_WRITE failed, ret=%d\n",
  245. ret);
  246. return -EIO;
  247. }
  248. chunk_off += ret;
  249. xdr_off += ret;
  250. xfer_len -= ret;
  251. write_len -= ret;
  252. }
  253. }
  254. /* Update the req with the number of chunks actually used */
  255. svc_rdma_xdr_encode_write_list(rdma_resp, chunk_no);
  256. return rqstp->rq_res.page_len + rqstp->rq_res.tail[0].iov_len;
  257. }
  258. static int send_reply_chunks(struct svcxprt_rdma *xprt,
  259. struct rpcrdma_msg *rdma_argp,
  260. struct rpcrdma_msg *rdma_resp,
  261. struct svc_rqst *rqstp,
  262. struct svc_rdma_req_map *vec)
  263. {
  264. u32 xfer_len = rqstp->rq_res.len;
  265. int write_len;
  266. u32 xdr_off;
  267. int chunk_no;
  268. int chunk_off;
  269. int nchunks;
  270. struct rpcrdma_segment *ch;
  271. struct rpcrdma_write_array *arg_ary;
  272. struct rpcrdma_write_array *res_ary;
  273. int ret;
  274. arg_ary = svc_rdma_get_reply_array(rdma_argp);
  275. if (!arg_ary)
  276. return 0;
  277. /* XXX: need to fix when reply lists occur with read-list and or
  278. * write-list */
  279. res_ary = (struct rpcrdma_write_array *)
  280. &rdma_resp->rm_body.rm_chunks[2];
  281. /* xdr offset starts at RPC message */
  282. nchunks = ntohl(arg_ary->wc_nchunks);
  283. for (xdr_off = 0, chunk_no = 0;
  284. xfer_len && chunk_no < nchunks;
  285. chunk_no++) {
  286. u64 rs_offset;
  287. ch = &arg_ary->wc_array[chunk_no].wc_target;
  288. write_len = min(xfer_len, htonl(ch->rs_length));
  289. /* Prepare the reply chunk given the length actually
  290. * written */
  291. xdr_decode_hyper((__be32 *)&ch->rs_offset, &rs_offset);
  292. svc_rdma_xdr_encode_array_chunk(res_ary, chunk_no,
  293. ch->rs_handle, ch->rs_offset,
  294. write_len);
  295. chunk_off = 0;
  296. while (write_len) {
  297. ret = send_write(xprt, rqstp,
  298. ntohl(ch->rs_handle),
  299. rs_offset + chunk_off,
  300. xdr_off,
  301. write_len,
  302. vec);
  303. if (ret <= 0) {
  304. dprintk("svcrdma: RDMA_WRITE failed, ret=%d\n",
  305. ret);
  306. return -EIO;
  307. }
  308. chunk_off += ret;
  309. xdr_off += ret;
  310. xfer_len -= ret;
  311. write_len -= ret;
  312. }
  313. }
  314. /* Update the req with the number of chunks actually used */
  315. svc_rdma_xdr_encode_reply_array(res_ary, chunk_no);
  316. return rqstp->rq_res.len;
  317. }
  318. /* This function prepares the portion of the RPCRDMA message to be
  319. * sent in the RDMA_SEND. This function is called after data sent via
  320. * RDMA has already been transmitted. There are three cases:
  321. * - The RPCRDMA header, RPC header, and payload are all sent in a
  322. * single RDMA_SEND. This is the "inline" case.
  323. * - The RPCRDMA header and some portion of the RPC header and data
  324. * are sent via this RDMA_SEND and another portion of the data is
  325. * sent via RDMA.
  326. * - The RPCRDMA header [NOMSG] is sent in this RDMA_SEND and the RPC
  327. * header and data are all transmitted via RDMA.
  328. * In all three cases, this function prepares the RPCRDMA header in
  329. * sge[0], the 'type' parameter indicates the type to place in the
  330. * RPCRDMA header, and the 'byte_count' field indicates how much of
  331. * the XDR to include in this RDMA_SEND. NB: The offset of the payload
  332. * to send is zero in the XDR.
  333. */
  334. static int send_reply(struct svcxprt_rdma *rdma,
  335. struct svc_rqst *rqstp,
  336. struct page *page,
  337. struct rpcrdma_msg *rdma_resp,
  338. struct svc_rdma_op_ctxt *ctxt,
  339. struct svc_rdma_req_map *vec,
  340. int byte_count)
  341. {
  342. struct ib_send_wr send_wr;
  343. int sge_no;
  344. int sge_bytes;
  345. int page_no;
  346. int pages;
  347. int ret;
  348. /* Post a recv buffer to handle another request. */
  349. ret = svc_rdma_post_recv(rdma);
  350. if (ret) {
  351. printk(KERN_INFO
  352. "svcrdma: could not post a receive buffer, err=%d."
  353. "Closing transport %p.\n", ret, rdma);
  354. set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
  355. svc_rdma_put_context(ctxt, 0);
  356. return -ENOTCONN;
  357. }
  358. /* Prepare the context */
  359. ctxt->pages[0] = page;
  360. ctxt->count = 1;
  361. /* Prepare the SGE for the RPCRDMA Header */
  362. ctxt->sge[0].lkey = rdma->sc_dma_lkey;
  363. ctxt->sge[0].length = svc_rdma_xdr_get_reply_hdr_len(rdma_resp);
  364. ctxt->sge[0].addr =
  365. ib_dma_map_page(rdma->sc_cm_id->device, page, 0,
  366. ctxt->sge[0].length, DMA_TO_DEVICE);
  367. if (ib_dma_mapping_error(rdma->sc_cm_id->device, ctxt->sge[0].addr))
  368. goto err;
  369. atomic_inc(&rdma->sc_dma_used);
  370. ctxt->direction = DMA_TO_DEVICE;
  371. /* Map the payload indicated by 'byte_count' */
  372. for (sge_no = 1; byte_count && sge_no < vec->count; sge_no++) {
  373. int xdr_off = 0;
  374. sge_bytes = min_t(size_t, vec->sge[sge_no].iov_len, byte_count);
  375. byte_count -= sge_bytes;
  376. ctxt->sge[sge_no].addr =
  377. dma_map_xdr(rdma, &rqstp->rq_res, xdr_off,
  378. sge_bytes, DMA_TO_DEVICE);
  379. xdr_off += sge_bytes;
  380. if (ib_dma_mapping_error(rdma->sc_cm_id->device,
  381. ctxt->sge[sge_no].addr))
  382. goto err;
  383. atomic_inc(&rdma->sc_dma_used);
  384. ctxt->sge[sge_no].lkey = rdma->sc_dma_lkey;
  385. ctxt->sge[sge_no].length = sge_bytes;
  386. }
  387. BUG_ON(byte_count != 0);
  388. /* Save all respages in the ctxt and remove them from the
  389. * respages array. They are our pages until the I/O
  390. * completes.
  391. */
  392. pages = rqstp->rq_next_page - rqstp->rq_respages;
  393. for (page_no = 0; page_no < pages; page_no++) {
  394. ctxt->pages[page_no+1] = rqstp->rq_respages[page_no];
  395. ctxt->count++;
  396. rqstp->rq_respages[page_no] = NULL;
  397. /*
  398. * If there are more pages than SGE, terminate SGE
  399. * list so that svc_rdma_unmap_dma doesn't attempt to
  400. * unmap garbage.
  401. */
  402. if (page_no+1 >= sge_no)
  403. ctxt->sge[page_no+1].length = 0;
  404. }
  405. rqstp->rq_next_page = rqstp->rq_respages + 1;
  406. BUG_ON(sge_no > rdma->sc_max_sge);
  407. memset(&send_wr, 0, sizeof send_wr);
  408. ctxt->wr_op = IB_WR_SEND;
  409. send_wr.wr_id = (unsigned long)ctxt;
  410. send_wr.sg_list = ctxt->sge;
  411. send_wr.num_sge = sge_no;
  412. send_wr.opcode = IB_WR_SEND;
  413. send_wr.send_flags = IB_SEND_SIGNALED;
  414. ret = svc_rdma_send(rdma, &send_wr);
  415. if (ret)
  416. goto err;
  417. return 0;
  418. err:
  419. svc_rdma_unmap_dma(ctxt);
  420. svc_rdma_put_context(ctxt, 1);
  421. return -EIO;
  422. }
  423. void svc_rdma_prep_reply_hdr(struct svc_rqst *rqstp)
  424. {
  425. }
  426. /*
  427. * Return the start of an xdr buffer.
  428. */
  429. static void *xdr_start(struct xdr_buf *xdr)
  430. {
  431. return xdr->head[0].iov_base -
  432. (xdr->len -
  433. xdr->page_len -
  434. xdr->tail[0].iov_len -
  435. xdr->head[0].iov_len);
  436. }
  437. int svc_rdma_sendto(struct svc_rqst *rqstp)
  438. {
  439. struct svc_xprt *xprt = rqstp->rq_xprt;
  440. struct svcxprt_rdma *rdma =
  441. container_of(xprt, struct svcxprt_rdma, sc_xprt);
  442. struct rpcrdma_msg *rdma_argp;
  443. struct rpcrdma_msg *rdma_resp;
  444. struct rpcrdma_write_array *reply_ary;
  445. enum rpcrdma_proc reply_type;
  446. int ret;
  447. int inline_bytes;
  448. struct page *res_page;
  449. struct svc_rdma_op_ctxt *ctxt;
  450. struct svc_rdma_req_map *vec;
  451. dprintk("svcrdma: sending response for rqstp=%p\n", rqstp);
  452. /* Get the RDMA request header. */
  453. rdma_argp = xdr_start(&rqstp->rq_arg);
  454. /* Build an req vec for the XDR */
  455. ctxt = svc_rdma_get_context(rdma);
  456. ctxt->direction = DMA_TO_DEVICE;
  457. vec = svc_rdma_get_req_map();
  458. ret = map_xdr(rdma, &rqstp->rq_res, vec);
  459. if (ret)
  460. goto err0;
  461. inline_bytes = rqstp->rq_res.len;
  462. /* Create the RDMA response header */
  463. res_page = svc_rdma_get_page();
  464. rdma_resp = page_address(res_page);
  465. reply_ary = svc_rdma_get_reply_array(rdma_argp);
  466. if (reply_ary)
  467. reply_type = RDMA_NOMSG;
  468. else
  469. reply_type = RDMA_MSG;
  470. svc_rdma_xdr_encode_reply_header(rdma, rdma_argp,
  471. rdma_resp, reply_type);
  472. /* Send any write-chunk data and build resp write-list */
  473. ret = send_write_chunks(rdma, rdma_argp, rdma_resp,
  474. rqstp, vec);
  475. if (ret < 0) {
  476. printk(KERN_ERR "svcrdma: failed to send write chunks, rc=%d\n",
  477. ret);
  478. goto err1;
  479. }
  480. inline_bytes -= ret;
  481. /* Send any reply-list data and update resp reply-list */
  482. ret = send_reply_chunks(rdma, rdma_argp, rdma_resp,
  483. rqstp, vec);
  484. if (ret < 0) {
  485. printk(KERN_ERR "svcrdma: failed to send reply chunks, rc=%d\n",
  486. ret);
  487. goto err1;
  488. }
  489. inline_bytes -= ret;
  490. ret = send_reply(rdma, rqstp, res_page, rdma_resp, ctxt, vec,
  491. inline_bytes);
  492. svc_rdma_put_req_map(vec);
  493. dprintk("svcrdma: send_reply returns %d\n", ret);
  494. return ret;
  495. err1:
  496. put_page(res_page);
  497. err0:
  498. svc_rdma_put_req_map(vec);
  499. svc_rdma_put_context(ctxt, 0);
  500. return ret;
  501. }