next up previous
Next: Filters Up: Classes Previous: Unbind_tcf

Dump_class

The dump_class function on a class is used to dump diagnostic data about the class. There is a lot of data that is maintained about the classes and the dump function is used to observe these values. There is nothing more that needs to be elaborated on the dump_class function.

When the enqueue function of a queuing discipline is invoked, the tc_classify function in include/net/pkt_cls.h is called to determine the class to which the packet belongs. The simplest form of classification possible is the specification of the skb->priority field (in struct sk_buff in include/linux/skbuff.h). If skb->priority is specified, then no other classification is attempted. skb->priority is set to sk->priority (in include/net/sock.h) when the packet is created. The value of sk->priority can be specified with the help of the setsockopt call. The SO_PRIORITY option in the setsockopt call needs to be used for this purpose. However till linux kernel version 2.2.3, the value of sk->priority is limited between 0 and 7. Therefore this way of classifying packets does not work. It is worth mentioning at this point that skb->priority may contain other values like the TOS byte in the IP header. All these values are less than 65536, which is the smallest valid class number (as the minimum possible value for the major number of a class is 1). On selecting the class, the enqueue function of the queuing discipline owned by this class is invoked.

In the next section, we will look into the details involved in the implementation of filters.


next up previous
Next: Filters Up: Classes Previous: Unbind_tcf
Saravanan Radhakrishnan
1999-09-30