]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - man/man8/tc-can.8
man page changes
[lisovros/iproute2_canprio.git] / man / man8 / tc-can.8
1 .TH CAN 8 "8 May 2012" "iproute2" "Linux"
2 .SH NAME
3 CAN \- Controller Area Network classifier
4 .SH SYNOPSIS
5 .B tc filter ... dev
6 DEV
7 .B parent
8 CLASSID
9 .B [ prio
10 PRIORITY
11 .B ] [ protocol can ] [ handle 
12 HANDLE
13 .B ] can [ 
14 MATCHSPEC
15 .B ] [ flowid 
16 FLOWID
17 .B ]
18
19 .B CLASSID := major:minor
20 .br
21 .B FLOWID := major:minor
22 .br
23 .B MATCHSPEC := { sffid 
24 FILTERID
25 .B | effid 
26 FILTERID
27 .B | MATCHSPEC ... }
28 .br
29 .B FILTERID := canid[:mask]
30
31 .BR CLASSID ,
32 .BR FLOWID ,
33 .BR canid
34 and
35 .B mask
36 are parsed as hexadecimal input.
37
38 .SH DESCRIPTION
39 The CAN classifier may be used with any available
40 .B qdisc
41 on Controller Area Network (CAN) frames passed through AF_CAN
42 networking subsystem. The classifier classifies CAN frames according
43 to their identifiers. It can be used on CAN frames with both SFF or
44 EFF identifiers.
45
46 It is possible to add CAN classifier to any qdisc configured on any networking
47 device, however it will ignore non-CAN packets.
48
49
50 .SH CLASSIFICATION
51 The filtering rules are stored in an array, which is traversed during
52 classification. This means that the worst-case time needed for classification
53 increases with the number of configured rules.
54
55
56 .SH INTERNALS
57 The filter implements an optimization for matching SFF frames using a bitmap
58 with one bit for every ID. With this optimization, the classification time
59 for SFF frames is nearly constant independently of the number of rules.
60 Rules for EFF frames are always stored in an array.
61
62 With very few configured SFF rules, the use of an array may be
63 faster, though.
64
65 The decision whether to use the bitmap- or array-based implementation needs
66 to be done at compile time.
67
68
69 .SH EXAMPLE
70 This example shows how to set
71 .B prio qdisc
72 with
73 .B CAN
74 classifier.
75
76 .nf
77 tc qdisc add dev can0 root handle 1: prio
78
79 tc filter add dev can0 parent 1:0 prio 1 handle 0xa \\
80     can sffid 0x7ff:0xf flowid 1:1
81 tc filter add dev can0 parent 1:0 prio 2 handle 0xb \\
82     can sffid 0xC0:0x7ff effid 0x80:0x7ff flowid 1:2
83 tc filter add dev can0 parent 1:0 prio 3 \\
84     can sffid 0x80:0x7ff flowid 1:2
85 tc filter add dev can0 parent 1:0 prio 4 \\
86     can sffid 0x0:0x0 effid 0x0:0x0 flowid 1:3
87 .fi
88
89
90 .SH BUGS
91 The maximum number or rules passed from
92 .BR tc(8)
93 utility to CAN classifier is fixed. The limit is set at compilation time
94 (default is 128).
95
96
97 .SH SEE ALSO
98 .BR tc(8)
99
100
101 .SH AUTHORS
102 Michal Sojka <sojkam1@fel.cvut.cz>, Pavel Pisa <pisa@cmp.felk.cvut.cz>,
103 Rostislav Lisovy <lisovy@gmail.cz>.
104
105 This manpage maintained by Rostislav Lisovy <lisovy@gmail.com>
106
107