summaryrefslogtreecommitdiff
path: root/sys-utils/cytune.8
blob: fd8239151735cc6bf6f25c582fd434e4e15a5189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
.\" cytune.8 --
.\" Created: Sat Mar  4 17:44:53 1995 by faith@cs.unc.edu
.\" Update: Sat Mar  4 18:22:24 1995 by faith@cs.unc.edu
.\" Update: Sun Mar  5 06:40:12 1995 by njs@scifi.emi.net
.\" Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" "
.TH CYTUNE 8 "September 2011" "util-linux" "System Administration"
.SH NAME
cytune \- tune driver parameters for Cyclades-Z multiport serial card
.SH SYNOPSIS
.B cytune
[options] tty [...]
.SH DESCRIPTION
.B cytune
queries and modifies the interruption threshold for the Cyclades driver.
Each serial line on a Cyclades card has a 12-byte FIFO for input (and another
12-byte FIFO for output).  The "threshold" specifies how many input
characters must be present in the FIFO before an interruption is raised.
When a Cyclades tty is opened, this threshold is set to a default value based
on baud rate:
.sp
.RS
Baud        Threshold
.sp
50-4800            10
.br
9600                8
.br
19200               4
.br
38400               2
.br
57600-150000        1
.RE
.PP
If the threshold is set too low, the large number of interruptions can load
the machine and decrease overall system throughput.  If the threshold is set
too high, the FIFO buffer can overflow, and characters will be lost.  Slower
machines, however, may not be able to deal with the interrupt load, and will
require that the threshold be adjusted upwards.
.PP
If the cyclades driver was compiled with
.B ENABLE_MONITORING
defined, the cytune command can be used with the
.B \-q
option to report interrupts over the monitoring interval and characters
transferred over the monitoring interval.  It will also report the state of
the FIFO.  The maximum number of characters in the FIFO when an interrupt
occurred, the instantaneous count of characters in the FIFO, and how many
characters are now in the FIFO are reported.  This output might look like
this:
.sp
.RS
/dev/cubC0: 830 ints, 9130 chars; fifo: 11 threshold, 11 max, 11 now
.br
   166.259866 interrupts/second, 1828.858521 characters/second
.RE
.PP
This output indicates that for this monitoring period, the interrupts were
always being handled within one character time, because
.B max
never rose above
.BR threshold .
This is good, and you can probably run this way, provided that a large number
of samples come out this way.  You will lose characters if you overrun the
FIFO, as the Cyclades hardware does not seem to support the RTS RS-232 signal
line for hardware flow control from the DCE to the DTE.
.PP
In query mode
.B cytune
will produce a summary report when ended with a SIGINT or when the threshold
or timeout is changed.
.PP
There may be a responsiveness vs. throughput tradeoff.  The Cyclades card, at
the higher speeds, is capable of putting a very high interrupt load on the
system.  This will reduce the amount of CPU time available for other tasks on
your system.  However, the time it takes to respond to a single character may
be increased if you increase the threshold.  This might be noticed by
monitoring
.BR ping (8)
times on a SLIP link controlled by a Cyclades card.  If your SLIP link is
generally used for interactive work such as
.BR telnet (1),
you may want to leave the threshold low, so that characters are responded to
as quickly as possible.  If your SLIP link is generally used for file
transfer, WWW, and the like, setting the FIFO to a high value is likely to
reduce the load on your system while not significantly affecting throughput.
Alternatively, see the
.B \-t
or
.B \-T
options to adjust the time that the cyclades waits before flushing its
buffer.  Units are 5ms.
.PP
If you are running a mouse on a Cyclades port, it is likely that you would
want to maintain the threshold and timeout at a low value.
.PP
.SH OPTIONS
.TP
\fB\-s\fR, \fB\-\-set\-threshold\fR \fIvalue\fR
Set the current threshold to
.I value
characters.  Note that if the
.I tty
is not being held open by another process, the threshold will be reset on the
next open.  Only values between 1 and 12, inclusive, are permitted.
.TP
\fB\-t\fR, \fB\-\-set\-flush\fR \fIvalue\fR
Set the current flush timeout to
.I value
units.  Note that if the
.I tty
is not being held open by another process, the threshold will be reset on the
next open.  Only values between 0 and 255, inclusive, are permitted.  Setting
.I value
to zero forces the default, currently 0x20 (160ms), but soon to be 0x02
(10ms).  Units are 5 ms.
.TP
\fB\-g\fR, \fB\-\-get\-threshold\fR
Get the current threshold and timeout.
.TP
\fB\-S\fR, \fB\-\-set\-default\-threshold\fR \fIvalue\fR
Set the default threshold to
.I value
characters.  When the
.I tty
is next opened, this value will be used instead of the default.  Only values
between 1 and 12, inclusive, are permitted.
.TP
\fB\-T\fR, \fB\-\-set\-default\-flush\fR \fIvalue\fR
Set the default flush timeout to
.I value
units.  When the
.I tty
is next opened, this value will be used instead of the default.  If
.I value
is zero, then the the value will default to 0x20 (160ms), soon to be 0x02
(10ms).
.TP
\fB\-G\fR, \fB\-\-get\-glush\fR
Get the default threshold and flush timeout values.
.TP
\fB\-q\fR, \fB\-\-stats\fR
Gather statistics about the
.IR tty .
The results are only valid if the Cyclades driver has been compiled with
.B ENABLE_MONITORING
defined.  This is probably not the default.
.TP
\fB\-i\fR, \fB\-\-interval\fR \fIinterval\fR
Statistics will be gathered every
.I interval
seconds.
.SH BUGS
If you run two copies of
.B cytune
at the same time to report statistics about the same port, the 'ints', 'chars',
and 'max' value will be reset and not reported correctly.
.B cytune
should prevent this, but does not.
.\" .SH AUTHOR
.\" Nick Simicich (njs@scifi.emi.net), with modifications by
.\" Rik Faith (faith@cs.unc.edu)
.SH FILES
.I /dev/ttyC[0-8]
.br
.I /dev/cubC[0-8]
.SH "SEE ALSO"
.BR setserial (8)
.SH AVAILABILITY
The cytune command is part of the util-linux package and is available from
.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .