1 /* 2 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 3 */ 4 5 /* 6 * This file contains code imported from the OFED rds source file ib_sysctl.c 7 * Oracle elects to have and use the contents of ib_sysctl.c under and governed 8 * by the OpenIB.org BSD license (see below for full license text). However, 9 * the following notice accompanied the original version of this file: 10 */ 11 12 /* 13 * Copyright (c) 2006 Oracle. All rights reserved. 14 * 15 * This software is available to you under a choice of one of two 16 * licenses. You may choose to be licensed under the terms of the GNU 17 * General Public License (GPL) Version 2, available from the file 18 * COPYING in the main directory of this source tree, or the 19 * OpenIB.org BSD license below: 20 * 21 * Redistribution and use in source and binary forms, with or 22 * without modification, are permitted provided that the following 23 * conditions are met: 24 * 25 * - Redistributions of source code must retain the above 26 * copyright notice, this list of conditions and the following 27 * disclaimer. 28 * 29 * - Redistributions in binary form must reproduce the above 30 * copyright notice, this list of conditions and the following 31 * disclaimer in the documentation and/or other materials 32 * provided with the distribution. 33 * 34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 36 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 37 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 38 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 39 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 40 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 41 * SOFTWARE. 42 * 43 */ 44 #include <sys/ib/clients/rdsv3/ib.h> 45 #include <sys/ib/clients/rdsv3/rdsv3_debug.h> 46 47 unsigned long rdsv3_ib_sysctl_max_send_wr = RDSV3_IB_DEFAULT_SEND_WR; 48 unsigned long rdsv3_ib_sysctl_max_recv_wr = RDSV3_IB_DEFAULT_RECV_WR; 49 unsigned long rdsv3_ib_sysctl_max_recv_allocation = 50 (512 * 1024 * 1024) / RDSV3_FRAG_SIZE; 51 /* hardware will fail CQ creation long before this */ 52 53 unsigned long rdsv3_ib_sysctl_max_unsig_wrs = 16; 54 55 unsigned long rdsv3_ib_sysctl_max_unsig_bytes = (16 << 20); 56 57 unsigned long rdsv3_max_bcopy_size; 58 59 /* 60 * This sysctl does nothing. 61 * 62 * Backwards compatibility with RDS 3.0 wire protocol 63 * disables initial FC credit exchange. 64 * If it's ever possible to drop 3.0 support, 65 * setting this to 1 and moving init/refill of send/recv 66 * rings from ib_cm_connect_complete() back into ib_setup_qp() 67 * will cause credits to be added before protocol negotiation. 68 */ 69 unsigned int rdsv3_ib_sysctl_flow_control = 0; 70 71 void 72 rdsv3_ib_sysctl_exit(void) 73 { 74 } 75 76 int 77 rdsv3_ib_sysctl_init(void) 78 { 79 RDSV3_DPRINTF2("rdsv3_ib_sysctl_init", 80 "rdsv3_ib_sysctl_max_send_wr = 0x%lx " 81 "rdsv3_ib_sysctl_max_recv_wr = 0x%lx " 82 "rdsv3_ib_sysctl_max_recv_allocation = 0x%lx " 83 "rdsv3_ib_sysctl_max_unsig_wrs = 0x%lx " 84 "rdsv3_ib_sysctl_max_unsig_bytes = 0x%lx " 85 "rdsv3_ib_sysctl_flow_control = 0x%x", 86 rdsv3_ib_sysctl_max_send_wr, 87 rdsv3_ib_sysctl_max_recv_wr, 88 rdsv3_ib_sysctl_max_recv_allocation, 89 rdsv3_ib_sysctl_max_unsig_wrs, 90 rdsv3_ib_sysctl_max_unsig_bytes, 91 rdsv3_ib_sysctl_flow_control); 92 93 rdsv3_max_bcopy_size = rdsv3_ib_sysctl_max_send_wr * RDSV3_FRAG_SIZE; 94 return (0); 95 } 96