]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: gred: Fix oops in gred_dump() in WRED mode
authorDavid Ward <david.ward@ll.mit.edu>
Sun, 15 Apr 2012 12:31:45 +0000 (12:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Apr 2012 03:51:07 +0000 (23:51 -0400)
commit61e743298a22f170d57a5b3328767d0aa2007e64
tree10d2c717d7a5e547b4451b61e35b162c0457b8b9
parenta19cef45a1f286d1870c428267b6297ba6f84190
net_sched: gred: Fix oops in gred_dump() in WRED mode

A parameter set exists for WRED mode, called wred_set, to hold the same
values for qavg and qidlestart across all VQs. The WRED mode values had
been previously held in the VQ for the default DP. After these values
were moved to wred_set, the VQ for the default DP was no longer created
automatically (so that it could be omitted on purpose, to have packets
in the default DP enqueued directly to the device without using RED).

However, gred_dump() was overlooked during that change; in WRED mode it
still reads qavg/qidlestart from the VQ for the default DP, which might
not even exist. As a result, this command sequence will cause an oops:

tc qdisc add dev $DEV handle $HANDLE parent $PARENT gred setup \
    DPs 3 default 2 grio
tc qdisc change dev $DEV handle $HANDLE gred DP 0 prio 8 $RED_OPTIONS
tc qdisc change dev $DEV handle $HANDLE gred DP 1 prio 8 $RED_OPTIONS

This fixes gred_dump() in WRED mode to use the values held in wred_set.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_gred.c