public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jiri Kosina <jikos@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>, Phil Sutter <phil@nwl.cc>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping
Date: Mon, 24 Apr 2017 10:43:10 +0200	[thread overview]
Message-ID: <20170424084310.GB4126@nanopsycho.orion> (raw)
In-Reply-To: <alpine.LSU.2.20.1703081303490.31814@cbobk.fhfr.pm>

Wed, Mar 08, 2017 at 01:04:42PM CET, jikos@kernel.org wrote:
>From: Jiri Kosina <jkosina@suse.cz>
>
>Support the new TCA_DUMP_INVISIBLE netlink attribute that allows asking 
>kernel to perform 'full qdisc dump', as for historical reasons some of the 
>default qdiscs are being hidden by the kernel.
>
>The command syntax is being extended by voluntary 'invisible' argument to
>'tc qdisc show'.
>
>Signed-off-by: Jiri Kosina <jkosina@suse.cz>
>---

[...]


>@@ -325,7 +328,25 @@ static int tc_qdisc_list(int argc, char **argv)
> 		filter_ifindex = t.tcm_ifindex;
> 	}
> 
>-	if (rtnl_dump_request(&rth, RTM_GETQDISC, &t, sizeof(t)) < 0) {
>+	if (dump_invisible) {
>+		struct {
>+			struct nlmsghdr n;
>+			struct tcmsg t;
>+			char buf[256];
>+		} req = {
>+			.n.nlmsg_type = RTM_GETQDISC,
>+			.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)),
>+		};
>+
>+		req.t.tcm_family = AF_UNSPEC;
>+
>+		addattr(&req.n, 256, TCA_DUMP_INVISIBLE);
>+		if (rtnl_dump_request_n(&rth, &req.n) < 0) {

Jirko, you ignore the values that were previously set in "t". I think
that you can change this to do rtnl_dump_request_n always and simplify
the code a bit.


>+			perror("Cannot send dump request");
>+			return 1;
>+		}
>+
>+	} else if (rtnl_dump_request(&rth, RTM_GETQDISC, &t, sizeof(t)) < 0) {
> 		perror("Cannot send dump request");
> 		return 1;
> 	}
>-- 
>Jiri Kosina
>SUSE Labs
>

      parent reply	other threads:[~2017-04-24  8:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 12:04 [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping Jiri Kosina
2017-03-14 23:38 ` Stephen Hemminger
2017-04-24  8:43 ` Jiri Pirko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170424084310.GB4126@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox