From patchwork Wed Sep 2 12:48:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 32831 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id D1766B70AD for ; Wed, 2 Sep 2009 22:49:05 +1000 (EST) Received: by ozlabs.org (Postfix) id BAB36DDD0B; Wed, 2 Sep 2009 22:49:05 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 38A72DDD04 for ; Wed, 2 Sep 2009 22:49:05 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbZIBMsw (ORCPT ); Wed, 2 Sep 2009 08:48:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751952AbZIBMsv (ORCPT ); Wed, 2 Sep 2009 08:48:51 -0400 Received: from gw1.cosmosbay.com ([212.99.114.194]:38754 "EHLO gw1.cosmosbay.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950AbZIBMsv (ORCPT ); Wed, 2 Sep 2009 08:48:51 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by gw1.cosmosbay.com (8.13.7/8.13.7) with ESMTP id n82CmRMG023879; Wed, 2 Sep 2009 14:48:27 +0200 Message-ID: <4A9E699B.7080400@gmail.com> Date: Wed, 02 Sep 2009 14:48:27 +0200 From: Eric Dumazet User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Stephen Hemminger CC: David Miller , jarkao2@gmail.com, cl@linux-foundation.org, kaber@trash.net, netdev@vger.kernel.org Subject: Re: [PATCH net-next-2.6] tc: report informations for multiqueue devices References: <20090902081429.GB4878@ff.dom.local> <4A9E2CC7.1010103@gmail.com> <20090902.013002.181288977.davem@davemloft.net> <4A9E6551.4030209@gmail.com> In-Reply-To: <4A9E6551.4030209@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gw1.cosmosbay.com [0.0.0.0]); Wed, 02 Sep 2009 14:48:27 +0200 (CEST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Eric Dumazet a écrit : > David Miller a écrit : >> From: Eric Dumazet >> Date: Wed, 02 Sep 2009 10:28:55 +0200 >> >>> What naming convention should we choose for multiqueue devices ? >> We could give an index field to multiple root qdiscs assigned >> to a device. > > Here is a patch then :) > > Only point is that I am iterating from 0 to dev->real_num_tx_queues > instead of dev->num_tx_queues. I hope it's fine, because there are > allocated qdisc, but not really used. > > Next patches to allow selective qdisc change/fetch (providing a TCA_QINDEX > selector value to kernel) > > Thanks > > > [PATCH net-next-2.6] tc: report informations for multiqueue devices > > qdisc and classes are not yet displayed by "tc -s -d {qdisc|class} show" > for multiqueue devices. > > We use a new TCA_QINDEX attribute, to report queue index to user space. > iproute2 tc should be changed to eventually display this queue index as in : > > $ tc -s -d qdisc > qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 > Sent 52498 bytes 465 pkt (dropped 0, overlimits 0 requeues 0) > rate 0bit 0pps backlog 0b 0p requeues 0 > qdisc pfifo_fast 0: dev eth0 qindex 1 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 > Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) > rate 0bit 0pps backlog 0b 0p requeues 0 > Here is the iproute2 patch as well, to display queue indexes Signed-off-by: Eric Dumazet --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ba3254e..b80e0f6 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -490,6 +490,7 @@ enum TCA_FCNT, TCA_STATS2, TCA_STAB, + TCA_QINDEX, __TCA_MAX }; diff --git a/tc/tc_class.c b/tc/tc_class.c index 9d4eea5..1bc4bc6 100644 --- a/tc/tc_class.c +++ b/tc/tc_class.c @@ -196,6 +196,13 @@ int print_class(const struct sockaddr_nl *who, if (filter_ifindex == 0) fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex)); + if (tb[TCA_QINDEX]) { + int qindex = 0; + + memcpy(&qindex, RTA_DATA(tb[TCA_QINDEX]), MIN(RTA_PAYLOAD(tb[TCA_QINDEX]), sizeof(int))); + fprintf(fp, "qindex %d ", qindex); + } + if (t->tcm_parent == TC_H_ROOT) fprintf(fp, "root "); else { diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c index c7f2988..3ec2cf4 100644 --- a/tc/tc_qdisc.c +++ b/tc/tc_qdisc.c @@ -232,6 +232,14 @@ int print_qdisc(const struct sockaddr_nl *who, fprintf(fp, "qdisc %s %x: ", (char*)RTA_DATA(tb[TCA_KIND]), t->tcm_handle>>16); if (filter_ifindex == 0) fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex)); + + if (tb[TCA_QINDEX]) { + int qindex = 0; + + memcpy(&qindex, RTA_DATA(tb[TCA_QINDEX]), MIN(RTA_PAYLOAD(tb[TCA_QINDEX]), sizeof(int))); + fprintf(fp, "qindex %d ", qindex); + } + if (t->tcm_parent == TC_H_ROOT) fprintf(fp, "root "); else if (t->tcm_parent) {