5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2012 by Delphix. All rights reserved.
  24  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  25  */
  26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  27 /* All Rights Reserved */
  28 /*
  29  * Portions of this source code were derived from Berkeley
  30  * 4.3 BSD under license from the Regents of the University of
  31  * California.
  32  */
  33 
  34 /*
  35  * Server side of RPC over RDMA in the kernel.
  36  */
  37 
  38 #include <sys/param.h>
  39 #include <sys/types.h>
  40 #include <sys/user.h>
  41 #include <sys/sysmacros.h>
  42 #include <sys/proc.h>
  43 #include <sys/file.h>
  44 #include <sys/errno.h>
 
 
 131 static bool_t rpcmsg_length(xdrproc_t,
 132                 caddr_t,
 133                 struct rpc_msg *, bool_t, int);
 134 
 135 /*
 136  * Server transport operations vector.
 137  */
 138 struct svc_ops rdma_svc_ops = {
 139         svc_rdma_krecv,         /* Get requests */
 140         svc_rdma_kgetargs,      /* Deserialize arguments */
 141         svc_rdma_ksend,         /* Send reply */
 142         svc_rdma_kfreeargs,     /* Free argument data space */
 143         svc_rdma_kdestroy,      /* Destroy transport handle */
 144         svc_rdma_kdup,          /* Check entry in dup req cache */
 145         svc_rdma_kdupdone,      /* Mark entry in dup req cache as done */
 146         svc_rdma_kgetres,       /* Get pointer to response buffer */
 147         svc_rdma_kfreeres,      /* Destroy pre-serialized response header */
 148         svc_rdma_kclone_destroy,        /* Destroy a clone xprt */
 149         svc_rdma_kstart,        /* Tell `ready-to-receive' to rpcmod */
 150         svc_rdma_kclone_xprt,   /* Transport specific clone xprt */
 151         svc_rdma_ktattrs        /* Get Transport Attributes */
 152 };
 153 
 154 /*
 155  * Server statistics
 156  * NOTE: This structure type is duplicated in the NFS fast path.
 157  */
 158 struct {
 159         kstat_named_t   rscalls;
 160         kstat_named_t   rsbadcalls;
 161         kstat_named_t   rsnullrecv;
 162         kstat_named_t   rsbadlen;
 163         kstat_named_t   rsxdrcall;
 164         kstat_named_t   rsdupchecks;
 165         kstat_named_t   rsdupreqs;
 166         kstat_named_t   rslongrpcs;
 167         kstat_named_t   rstotalreplies;
 168         kstat_named_t   rstotallongreplies;
 169         kstat_named_t   rstotalinlinereplies;
 170 } rdmarsstat = {
 171         { "calls",      KSTAT_DATA_UINT64 },
 
 | 
 
 
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2012 by Delphix. All rights reserved.
  24  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  25  * Copyright 2012 Marcel Telka <marcel@telka.sk>
  26  * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  27  */
  28 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  29 /* All Rights Reserved */
  30 /*
  31  * Portions of this source code were derived from Berkeley
  32  * 4.3 BSD under license from the Regents of the University of
  33  * California.
  34  */
  35 
  36 /*
  37  * Server side of RPC over RDMA in the kernel.
  38  */
  39 
  40 #include <sys/param.h>
  41 #include <sys/types.h>
  42 #include <sys/user.h>
  43 #include <sys/sysmacros.h>
  44 #include <sys/proc.h>
  45 #include <sys/file.h>
  46 #include <sys/errno.h>
 
 
 133 static bool_t rpcmsg_length(xdrproc_t,
 134                 caddr_t,
 135                 struct rpc_msg *, bool_t, int);
 136 
 137 /*
 138  * Server transport operations vector.
 139  */
 140 struct svc_ops rdma_svc_ops = {
 141         svc_rdma_krecv,         /* Get requests */
 142         svc_rdma_kgetargs,      /* Deserialize arguments */
 143         svc_rdma_ksend,         /* Send reply */
 144         svc_rdma_kfreeargs,     /* Free argument data space */
 145         svc_rdma_kdestroy,      /* Destroy transport handle */
 146         svc_rdma_kdup,          /* Check entry in dup req cache */
 147         svc_rdma_kdupdone,      /* Mark entry in dup req cache as done */
 148         svc_rdma_kgetres,       /* Get pointer to response buffer */
 149         svc_rdma_kfreeres,      /* Destroy pre-serialized response header */
 150         svc_rdma_kclone_destroy,        /* Destroy a clone xprt */
 151         svc_rdma_kstart,        /* Tell `ready-to-receive' to rpcmod */
 152         svc_rdma_kclone_xprt,   /* Transport specific clone xprt */
 153         svc_rdma_ktattrs,       /* Get Transport Attributes */
 154         NULL,                   /* Increment transport reference count */
 155         NULL                    /* Decrement transport reference count */
 156 };
 157 
 158 /*
 159  * Server statistics
 160  * NOTE: This structure type is duplicated in the NFS fast path.
 161  */
 162 struct {
 163         kstat_named_t   rscalls;
 164         kstat_named_t   rsbadcalls;
 165         kstat_named_t   rsnullrecv;
 166         kstat_named_t   rsbadlen;
 167         kstat_named_t   rsxdrcall;
 168         kstat_named_t   rsdupchecks;
 169         kstat_named_t   rsdupreqs;
 170         kstat_named_t   rslongrpcs;
 171         kstat_named_t   rstotalreplies;
 172         kstat_named_t   rstotallongreplies;
 173         kstat_named_t   rstotalinlinereplies;
 174 } rdmarsstat = {
 175         { "calls",      KSTAT_DATA_UINT64 },
 
 |