4 * The contents of this file are subject to the terms of the
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) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
24 * Copyright 2013 Joyent, Inc. All rights reserved.
25 */
26
27 /*
28 * Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
29 * All rights reserved.
30 */
31
32 #include <sys/errno.h>
33 #include <sys/param.h>
34 #include <sys/types.h>
35 #include <sys/user.h>
36 #include <sys/stat.h>
37 #include <sys/time.h>
38 #include <sys/utsname.h>
39 #include <sys/vfs.h>
40 #include <sys/vfs_opreg.h>
41 #include <sys/vnode.h>
42 #include <sys/pathname.h>
43 #include <sys/bootconf.h>
268 /*
269 * Returns the preferred transfer size in bytes based on
270 * what network interfaces are available.
271 */
272 int
273 nfstsize(void)
274 {
275 /*
276 * For the moment, just return NFS_MAXDATA until we can query the
277 * appropriate transport.
278 */
279 return (NFS_MAXDATA);
280 }
281
282 /*
283 * Returns the preferred transfer size in bytes based on
284 * what network interfaces are available.
285 */
286
287 /* this should reflect the largest transfer size possible */
288 static int nfs3_max_transfer_size = 1024 * 1024;
289
290 int
291 nfs3tsize(void)
292 {
293 /*
294 * For the moment, just return nfs3_max_transfer_size until we
295 * can query the appropriate transport.
296 */
297 return (nfs3_max_transfer_size);
298 }
299
300 static uint_t nfs3_max_transfer_size_clts = 32 * 1024;
301 static uint_t nfs3_max_transfer_size_cots = 1024 * 1024;
302 static uint_t nfs3_max_transfer_size_rdma = 1024 * 1024;
303
304 uint_t
305 nfs3_tsize(struct knetconfig *knp)
306 {
307
308 if (knp->knc_semantics == NC_TPI_COTS_ORD ||
309 knp->knc_semantics == NC_TPI_COTS)
310 return (nfs3_max_transfer_size_cots);
311 if (knp->knc_semantics == NC_TPI_RDMA)
312 return (nfs3_max_transfer_size_rdma);
313 return (nfs3_max_transfer_size_clts);
314 }
315
316 uint_t
317 rfs3_tsize(struct svc_req *req)
318 {
319
320 if (req->rq_xprt->xp_type == T_COTS_ORD ||
321 req->rq_xprt->xp_type == T_COTS)
322 return (nfs3_max_transfer_size_cots);
|
4 * The contents of this file are subject to the terms of the
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) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
24 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2013 Joyent, Inc. All rights reserved.
26 */
27
28 /*
29 * Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
30 * All rights reserved.
31 */
32
33 #include <sys/errno.h>
34 #include <sys/param.h>
35 #include <sys/types.h>
36 #include <sys/user.h>
37 #include <sys/stat.h>
38 #include <sys/time.h>
39 #include <sys/utsname.h>
40 #include <sys/vfs.h>
41 #include <sys/vfs_opreg.h>
42 #include <sys/vnode.h>
43 #include <sys/pathname.h>
44 #include <sys/bootconf.h>
269 /*
270 * Returns the preferred transfer size in bytes based on
271 * what network interfaces are available.
272 */
273 int
274 nfstsize(void)
275 {
276 /*
277 * For the moment, just return NFS_MAXDATA until we can query the
278 * appropriate transport.
279 */
280 return (NFS_MAXDATA);
281 }
282
283 /*
284 * Returns the preferred transfer size in bytes based on
285 * what network interfaces are available.
286 */
287
288 /* this should reflect the largest transfer size possible */
289 volatile int nfs3_max_transfer_size = 1024 * 1024;
290
291 int
292 nfs3tsize(void)
293 {
294 /*
295 * For the moment, just return nfs3_max_transfer_size until we
296 * can query the appropriate transport.
297 */
298 return (nfs3_max_transfer_size);
299 }
300
301 volatile uint_t nfs3_max_transfer_size_clts = 32 * 1024;
302 volatile uint_t nfs3_max_transfer_size_cots = 1024 * 1024;
303 volatile uint_t nfs3_max_transfer_size_rdma = 1024 * 1024;
304
305 uint_t
306 nfs3_tsize(struct knetconfig *knp)
307 {
308
309 if (knp->knc_semantics == NC_TPI_COTS_ORD ||
310 knp->knc_semantics == NC_TPI_COTS)
311 return (nfs3_max_transfer_size_cots);
312 if (knp->knc_semantics == NC_TPI_RDMA)
313 return (nfs3_max_transfer_size_rdma);
314 return (nfs3_max_transfer_size_clts);
315 }
316
317 uint_t
318 rfs3_tsize(struct svc_req *req)
319 {
320
321 if (req->rq_xprt->xp_type == T_COTS_ORD ||
322 req->rq_xprt->xp_type == T_COTS)
323 return (nfs3_max_transfer_size_cots);
|