Re: [PATCH] skbuff: Add new tc classify variable |
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Tue, 7 Feb 2012 19:39:08 +0100
Simon Wunderlich <simon.wunderlich@xxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx>
> Cc: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
> Cc: Patrick McHardy <kaber@xxxxxxxxx>
> Cc: Jamal Hadi Salim <hadi@xxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> Cc: "John W. Linville" <linville@xxxxxxxxxxxxx>
> Cc: Marek Lindner <lindner_marek@xxxxxxxx>
> Cc: Sven Eckelmann <sven@xxxxxxxxxxxxx>
> Cc: netfilter-devel@xxxxxxxxxxxxxxx
> Cc: netfilter@xxxxxxxxxxxxxxx
> Cc: coreteam@xxxxxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx
> Cc: linux-wireless@xxxxxxxxxxxxxxx
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Kernel Discussion]
[Ethernet Bridging]
[Linux Wireless Networking]
[Linux Bluetooth Networking]
[Linux Networking Users]
[VLAN]
[Git]
[IETF Annouce]
[Linux Assembly]
[Security]
[Bugtraq]
[Photo]
[Singles Social Networking]
[Yosemite Information]
[MIPS Linux]
[ARM Linux Kernel]
[ARM Linux]
[Linux Virtualization]
[Linux Security]
[Linux IDE]
[Linux RAID]
[Linux SCSI]
[Free Dating]