Chuck Lever | bcf3ffd | 2018-05-07 15:26:55 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 2 | /* |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 3 | * Copyright (c) 2016 Oracle. All rights reserved. |
Steve Wise | 0bf4828 | 2014-05-28 15:12:01 -0500 | [diff] [blame] | 4 | * Copyright (c) 2014 Open Grid Computing, Inc. All rights reserved. |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 5 | * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved. |
| 6 | * |
| 7 | * This software is available to you under a choice of one of two |
| 8 | * licenses. You may choose to be licensed under the terms of the GNU |
| 9 | * General Public License (GPL) Version 2, available from the file |
| 10 | * COPYING in the main directory of this source tree, or the BSD-type |
| 11 | * license below: |
| 12 | * |
| 13 | * Redistribution and use in source and binary forms, with or without |
| 14 | * modification, are permitted provided that the following conditions |
| 15 | * are met: |
| 16 | * |
| 17 | * Redistributions of source code must retain the above copyright |
| 18 | * notice, this list of conditions and the following disclaimer. |
| 19 | * |
| 20 | * Redistributions in binary form must reproduce the above |
| 21 | * copyright notice, this list of conditions and the following |
| 22 | * disclaimer in the documentation and/or other materials provided |
| 23 | * with the distribution. |
| 24 | * |
| 25 | * Neither the name of the Network Appliance, Inc. nor the names of |
| 26 | * its contributors may be used to endorse or promote products |
| 27 | * derived from this software without specific prior written |
| 28 | * permission. |
| 29 | * |
| 30 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 31 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 32 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 33 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 34 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 35 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 36 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 37 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 38 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 40 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 41 | * |
| 42 | * Author: Tom Tucker <tom@opengridcomputing.com> |
| 43 | */ |
| 44 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 45 | /* Operation |
| 46 | * |
| 47 | * The main entry point is svc_rdma_sendto. This is called by the |
| 48 | * RPC server when an RPC Reply is ready to be transmitted to a client. |
| 49 | * |
| 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 |
| 53 | * a Send WR conveying the transport header and the RPC message itself to |
| 54 | * the client. |
| 55 | * |
| 56 | * svc_rdma_sendto must fully transmit the Reply before returning, as |
| 57 | * the svc_rqst will be recycled as soon as sendto returns. Remaining |
| 58 | * resources referred to by the svc_rqst are also recycled at that time. |
| 59 | * Therefore any resources that must remain longer must be detached |
| 60 | * from the svc_rqst and released later. |
| 61 | * |
| 62 | * Page Management |
| 63 | * |
| 64 | * The I/O that performs Reply transmission is asynchronous, and may |
| 65 | * complete well after sendto returns. Thus pages under I/O must be |
| 66 | * removed from the svc_rqst before sendto returns. |
| 67 | * |
| 68 | * The logic here depends on Send Queue and completion ordering. Since |
| 69 | * the Send WR is always posted last, it will always complete last. Thus |
| 70 | * when it completes, it is guaranteed that all previous Write WRs have |
| 71 | * also completed. |
| 72 | * |
| 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 |
| 76 | * completion handler does not release any pages. |
| 77 | * |
| 78 | * When the Send WR is constructed, it also gets its own svc_rdma_op_ctxt. |
| 79 | * The ownership of all of the Reply's pages are transferred into that |
| 80 | * ctxt, the Send WR is posted, and sendto returns. |
| 81 | * |
| 82 | * The svc_rdma_op_ctxt is presented when the Send WR completes. The |
| 83 | * Send completion handler finally releases the Reply's pages. |
| 84 | * |
| 85 | * This mechanism also assumes that completions on the transport's Send |
| 86 | * Completion Queue do not run in parallel. Otherwise a Write completion |
| 87 | * and Send completion running at the same time could release pages that |
| 88 | * are still DMA-mapped. |
| 89 | * |
| 90 | * Error Handling |
| 91 | * |
| 92 | * - If the Send WR is posted successfully, it will either complete |
| 93 | * successfully, or get flushed. Either way, the Send completion |
| 94 | * handler releases the Reply's pages. |
| 95 | * - If the Send WR cannot be not posted, the forward path releases |
| 96 | * the Reply's pages. |
| 97 | * |
| 98 | * This handles the case, without the use of page reference counting, |
| 99 | * where two different Write segments send portions of the same page. |
| 100 | */ |
| 101 | |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 102 | #include <linux/spinlock.h> |
| 103 | #include <asm/unaligned.h> |
Chuck Lever | 98895ed | 2018-05-07 15:27:11 -0400 | [diff] [blame] | 104 | |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 105 | #include <rdma/ib_verbs.h> |
| 106 | #include <rdma/rdma_cm.h> |
Chuck Lever | 98895ed | 2018-05-07 15:27:11 -0400 | [diff] [blame] | 107 | |
| 108 | #include <linux/sunrpc/debug.h> |
| 109 | #include <linux/sunrpc/rpc_rdma.h> |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 110 | #include <linux/sunrpc/svc_rdma.h> |
| 111 | |
Chuck Lever | 98895ed | 2018-05-07 15:27:11 -0400 | [diff] [blame] | 112 | #include "xprt_rdma.h" |
| 113 | #include <trace/events/rpcrdma.h> |
| 114 | |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 115 | #define RPCDBG_FACILITY RPCDBG_SVCXPRT |
| 116 | |
Chuck Lever | cf570a9 | 2016-03-01 13:05:45 -0500 | [diff] [blame] | 117 | static u32 xdr_padsize(u32 len) |
| 118 | { |
| 119 | return (len & 3) ? (4 - (len & 3)) : 0; |
| 120 | } |
| 121 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 122 | /* Returns length of transport header, in bytes. |
| 123 | */ |
| 124 | static unsigned int svc_rdma_reply_hdr_len(__be32 *rdma_resp) |
| 125 | { |
| 126 | unsigned int nsegs; |
| 127 | __be32 *p; |
| 128 | |
| 129 | p = rdma_resp; |
| 130 | |
| 131 | /* RPC-over-RDMA V1 replies never have a Read list. */ |
| 132 | p += rpcrdma_fixed_maxsz + 1; |
| 133 | |
| 134 | /* Skip Write list. */ |
| 135 | while (*p++ != xdr_zero) { |
| 136 | nsegs = be32_to_cpup(p++); |
| 137 | p += nsegs * rpcrdma_segment_maxsz; |
| 138 | } |
| 139 | |
| 140 | /* Skip Reply chunk. */ |
| 141 | if (*p++ != xdr_zero) { |
| 142 | nsegs = be32_to_cpup(p++); |
| 143 | p += nsegs * rpcrdma_segment_maxsz; |
| 144 | } |
| 145 | |
| 146 | return (unsigned long)p - (unsigned long)rdma_resp; |
| 147 | } |
| 148 | |
| 149 | /* One Write chunk is copied from Call transport header to Reply |
| 150 | * transport header. Each segment's length field is updated to |
| 151 | * reflect number of bytes consumed in the segment. |
| 152 | * |
| 153 | * Returns number of segments in this chunk. |
| 154 | */ |
| 155 | static unsigned int xdr_encode_write_chunk(__be32 *dst, __be32 *src, |
| 156 | unsigned int remaining) |
| 157 | { |
| 158 | unsigned int i, nsegs; |
| 159 | u32 seg_len; |
| 160 | |
| 161 | /* Write list discriminator */ |
| 162 | *dst++ = *src++; |
| 163 | |
| 164 | /* number of segments in this chunk */ |
| 165 | nsegs = be32_to_cpup(src); |
| 166 | *dst++ = *src++; |
| 167 | |
| 168 | for (i = nsegs; i; i--) { |
| 169 | /* segment's RDMA handle */ |
| 170 | *dst++ = *src++; |
| 171 | |
| 172 | /* bytes returned in this segment */ |
| 173 | seg_len = be32_to_cpu(*src); |
| 174 | if (remaining >= seg_len) { |
| 175 | /* entire segment was consumed */ |
| 176 | *dst = *src; |
| 177 | remaining -= seg_len; |
| 178 | } else { |
| 179 | /* segment only partly filled */ |
| 180 | *dst = cpu_to_be32(remaining); |
| 181 | remaining = 0; |
| 182 | } |
| 183 | dst++; src++; |
| 184 | |
| 185 | /* segment's RDMA offset */ |
| 186 | *dst++ = *src++; |
| 187 | *dst++ = *src++; |
| 188 | } |
| 189 | |
| 190 | return nsegs; |
| 191 | } |
| 192 | |
| 193 | /* The client provided a Write list in the Call message. Fill in |
| 194 | * the segments in the first Write chunk in the Reply's transport |
| 195 | * header with the number of bytes consumed in each segment. |
| 196 | * Remaining chunks are returned unused. |
| 197 | * |
| 198 | * Assumptions: |
| 199 | * - Client has provided only one Write chunk |
| 200 | */ |
| 201 | static void svc_rdma_xdr_encode_write_list(__be32 *rdma_resp, __be32 *wr_ch, |
| 202 | unsigned int consumed) |
| 203 | { |
| 204 | unsigned int nsegs; |
| 205 | __be32 *p, *q; |
| 206 | |
| 207 | /* RPC-over-RDMA V1 replies never have a Read list. */ |
| 208 | p = rdma_resp + rpcrdma_fixed_maxsz + 1; |
| 209 | |
| 210 | q = wr_ch; |
| 211 | while (*q != xdr_zero) { |
| 212 | nsegs = xdr_encode_write_chunk(p, q, consumed); |
| 213 | q += 2 + nsegs * rpcrdma_segment_maxsz; |
| 214 | p += 2 + nsegs * rpcrdma_segment_maxsz; |
| 215 | consumed = 0; |
| 216 | } |
| 217 | |
| 218 | /* Terminate Write list */ |
| 219 | *p++ = xdr_zero; |
| 220 | |
| 221 | /* Reply chunk discriminator; may be replaced later */ |
| 222 | *p = xdr_zero; |
| 223 | } |
| 224 | |
| 225 | /* The client provided a Reply chunk in the Call message. Fill in |
| 226 | * the segments in the Reply chunk in the Reply message with the |
| 227 | * number of bytes consumed in each segment. |
| 228 | * |
| 229 | * Assumptions: |
| 230 | * - Reply can always fit in the provided Reply chunk |
| 231 | */ |
| 232 | static void svc_rdma_xdr_encode_reply_chunk(__be32 *rdma_resp, __be32 *rp_ch, |
| 233 | unsigned int consumed) |
| 234 | { |
| 235 | __be32 *p; |
| 236 | |
| 237 | /* Find the Reply chunk in the Reply's xprt header. |
| 238 | * RPC-over-RDMA V1 replies never have a Read list. |
| 239 | */ |
| 240 | p = rdma_resp + rpcrdma_fixed_maxsz + 1; |
| 241 | |
| 242 | /* Skip past Write list */ |
| 243 | while (*p++ != xdr_zero) |
| 244 | p += 1 + be32_to_cpup(p) * rpcrdma_segment_maxsz; |
| 245 | |
| 246 | xdr_encode_write_chunk(p, rp_ch, consumed); |
| 247 | } |
| 248 | |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 249 | /* Parse the RPC Call's transport header. |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 250 | */ |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 251 | static void svc_rdma_get_write_arrays(__be32 *rdma_argp, |
| 252 | __be32 **write, __be32 **reply) |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 253 | { |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 254 | __be32 *p; |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 255 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 256 | p = rdma_argp + rpcrdma_fixed_maxsz; |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 257 | |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 258 | /* Read list */ |
| 259 | while (*p++ != xdr_zero) |
| 260 | p += 5; |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 261 | |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 262 | /* Write list */ |
| 263 | if (*p != xdr_zero) { |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 264 | *write = p; |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 265 | while (*p++ != xdr_zero) |
| 266 | p += 1 + be32_to_cpu(*p) * 4; |
| 267 | } else { |
| 268 | *write = NULL; |
| 269 | p++; |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 270 | } |
| 271 | |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 272 | /* Reply chunk */ |
| 273 | if (*p != xdr_zero) |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 274 | *reply = p; |
Chuck Lever | 5fdca65 | 2016-11-29 11:04:42 -0500 | [diff] [blame] | 275 | else |
| 276 | *reply = NULL; |
Chuck Lever | 10dc451 | 2015-07-09 16:45:28 -0400 | [diff] [blame] | 277 | } |
| 278 | |
Chuck Lever | 25d55296 | 2016-09-13 10:53:23 -0400 | [diff] [blame] | 279 | /* RPC-over-RDMA Version One private extension: Remote Invalidation. |
| 280 | * Responder's choice: requester signals it can handle Send With |
| 281 | * Invalidate, and responder chooses one rkey to invalidate. |
| 282 | * |
| 283 | * Find a candidate rkey to invalidate when sending a reply. Picks the |
Chuck Lever | c238c4c | 2017-04-09 13:06:08 -0400 | [diff] [blame] | 284 | * first R_key it finds in the chunk lists. |
Chuck Lever | 25d55296 | 2016-09-13 10:53:23 -0400 | [diff] [blame] | 285 | * |
| 286 | * Returns zero if RPC's chunk lists are empty. |
| 287 | */ |
Chuck Lever | c238c4c | 2017-04-09 13:06:08 -0400 | [diff] [blame] | 288 | static u32 svc_rdma_get_inv_rkey(__be32 *rdma_argp, |
| 289 | __be32 *wr_lst, __be32 *rp_ch) |
Chuck Lever | 25d55296 | 2016-09-13 10:53:23 -0400 | [diff] [blame] | 290 | { |
Chuck Lever | c238c4c | 2017-04-09 13:06:08 -0400 | [diff] [blame] | 291 | __be32 *p; |
Chuck Lever | 25d55296 | 2016-09-13 10:53:23 -0400 | [diff] [blame] | 292 | |
Chuck Lever | c238c4c | 2017-04-09 13:06:08 -0400 | [diff] [blame] | 293 | p = rdma_argp + rpcrdma_fixed_maxsz; |
| 294 | if (*p != xdr_zero) |
| 295 | p += 2; |
| 296 | else if (wr_lst && be32_to_cpup(wr_lst + 1)) |
| 297 | p = wr_lst + 2; |
| 298 | else if (rp_ch && be32_to_cpup(rp_ch + 1)) |
| 299 | p = rp_ch + 2; |
| 300 | else |
| 301 | return 0; |
| 302 | return be32_to_cpup(p); |
Chuck Lever | 25d55296 | 2016-09-13 10:53:23 -0400 | [diff] [blame] | 303 | } |
| 304 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 305 | /* ib_dma_map_page() is used here because svc_rdma_dma_unmap() |
| 306 | * is used during completion to DMA-unmap this memory, and |
| 307 | * it uses ib_dma_unmap_page() exclusively. |
| 308 | */ |
| 309 | static int svc_rdma_dma_map_buf(struct svcxprt_rdma *rdma, |
| 310 | struct svc_rdma_op_ctxt *ctxt, |
| 311 | unsigned int sge_no, |
| 312 | unsigned char *base, |
| 313 | unsigned int len) |
| 314 | { |
| 315 | unsigned long offset = (unsigned long)base & ~PAGE_MASK; |
| 316 | struct ib_device *dev = rdma->sc_cm_id->device; |
| 317 | dma_addr_t dma_addr; |
| 318 | |
| 319 | dma_addr = ib_dma_map_page(dev, virt_to_page(base), |
| 320 | offset, len, DMA_TO_DEVICE); |
| 321 | if (ib_dma_mapping_error(dev, dma_addr)) |
Chuck Lever | 91a08eae | 2017-06-23 17:17:15 -0400 | [diff] [blame] | 322 | goto out_maperr; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 323 | |
| 324 | ctxt->sge[sge_no].addr = dma_addr; |
| 325 | ctxt->sge[sge_no].length = len; |
| 326 | ctxt->sge[sge_no].lkey = rdma->sc_pd->local_dma_lkey; |
| 327 | svc_rdma_count_mappings(rdma, ctxt); |
| 328 | return 0; |
Chuck Lever | 91a08eae | 2017-06-23 17:17:15 -0400 | [diff] [blame] | 329 | |
| 330 | out_maperr: |
| 331 | pr_err("svcrdma: failed to map buffer\n"); |
| 332 | return -EIO; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 333 | } |
| 334 | |
Chuck Lever | 6e6092c | 2017-04-09 13:05:44 -0400 | [diff] [blame] | 335 | static int svc_rdma_dma_map_page(struct svcxprt_rdma *rdma, |
| 336 | struct svc_rdma_op_ctxt *ctxt, |
| 337 | unsigned int sge_no, |
| 338 | struct page *page, |
| 339 | unsigned int offset, |
| 340 | unsigned int len) |
| 341 | { |
| 342 | struct ib_device *dev = rdma->sc_cm_id->device; |
| 343 | dma_addr_t dma_addr; |
| 344 | |
| 345 | dma_addr = ib_dma_map_page(dev, page, offset, len, DMA_TO_DEVICE); |
| 346 | if (ib_dma_mapping_error(dev, dma_addr)) |
Chuck Lever | 91a08eae | 2017-06-23 17:17:15 -0400 | [diff] [blame] | 347 | goto out_maperr; |
Chuck Lever | 6e6092c | 2017-04-09 13:05:44 -0400 | [diff] [blame] | 348 | |
| 349 | ctxt->sge[sge_no].addr = dma_addr; |
| 350 | ctxt->sge[sge_no].length = len; |
| 351 | ctxt->sge[sge_no].lkey = rdma->sc_pd->local_dma_lkey; |
| 352 | svc_rdma_count_mappings(rdma, ctxt); |
| 353 | return 0; |
Chuck Lever | 91a08eae | 2017-06-23 17:17:15 -0400 | [diff] [blame] | 354 | |
| 355 | out_maperr: |
Chuck Lever | bd2abef | 2018-05-07 15:27:16 -0400 | [diff] [blame^] | 356 | trace_svcrdma_dma_map_page(rdma, page); |
Chuck Lever | 91a08eae | 2017-06-23 17:17:15 -0400 | [diff] [blame] | 357 | return -EIO; |
Chuck Lever | 6e6092c | 2017-04-09 13:05:44 -0400 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | /** |
| 361 | * svc_rdma_map_reply_hdr - DMA map the transport header buffer |
| 362 | * @rdma: controlling transport |
| 363 | * @ctxt: op_ctxt for the Send WR |
| 364 | * @rdma_resp: buffer containing transport header |
| 365 | * @len: length of transport header |
| 366 | * |
| 367 | * Returns: |
| 368 | * %0 if the header is DMA mapped, |
| 369 | * %-EIO if DMA mapping failed. |
| 370 | */ |
| 371 | int svc_rdma_map_reply_hdr(struct svcxprt_rdma *rdma, |
| 372 | struct svc_rdma_op_ctxt *ctxt, |
| 373 | __be32 *rdma_resp, |
| 374 | unsigned int len) |
| 375 | { |
| 376 | ctxt->direction = DMA_TO_DEVICE; |
| 377 | ctxt->pages[0] = virt_to_page(rdma_resp); |
| 378 | ctxt->count = 1; |
| 379 | return svc_rdma_dma_map_page(rdma, ctxt, 0, ctxt->pages[0], 0, len); |
| 380 | } |
| 381 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 382 | /* Load the xdr_buf into the ctxt's sge array, and DMA map each |
| 383 | * element as it is added. |
| 384 | * |
| 385 | * Returns the number of sge elements loaded on success, or |
| 386 | * a negative errno on failure. |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 387 | */ |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 388 | static int svc_rdma_map_reply_msg(struct svcxprt_rdma *rdma, |
| 389 | struct svc_rdma_op_ctxt *ctxt, |
| 390 | struct xdr_buf *xdr, __be32 *wr_lst) |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 391 | { |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 392 | unsigned int len, sge_no, remaining, page_off; |
| 393 | struct page **ppages; |
| 394 | unsigned char *base; |
| 395 | u32 xdr_pad; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 396 | int ret; |
| 397 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 398 | sge_no = 1; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 399 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 400 | ret = svc_rdma_dma_map_buf(rdma, ctxt, sge_no++, |
| 401 | xdr->head[0].iov_base, |
| 402 | xdr->head[0].iov_len); |
| 403 | if (ret < 0) |
| 404 | return ret; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 405 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 406 | /* If a Write chunk is present, the xdr_buf's page list |
| 407 | * is not included inline. However the Upper Layer may |
| 408 | * have added XDR padding in the tail buffer, and that |
| 409 | * should not be included inline. |
| 410 | */ |
| 411 | if (wr_lst) { |
| 412 | base = xdr->tail[0].iov_base; |
| 413 | len = xdr->tail[0].iov_len; |
| 414 | xdr_pad = xdr_padsize(xdr->page_len); |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 415 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 416 | if (len && xdr_pad) { |
| 417 | base += xdr_pad; |
| 418 | len -= xdr_pad; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 419 | } |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 420 | |
| 421 | goto tail; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 422 | } |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 423 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 424 | ppages = xdr->pages + (xdr->page_base >> PAGE_SHIFT); |
| 425 | page_off = xdr->page_base & ~PAGE_MASK; |
| 426 | remaining = xdr->page_len; |
| 427 | while (remaining) { |
| 428 | len = min_t(u32, PAGE_SIZE - page_off, remaining); |
Chuck Lever | 08ae4e7 | 2016-03-01 13:05:36 -0500 | [diff] [blame] | 429 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 430 | ret = svc_rdma_dma_map_page(rdma, ctxt, sge_no++, |
| 431 | *ppages++, page_off, len); |
| 432 | if (ret < 0) |
| 433 | return ret; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 434 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 435 | remaining -= len; |
| 436 | page_off = 0; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 437 | } |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 438 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 439 | base = xdr->tail[0].iov_base; |
| 440 | len = xdr->tail[0].iov_len; |
| 441 | tail: |
| 442 | if (len) { |
| 443 | ret = svc_rdma_dma_map_buf(rdma, ctxt, sge_no++, base, len); |
| 444 | if (ret < 0) |
| 445 | return ret; |
| 446 | } |
Chuck Lever | 08ae4e7 | 2016-03-01 13:05:36 -0500 | [diff] [blame] | 447 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 448 | return sge_no - 1; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 449 | } |
| 450 | |
Chuck Lever | c55ab07 | 2017-04-09 13:06:00 -0400 | [diff] [blame] | 451 | /* The svc_rqst and all resources it owns are released as soon as |
| 452 | * svc_rdma_sendto returns. Transfer pages under I/O to the ctxt |
| 453 | * so they are released by the Send completion handler. |
| 454 | */ |
| 455 | static void svc_rdma_save_io_pages(struct svc_rqst *rqstp, |
| 456 | struct svc_rdma_op_ctxt *ctxt) |
| 457 | { |
| 458 | int i, pages = rqstp->rq_next_page - rqstp->rq_respages; |
| 459 | |
| 460 | ctxt->count += pages; |
| 461 | for (i = 0; i < pages; i++) { |
| 462 | ctxt->pages[i + 1] = rqstp->rq_respages[i]; |
| 463 | rqstp->rq_respages[i] = NULL; |
| 464 | } |
| 465 | rqstp->rq_next_page = rqstp->rq_respages + 1; |
| 466 | } |
| 467 | |
Chuck Lever | 17f5f7f | 2017-04-09 13:05:36 -0400 | [diff] [blame] | 468 | /** |
| 469 | * svc_rdma_post_send_wr - Set up and post one Send Work Request |
| 470 | * @rdma: controlling transport |
| 471 | * @ctxt: op_ctxt for transmitting the Send WR |
| 472 | * @num_sge: number of SGEs to send |
| 473 | * @inv_rkey: R_key argument to Send With Invalidate, or zero |
| 474 | * |
| 475 | * Returns: |
| 476 | * %0 if the Send* was posted successfully, |
| 477 | * %-ENOTCONN if the connection was lost or dropped, |
| 478 | * %-EINVAL if there was a problem with the Send we built, |
| 479 | * %-ENOMEM if ib_post_send failed. |
| 480 | */ |
| 481 | int svc_rdma_post_send_wr(struct svcxprt_rdma *rdma, |
| 482 | struct svc_rdma_op_ctxt *ctxt, int num_sge, |
| 483 | u32 inv_rkey) |
| 484 | { |
| 485 | struct ib_send_wr *send_wr = &ctxt->send_wr; |
| 486 | |
| 487 | dprintk("svcrdma: posting Send WR with %u sge(s)\n", num_sge); |
| 488 | |
| 489 | send_wr->next = NULL; |
| 490 | ctxt->cqe.done = svc_rdma_wc_send; |
| 491 | send_wr->wr_cqe = &ctxt->cqe; |
| 492 | send_wr->sg_list = ctxt->sge; |
| 493 | send_wr->num_sge = num_sge; |
| 494 | send_wr->send_flags = IB_SEND_SIGNALED; |
| 495 | if (inv_rkey) { |
| 496 | send_wr->opcode = IB_WR_SEND_WITH_INV; |
| 497 | send_wr->ex.invalidate_rkey = inv_rkey; |
| 498 | } else { |
| 499 | send_wr->opcode = IB_WR_SEND; |
| 500 | } |
| 501 | |
| 502 | return svc_rdma_send(rdma, send_wr); |
| 503 | } |
| 504 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 505 | /* Prepare the portion of the RPC Reply that will be transmitted |
| 506 | * via RDMA Send. The RPC-over-RDMA transport header is prepared |
| 507 | * in sge[0], and the RPC xdr_buf is prepared in following sges. |
| 508 | * |
| 509 | * Depending on whether a Write list or Reply chunk is present, |
| 510 | * the server may send all, a portion of, or none of the xdr_buf. |
| 511 | * In the latter case, only the transport header (sge[0]) is |
| 512 | * transmitted. |
| 513 | * |
| 514 | * RDMA Send is the last step of transmitting an RPC reply. Pages |
| 515 | * involved in the earlier RDMA Writes are here transferred out |
| 516 | * of the rqstp and into the ctxt's page array. These pages are |
| 517 | * DMA unmapped by each Write completion, but the subsequent Send |
| 518 | * completion finally releases these pages. |
| 519 | * |
| 520 | * Assumptions: |
| 521 | * - The Reply's transport header will never be larger than a page. |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 522 | */ |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 523 | static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, |
| 524 | __be32 *rdma_argp, __be32 *rdma_resp, |
| 525 | struct svc_rqst *rqstp, |
| 526 | __be32 *wr_lst, __be32 *rp_ch) |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 527 | { |
Chuck Lever | 9ec6405 | 2016-05-04 10:53:05 -0400 | [diff] [blame] | 528 | struct svc_rdma_op_ctxt *ctxt; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 529 | u32 inv_rkey; |
| 530 | int ret; |
Tom Tucker | 0e7f011 | 2008-04-23 16:49:54 -0500 | [diff] [blame] | 531 | |
Chuck Lever | 9ec6405 | 2016-05-04 10:53:05 -0400 | [diff] [blame] | 532 | ctxt = svc_rdma_get_context(rdma); |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 533 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 534 | ret = svc_rdma_map_reply_hdr(rdma, ctxt, rdma_resp, |
| 535 | svc_rdma_reply_hdr_len(rdma_resp)); |
| 536 | if (ret < 0) |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 537 | goto err; |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 538 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 539 | if (!rp_ch) { |
| 540 | ret = svc_rdma_map_reply_msg(rdma, ctxt, |
| 541 | &rqstp->rq_res, wr_lst); |
| 542 | if (ret < 0) |
Steve Wise | 0bf4828 | 2014-05-28 15:12:01 -0500 | [diff] [blame] | 543 | goto err; |
Chuck Lever | 3fe04ee | 2015-01-13 11:03:03 -0500 | [diff] [blame] | 544 | } |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 545 | |
Chuck Lever | c55ab07 | 2017-04-09 13:06:00 -0400 | [diff] [blame] | 546 | svc_rdma_save_io_pages(rqstp, ctxt); |
Steve Wise | 0bf4828 | 2014-05-28 15:12:01 -0500 | [diff] [blame] | 547 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 548 | inv_rkey = 0; |
| 549 | if (rdma->sc_snd_w_inv) |
| 550 | inv_rkey = svc_rdma_get_inv_rkey(rdma_argp, wr_lst, rp_ch); |
| 551 | ret = svc_rdma_post_send_wr(rdma, ctxt, 1 + ret, inv_rkey); |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 552 | if (ret) |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 553 | goto err; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 554 | |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 555 | return 0; |
| 556 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 557 | err: |
Steve Wise | 21515e4 | 2009-04-29 14:14:00 -0500 | [diff] [blame] | 558 | svc_rdma_unmap_dma(ctxt); |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 559 | svc_rdma_put_context(ctxt, 1); |
Chuck Lever | 9ec6405 | 2016-05-04 10:53:05 -0400 | [diff] [blame] | 560 | return ret; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 561 | } |
| 562 | |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 563 | /* Given the client-provided Write and Reply chunks, the server was not |
| 564 | * able to form a complete reply. Return an RDMA_ERROR message so the |
| 565 | * client can retire this RPC transaction. As above, the Send completion |
| 566 | * routine releases payload pages that were part of a previous RDMA Write. |
| 567 | * |
| 568 | * Remote Invalidation is skipped for simplicity. |
| 569 | */ |
| 570 | static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, |
| 571 | __be32 *rdma_resp, struct svc_rqst *rqstp) |
| 572 | { |
| 573 | struct svc_rdma_op_ctxt *ctxt; |
| 574 | __be32 *p; |
| 575 | int ret; |
| 576 | |
| 577 | ctxt = svc_rdma_get_context(rdma); |
| 578 | |
| 579 | /* Replace the original transport header with an |
| 580 | * RDMA_ERROR response. XID etc are preserved. |
| 581 | */ |
Chuck Lever | 98895ed | 2018-05-07 15:27:11 -0400 | [diff] [blame] | 582 | trace_svcrdma_err_chunk(*rdma_resp); |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 583 | p = rdma_resp + 3; |
| 584 | *p++ = rdma_error; |
| 585 | *p = err_chunk; |
| 586 | |
| 587 | ret = svc_rdma_map_reply_hdr(rdma, ctxt, rdma_resp, 20); |
| 588 | if (ret < 0) |
| 589 | goto err; |
| 590 | |
| 591 | svc_rdma_save_io_pages(rqstp, ctxt); |
| 592 | |
| 593 | ret = svc_rdma_post_send_wr(rdma, ctxt, 1 + ret, 0); |
| 594 | if (ret) |
| 595 | goto err; |
| 596 | |
| 597 | return 0; |
| 598 | |
| 599 | err: |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 600 | svc_rdma_unmap_dma(ctxt); |
| 601 | svc_rdma_put_context(ctxt, 1); |
| 602 | return ret; |
| 603 | } |
| 604 | |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 605 | void svc_rdma_prep_reply_hdr(struct svc_rqst *rqstp) |
| 606 | { |
| 607 | } |
| 608 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 609 | /** |
| 610 | * svc_rdma_sendto - Transmit an RPC reply |
| 611 | * @rqstp: processed RPC request, reply XDR already in ::rq_res |
| 612 | * |
| 613 | * Any resources still associated with @rqstp are released upon return. |
| 614 | * If no reply message was possible, the connection is closed. |
| 615 | * |
| 616 | * Returns: |
| 617 | * %0 if an RPC reply has been successfully posted, |
| 618 | * %-ENOMEM if a resource shortage occurred (connection is lost), |
| 619 | * %-ENOTCONN if posting failed (connection is lost). |
| 620 | */ |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 621 | int svc_rdma_sendto(struct svc_rqst *rqstp) |
| 622 | { |
| 623 | struct svc_xprt *xprt = rqstp->rq_xprt; |
| 624 | struct svcxprt_rdma *rdma = |
| 625 | container_of(xprt, struct svcxprt_rdma, sc_xprt); |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 626 | __be32 *p, *rdma_argp, *rdma_resp, *wr_lst, *rp_ch; |
| 627 | struct xdr_buf *xdr = &rqstp->rq_res; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 628 | struct page *res_page; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 629 | int ret; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 630 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 631 | /* Find the call's chunk lists to decide how to send the reply. |
| 632 | * Receive places the Call's xprt header at the start of page 0. |
Chuck Lever | e5523bd | 2015-01-13 11:03:11 -0500 | [diff] [blame] | 633 | */ |
| 634 | rdma_argp = page_address(rqstp->rq_pages[0]); |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 635 | svc_rdma_get_write_arrays(rdma_argp, &wr_lst, &rp_ch); |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 636 | |
Chuck Lever | e4eb42c | 2016-11-29 11:04:50 -0500 | [diff] [blame] | 637 | /* Create the RDMA response header. xprt->xpt_mutex, |
| 638 | * acquired in svc_send(), serializes RPC replies. The |
| 639 | * code path below that inserts the credit grant value |
| 640 | * into each transport header runs only inside this |
| 641 | * critical section. |
| 642 | */ |
Chuck Lever | 78da2b3 | 2016-01-07 14:49:45 -0500 | [diff] [blame] | 643 | ret = -ENOMEM; |
| 644 | res_page = alloc_page(GFP_KERNEL); |
| 645 | if (!res_page) |
| 646 | goto err0; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 647 | rdma_resp = page_address(res_page); |
Chuck Lever | 98fc21d | 2017-02-07 11:58:23 -0500 | [diff] [blame] | 648 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 649 | p = rdma_resp; |
| 650 | *p++ = *rdma_argp; |
| 651 | *p++ = *(rdma_argp + 1); |
Chuck Lever | 98fc21d | 2017-02-07 11:58:23 -0500 | [diff] [blame] | 652 | *p++ = rdma->sc_fc_credits; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 653 | *p++ = rp_ch ? rdma_nomsg : rdma_msg; |
Chuck Lever | 98fc21d | 2017-02-07 11:58:23 -0500 | [diff] [blame] | 654 | |
| 655 | /* Start with empty chunks */ |
| 656 | *p++ = xdr_zero; |
| 657 | *p++ = xdr_zero; |
| 658 | *p = xdr_zero; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 659 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 660 | if (wr_lst) { |
| 661 | /* XXX: Presume the client sent only one Write chunk */ |
| 662 | ret = svc_rdma_send_write_chunk(rdma, wr_lst, xdr); |
Chuck Lever | 08ae4e7 | 2016-03-01 13:05:36 -0500 | [diff] [blame] | 663 | if (ret < 0) |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 664 | goto err2; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 665 | svc_rdma_xdr_encode_write_list(rdma_resp, wr_lst, ret); |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 666 | } |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 667 | if (rp_ch) { |
| 668 | ret = svc_rdma_send_reply_chunk(rdma, rp_ch, wr_lst, xdr); |
Chuck Lever | 08ae4e7 | 2016-03-01 13:05:36 -0500 | [diff] [blame] | 669 | if (ret < 0) |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 670 | goto err2; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 671 | svc_rdma_xdr_encode_reply_chunk(rdma_resp, rp_ch, ret); |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 672 | } |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 673 | |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 674 | ret = svc_rdma_send_reply_msg(rdma, rdma_argp, rdma_resp, rqstp, |
| 675 | wr_lst, rp_ch); |
Chuck Lever | 3e1eeb9 | 2016-03-01 13:06:11 -0500 | [diff] [blame] | 676 | if (ret < 0) |
Chuck Lever | 9995237 | 2016-09-13 10:52:59 -0400 | [diff] [blame] | 677 | goto err0; |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 678 | return 0; |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 679 | |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 680 | err2: |
Colin Ian King | b20dae70 | 2017-07-13 18:51:15 +0100 | [diff] [blame] | 681 | if (ret != -E2BIG && ret != -EINVAL) |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 682 | goto err1; |
| 683 | |
Chuck Lever | 4757d90 | 2017-04-09 13:06:41 -0400 | [diff] [blame] | 684 | ret = svc_rdma_send_error_msg(rdma, rdma_resp, rqstp); |
| 685 | if (ret < 0) |
| 686 | goto err0; |
| 687 | return 0; |
| 688 | |
Tom Tucker | afd566e | 2008-10-03 15:45:03 -0500 | [diff] [blame] | 689 | err1: |
| 690 | put_page(res_page); |
| 691 | err0: |
Chuck Lever | bd2abef | 2018-05-07 15:27:16 -0400 | [diff] [blame^] | 692 | trace_svcrdma_send_failed(rqstp, ret); |
Chuck Lever | 9a6a180 | 2017-04-09 13:06:25 -0400 | [diff] [blame] | 693 | set_bit(XPT_CLOSE, &xprt->xpt_flags); |
Chuck Lever | 3e1eeb9 | 2016-03-01 13:06:11 -0500 | [diff] [blame] | 694 | return -ENOTCONN; |
Tom Tucker | c06b540 | 2007-12-12 16:13:25 -0600 | [diff] [blame] | 695 | } |