From: Stephen Hemminger <shemminger@vyatta.com>
To: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] skbuff: Add new tc classify variable
Date: Tue, 7 Feb 2012 11:05:22 -0800 [thread overview]
Message-ID: <20120207110522.70663963@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1328639948-25232-1-git-send-email-siwu@hrz.tu-chemnitz.de>
On Tue, 7 Feb 2012 19:39:08 +0100
Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> wrote:
> The linux traffic control mechanism has different ways to select the
> correct class of a qdisc. A common way to do this is to use tc filters
> that are directly attached to a qdisc. Another approach is to use the
> iptables classify module. The latter one can reduce the amount of work
> necessary to process a packet when iptables is already involved in the
> packet classification.
>
> The iptables module can be used in the postrouting chain of the mangle
> table.
>
> # iptables -F -t mangle
> # iptables -X -t mangle
> # iptables -t mangle -I POSTROUTING -j CLASSIFY --set-class 1:1337
>
> A simple qdisc with two classes will now route the traffic to 1:1337
>
> # tc qdisc del dev eth0 root
> # tc qdisc add dev eth0 root handle 1: htb default 1
> # tc class add dev eth0 parent 1: classid 1:1 htb rate 15kbit burst 0kbit
> # tc class add dev eth0 parent 1: classid 1:1337 htb rate 250kbit burst 0kbit
> # tc -s class show dev eth0
>
> A similar test with an ath9k device will show a complete different
> behavior. The default class 1:1 will be used and data is sent through.
> This problem seems to be related to the fact that the shared member
> variable sk_buff::priority is used to store the tc class id of an
> outgoing packet. This variable is also used in other places for
> different purposes. An example is the ieee80211_select_queue function
> which always overwrites the priority of an outgoing skb.
>
> This conflict can be resolved by an additional member variable
> sk_buff::tc_class that is only used for the traffic control
> classification.
>
> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: Patrick McHardy <kaber@trash.net>
> Cc: Jamal Hadi Salim <hadi@cyberus.ca>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: Marek Lindner <lindner_marek@yahoo.de>
> Cc: Sven Eckelmann <sven@narfation.org>
> Cc: netfilter-devel@vger.kernel.org
> Cc: netfilter@vger.kernel.org
> Cc: coreteam@netfilter.org
> Cc: netdev@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
I don't understand why this is better, we already have mark to do this.
Your method saves adding a tc filter to map mark to classid, but that is hardly
a huge burden.
next prev parent reply other threads:[~2012-02-07 19:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 18:39 [PATCH] skbuff: Add new tc classify variable Simon Wunderlich
2012-02-07 18:58 ` David Miller
2012-02-07 20:16 ` Simon Wunderlich
2012-02-07 20:33 ` Dave Taht
2012-02-08 9:21 ` Eric Dumazet
2012-02-08 14:48 ` jamal
2012-02-07 19:05 ` Stephen Hemminger [this message]
2012-02-07 19:57 ` Simon Wunderlich
2012-02-07 21:45 ` Stephen Hemminger
2012-02-08 8:54 ` Florian Westphal
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=20120207110522.70663963@nehalam.linuxnetplumber.net \
--to=shemminger@vyatta.com \
--cc=netdev@vger.kernel.org \
--cc=simon.wunderlich@s2003.tu-chemnitz.de \
/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).