Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
cc1ff32a
Commit
cc1ff32a
authored
Jun 21, 2003
by
Jon Grimm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCTP] Change sysctl settable timers to ms granularity (rmlayer@us.ibm.com)
parent
247d0d19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
28 deletions
+81
-28
include/net/sctp/sctp.h
include/net/sctp/sctp.h
+8
-2
net/sctp/sysctl.c
net/sctp/sysctl.c
+73
-26
No files found.
include/net/sctp/sctp.h
View file @
cc1ff32a
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
* Daisy Chang <daisyc@us.ibm.com>
* Daisy Chang <daisyc@us.ibm.com>
* Sridhar Samudrala <sri@us.ibm.com>
* Sridhar Samudrala <sri@us.ibm.com>
* Ardelle Fan <ardelle.fan@intel.com>
* Ardelle Fan <ardelle.fan@intel.com>
* Ryan Layer <rmlayer@us.ibm.com>
*
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
* be incorporated into the next SCTP release.
...
@@ -311,6 +312,11 @@ void sctp_sysctl_unregister(void);
...
@@ -311,6 +312,11 @@ void sctp_sysctl_unregister(void);
#else
#else
static
inline
void
sctp_sysctl_register
(
void
)
{
return
;
}
static
inline
void
sctp_sysctl_register
(
void
)
{
return
;
}
static
inline
void
sctp_sysctl_unregister
(
void
)
{
return
;
}
static
inline
void
sctp_sysctl_unregister
(
void
)
{
return
;
}
static
inline
int
sctp_sysctl_jiffies_ms
(
ctl_table
*
table
,
int
__user
*
name
,
int
nlen
,
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
void
**
context
)
{
return
-
ENOSYS
;
}
#endif
#endif
/* Size of Supported Address Parameter for 'x' address types. */
/* Size of Supported Address Parameter for 'x' address types. */
...
...
net/sctp/sysctl.c
View file @
cc1ff32a
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
* Mingqin Liu <liuming@us.ibm.com>
* Mingqin Liu <liuming@us.ibm.com>
* Jon Grimm <jgrimm@us.ibm.com>
* Jon Grimm <jgrimm@us.ibm.com>
* Ardelle Fan <ardelle.fan@intel.com>
* Ardelle Fan <ardelle.fan@intel.com>
* Ryan Layer <rmlayer@us.ibm.com>
*
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
* be incorporated into the next SCTP release.
...
@@ -42,42 +43,54 @@
...
@@ -42,42 +43,54 @@
#include <net/sctp/structs.h>
#include <net/sctp/structs.h>
#include <linux/sysctl.h>
#include <linux/sysctl.h>
static
ctl_handler
sctp_sysctl_jiffies_ms
;
static
long
rto_timer_min
=
0
;
static
long
rto_timer_max
=
86400000
;
/* One day */
static
ctl_table
sctp_table
[]
=
{
static
ctl_table
sctp_table
[]
=
{
{
{
.
ctl_name
=
NET_SCTP_RTO_INITIAL
,
.
ctl_name
=
NET_SCTP_RTO_INITIAL
,
.
procname
=
"rto_initial"
,
.
procname
=
"rto_initial"
,
.
data
=
&
sctp_rto_initial
,
.
data
=
&
sctp_rto_initial
,
.
maxlen
=
sizeof
(
int
),
.
maxlen
=
sizeof
(
long
),
.
mode
=
0644
,
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec_jiffies
,
.
proc_handler
=
&
proc_doulongvec_ms_jiffies_minmax
,
.
strategy
=
&
sysctl_jiffies
.
strategy
=
&
sctp_sysctl_jiffies_ms
,
.
extra1
=
&
rto_timer_min
,
.
extra2
=
&
rto_timer_max
},
},
{
{
.
ctl_name
=
NET_SCTP_RTO_MIN
,
.
ctl_name
=
NET_SCTP_RTO_MIN
,
.
procname
=
"rto_min"
,
.
procname
=
"rto_min"
,
.
data
=
&
sctp_rto_min
,
.
data
=
&
sctp_rto_min
,
.
maxlen
=
sizeof
(
int
),
.
maxlen
=
sizeof
(
long
),
.
mode
=
0644
,
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec_jiffies
,
.
proc_handler
=
&
proc_doulongvec_ms_jiffies_minmax
,
.
strategy
=
&
sysctl_jiffies
.
strategy
=
&
sctp_sysctl_jiffies_ms
,
.
extra1
=
&
rto_timer_min
,
.
extra2
=
&
rto_timer_max
},
},
{
{
.
ctl_name
=
NET_SCTP_RTO_MAX
,
.
ctl_name
=
NET_SCTP_RTO_MAX
,
.
procname
=
"rto_max"
,
.
procname
=
"rto_max"
,
.
data
=
&
sctp_rto_max
,
.
data
=
&
sctp_rto_max
,
.
maxlen
=
sizeof
(
int
),
.
maxlen
=
sizeof
(
long
),
.
mode
=
0644
,
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec_jiffies
,
.
proc_handler
=
&
proc_doulongvec_ms_jiffies_minmax
,
.
strategy
=
&
sysctl_jiffies
.
strategy
=
&
sctp_sysctl_jiffies_ms
,
.
extra1
=
&
rto_timer_min
,
.
extra2
=
&
rto_timer_max
},
},
{
{
.
ctl_name
=
NET_SCTP_VALID_COOKIE_LIFE
,
.
ctl_name
=
NET_SCTP_VALID_COOKIE_LIFE
,
.
procname
=
"valid_cookie_life"
,
.
procname
=
"valid_cookie_life"
,
.
data
=
&
sctp_valid_cookie_life
,
.
data
=
&
sctp_valid_cookie_life
,
.
maxlen
=
sizeof
(
int
),
.
maxlen
=
sizeof
(
long
),
.
mode
=
0644
,
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec_jiffies
,
.
proc_handler
=
&
proc_doulongvec_ms_jiffies_minmax
,
.
strategy
=
&
sysctl_jiffies
.
strategy
=
&
sctp_sysctl_jiffies_ms
,
.
extra1
=
&
rto_timer_min
,
.
extra2
=
&
rto_timer_max
},
},
{
{
.
ctl_name
=
NET_SCTP_MAX_BURST
,
.
ctl_name
=
NET_SCTP_MAX_BURST
,
...
@@ -183,3 +196,37 @@ void sctp_sysctl_unregister(void)
...
@@ -183,3 +196,37 @@ void sctp_sysctl_unregister(void)
{
{
unregister_sysctl_table
(
sctp_sysctl_header
);
unregister_sysctl_table
(
sctp_sysctl_header
);
}
}
/* Strategy function to convert jiffies to milliseconds. */
static
int
sctp_sysctl_jiffies_ms
(
ctl_table
*
table
,
int
__user
*
name
,
int
nlen
,
void
__user
*
oldval
,
size_t
__user
*
oldlenp
,
void
__user
*
newval
,
size_t
newlen
,
void
**
context
)
{
if
(
oldval
)
{
size_t
olen
;
if
(
oldlenp
)
{
if
(
get_user
(
olen
,
oldlenp
))
return
-
EFAULT
;
if
(
olen
!=
sizeof
(
int
))
return
-
EINVAL
;
}
if
(
put_user
((
*
(
int
*
)(
table
->
data
)
/
HZ
)
*
1000
,
(
int
*
)
oldval
)
||
(
oldlenp
&&
put_user
(
sizeof
(
int
),
oldlenp
)))
return
-
EFAULT
;
}
if
(
newval
&&
newlen
)
{
int
new
;
if
(
newlen
!=
sizeof
(
int
))
return
-
EINVAL
;
if
(
get_user
(
new
,
(
int
*
)
newval
))
return
-
EFAULT
;
*
(
int
*
)(
table
->
data
)
=
(
new
*
HZ
)
*
1000
;
}
return
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment