From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: linux-can@vger.kernel.org, lartc@vger.kernel.org,
pisa@cmp.felk.cvut.cz, sojkam1@fel.cvut.cz, lisovy@gmail.com,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH iproute2 v2 3/3] CAN Filter/Classifier -- Documentation
Date: Fri, 27 Jul 2012 12:02:43 +0200 [thread overview]
Message-ID: <1343383363-6174-4-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1343383363-6174-1-git-send-email-mkl@pengutronix.de>
From: Rostislav Lisovy <lisovy@gmail.com>
Manpage describing usage of CAN Filter.
Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v1:
- remove trailing whitespace
man/man8/tc-can.8 | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
create mode 100644 man/man8/tc-can.8
diff --git a/man/man8/tc-can.8 b/man/man8/tc-can.8
new file mode 100644
index 0000000..d60e872
--- /dev/null
+++ b/man/man8/tc-can.8
@@ -0,0 +1,97 @@
+.TH CAN 8 "8 May 2012" "iproute2" "Linux"
+.SH NAME
+CAN \- Controller Area Network classifier
+.SH SYNOPSIS
+.B tc filter ... dev
+DEV
+.B parent
+CLASSID
+.B [ prio
+PRIORITY
+.B ] [ protocol can ] [ handle
+HANDLE
+.B ] can [
+MATCHSPEC
+.B ] [ flowid
+FLOWID
+.B ]
+
+.B CLASSID := major:minor
+.br
+.B FLOWID := major:minor
+.br
+.B MATCHSPEC := { sffid
+FILTERID
+.B | effid
+FILTERID
+.B | MATCHSPEC ... }
+.br
+.B FILTERID := canid[:mask]
+
+.BR CLASSID ,
+.BR FLOWID ,
+.BR canid
+and
+.B mask
+are parsed as hexadecimal input.
+
+
+.SH DESCRIPTION
+The CAN classifier may be used with any available
+.B qdisc
+on Controller Area Network (CAN) frames passed through AF_CAN
+networking subsystem. The classifier classifies CAN frames according
+to their identifiers. It can be used on CAN frames with both SFF or
+EFF identifiers.
+
+It is possible to add CAN classifier to any qdisc configured on any networking
+device, however it will ignore non-CAN packets.
+
+
+.SH CLASSIFICATION
+The filtering rules for EFF frames are stored in an array, which is traversed
+during classification. This means that the worst-case time needed for
+classification of EFF frames increases with the number of configured rules.
+
+The filter implements an optimization for matching SFF frames using a bitmap
+with one bit for every ID. With this optimization, the classification time
+for SFF frames is nearly constant independently of the number of rules.
+
+.SH EXAMPLE
+This example shows how to set
+.B prio qdisc
+with
+.B CAN
+classifier.
+
+.nf
+tc qdisc add dev can0 root handle 1: prio
+
+tc filter add dev can0 parent 1:0 prio 1 handle 0xa \\
+ can sffid 0x7ff:0xf flowid 1:1
+tc filter add dev can0 parent 1:0 prio 2 handle 0xb \\
+ can sffid 0xC0:0x7ff effid 0x80:0x7ff flowid 1:2
+tc filter add dev can0 parent 1:0 prio 3 \\
+ can sffid 0x80:0x7ff flowid 1:2
+tc filter add dev can0 parent 1:0 prio 4 \\
+ can sffid 0x0:0x0 effid 0x0:0x0 flowid 1:3
+.fi
+
+
+.SH BUGS
+The maximum number or rules passed from
+.BR tc(8)
+utility to CAN classifier is fixed. The limit is set at compilation time
+(default is 128).
+
+
+.SH SEE ALSO
+.BR tc(8)
+
+
+.SH AUTHORS
+Michal Sojka <sojkam1@fel.cvut.cz>, Pavel Pisa <pisa@cmp.felk.cvut.cz>,
+Rostislav Lisovy <lisovy@gmail.cz>.
+
+This manpage maintained by Rostislav Lisovy <lisovy@gmail.com>
+
--
1.7.10
next prev parent reply other threads:[~2012-07-27 10:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 10:02 [PATCH iproute2 v2 0/3] CAN Filter/Classifier Marc Kleine-Budde
2012-07-27 10:02 ` [PATCH iproute2 v2 1/3] Add missing can.h Marc Kleine-Budde
2012-07-27 10:02 ` [PATCH iproute2 v2 2/3] CAN Filter/Classifier -- Source code Marc Kleine-Budde
2012-07-27 10:02 ` Marc Kleine-Budde [this message]
2012-07-27 13:56 ` [PATCH iproute2 v2 0/3] CAN Filter/Classifier Oliver Hartkopp
2012-07-27 13:58 ` Marc Kleine-Budde
2012-07-27 14:06 ` Oliver Hartkopp
2012-07-27 14:09 ` Rostislav Lisovy
2012-07-27 16:35 ` Oliver Hartkopp
2012-08-20 20:06 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343383363-6174-4-git-send-email-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=lartc@vger.kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=lisovy@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pisa@cmp.felk.cvut.cz \
--cc=sojkam1@fel.cvut.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).