| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* sysctls for configuring RxRPC operating parameters |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. |
|---|
| 4 | 5 | * Written by David Howells (dhowells@redhat.com) |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public Licence |
|---|
| 8 | | - * as published by the Free Software Foundation; either version |
|---|
| 9 | | - * 2 of the Licence, or (at your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #include <linux/sysctl.h> |
|---|
| .. | .. |
|---|
| 15 | 11 | #include "ar-internal.h" |
|---|
| 16 | 12 | |
|---|
| 17 | 13 | static struct ctl_table_header *rxrpc_sysctl_reg_table; |
|---|
| 18 | | -static const unsigned int one = 1; |
|---|
| 19 | 14 | static const unsigned int four = 4; |
|---|
| 20 | | -static const unsigned int thirtytwo = 32; |
|---|
| 15 | +static const unsigned int max_backlog = RXRPC_BACKLOG_MAX - 1; |
|---|
| 21 | 16 | static const unsigned int n_65535 = 65535; |
|---|
| 22 | 17 | static const unsigned int n_max_acks = RXRPC_RXTX_BUFF_SIZE - 1; |
|---|
| 23 | 18 | static const unsigned long one_jiffy = 1; |
|---|
| .. | .. |
|---|
| 26 | 21 | /* |
|---|
| 27 | 22 | * RxRPC operating parameters. |
|---|
| 28 | 23 | * |
|---|
| 29 | | - * See Documentation/networking/rxrpc.txt and the variable definitions for more |
|---|
| 24 | + * See Documentation/networking/rxrpc.rst and the variable definitions for more |
|---|
| 30 | 25 | * information on the individual parameters. |
|---|
| 31 | 26 | */ |
|---|
| 32 | 27 | static struct ctl_table rxrpc_sysctl_table[] = { |
|---|
| .. | .. |
|---|
| 76 | 71 | .extra1 = (void *)&one_jiffy, |
|---|
| 77 | 72 | .extra2 = (void *)&max_jiffies, |
|---|
| 78 | 73 | }, |
|---|
| 79 | | - { |
|---|
| 80 | | - .procname = "resend_timeout", |
|---|
| 81 | | - .data = &rxrpc_resend_timeout, |
|---|
| 82 | | - .maxlen = sizeof(unsigned long), |
|---|
| 83 | | - .mode = 0644, |
|---|
| 84 | | - .proc_handler = proc_doulongvec_ms_jiffies_minmax, |
|---|
| 85 | | - .extra1 = (void *)&one_jiffy, |
|---|
| 86 | | - .extra2 = (void *)&max_jiffies, |
|---|
| 87 | | - }, |
|---|
| 88 | 74 | |
|---|
| 89 | 75 | /* Non-time values */ |
|---|
| 90 | | - { |
|---|
| 91 | | - .procname = "max_client_conns", |
|---|
| 92 | | - .data = &rxrpc_max_client_connections, |
|---|
| 93 | | - .maxlen = sizeof(unsigned int), |
|---|
| 94 | | - .mode = 0644, |
|---|
| 95 | | - .proc_handler = proc_dointvec_minmax, |
|---|
| 96 | | - .extra1 = (void *)&rxrpc_reap_client_connections, |
|---|
| 97 | | - }, |
|---|
| 98 | 76 | { |
|---|
| 99 | 77 | .procname = "reap_client_conns", |
|---|
| 100 | 78 | .data = &rxrpc_reap_client_connections, |
|---|
| 101 | 79 | .maxlen = sizeof(unsigned int), |
|---|
| 102 | 80 | .mode = 0644, |
|---|
| 103 | 81 | .proc_handler = proc_dointvec_minmax, |
|---|
| 104 | | - .extra1 = (void *)&one, |
|---|
| 105 | | - .extra2 = (void *)&rxrpc_max_client_connections, |
|---|
| 82 | + .extra1 = (void *)SYSCTL_ONE, |
|---|
| 83 | + .extra2 = (void *)&n_65535, |
|---|
| 106 | 84 | }, |
|---|
| 107 | 85 | { |
|---|
| 108 | 86 | .procname = "max_backlog", |
|---|
| .. | .. |
|---|
| 111 | 89 | .mode = 0644, |
|---|
| 112 | 90 | .proc_handler = proc_dointvec_minmax, |
|---|
| 113 | 91 | .extra1 = (void *)&four, |
|---|
| 114 | | - .extra2 = (void *)&thirtytwo, |
|---|
| 92 | + .extra2 = (void *)&max_backlog, |
|---|
| 115 | 93 | }, |
|---|
| 116 | 94 | { |
|---|
| 117 | 95 | .procname = "rx_window_size", |
|---|
| .. | .. |
|---|
| 119 | 97 | .maxlen = sizeof(unsigned int), |
|---|
| 120 | 98 | .mode = 0644, |
|---|
| 121 | 99 | .proc_handler = proc_dointvec_minmax, |
|---|
| 122 | | - .extra1 = (void *)&one, |
|---|
| 100 | + .extra1 = (void *)SYSCTL_ONE, |
|---|
| 123 | 101 | .extra2 = (void *)&n_max_acks, |
|---|
| 124 | 102 | }, |
|---|
| 125 | 103 | { |
|---|
| .. | .. |
|---|
| 128 | 106 | .maxlen = sizeof(unsigned int), |
|---|
| 129 | 107 | .mode = 0644, |
|---|
| 130 | 108 | .proc_handler = proc_dointvec_minmax, |
|---|
| 131 | | - .extra1 = (void *)&one, |
|---|
| 109 | + .extra1 = (void *)SYSCTL_ONE, |
|---|
| 132 | 110 | .extra2 = (void *)&n_65535, |
|---|
| 133 | 111 | }, |
|---|
| 134 | 112 | { |
|---|
| .. | .. |
|---|
| 137 | 115 | .maxlen = sizeof(unsigned int), |
|---|
| 138 | 116 | .mode = 0644, |
|---|
| 139 | 117 | .proc_handler = proc_dointvec_minmax, |
|---|
| 140 | | - .extra1 = (void *)&one, |
|---|
| 118 | + .extra1 = (void *)SYSCTL_ONE, |
|---|
| 141 | 119 | .extra2 = (void *)&four, |
|---|
| 142 | 120 | }, |
|---|
| 143 | 121 | |
|---|