summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-02-10 14:08:55 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-02-10 14:08:55 -0800
commit5bf65ba519fd1db426cf9b7ebec9d81e83373f55 (patch)
tree37b839967771df7a6bd2588ec3113c922bca0cbf
parent7e40c009a39a69181de9e8eadb1f750078c72dd2 (diff)
downloadvyatta-op-qos-5bf65ba519fd1db426cf9b7ebec9d81e83373f55.tar.gz
vyatta-op-qos-5bf65ba519fd1db426cf9b7ebec9d81e83373f55.zip
Ignore dsmark in output of show queuing
If dsmark is root class, ignore it. Bug 4450
-rwxr-xr-xscripts/vyatta-show-queueing.pl29
1 files changed, 21 insertions, 8 deletions
diff --git a/scripts/vyatta-show-queueing.pl b/scripts/vyatta-show-queueing.pl
index 657a44c..9becd8b 100755
--- a/scripts/vyatta-show-queueing.pl
+++ b/scripts/vyatta-show-queueing.pl
@@ -232,12 +232,19 @@ sub get_class {
Tree::Simple->new( $root->{info}, Tree::Simple->ROOT ) );
}
+sub qmajor {
+ my $id = shift;
+
+ $id =~ s/:.*$//;
+ return hex($id);
+}
+
# This collects all the qdisc information into one hash
# and root queue id and reference to map of qdisc to statistics
sub get_qdisc {
my $interface = shift;
my %qdisc;
- my $root;
+ my ($root, $dsmark);
open( my $tc, "/sbin/tc -s qdisc show dev $interface |" )
or die 'tc command failed: $!';
@@ -247,13 +254,19 @@ sub get_qdisc {
chomp;
/^qdisc/ && do {
# qdisc htb 1: root r2q 10 default 20 direct_packets...
- my $t;
-
- ( undef, $name, $qid, $t ) = split;
- $qid =~ s/:.*$//;
- $qid = hex($qid);
-
- $root = $qid if ( $t eq 'root' );
+ my ($t, $pqid);
+
+ ( undef, $name, $qid, $t, $pqid ) = split;
+ $qid = qmajor($qid);
+
+ if ( $name eq 'dsmark' ) {
+ $dsmark = $qid;
+ } elsif ( $t eq 'parent' && defined($dsmark)
+ && qmajor($pqid) == $dsmark ) {
+ $root = $qid;
+ } elsif ( $t eq 'root' ) {
+ $root = $qid;
+ }
next;
};