Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629308 > unrolled thread

Re: [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping

Started byJiri Pirko <jiri@resnulli.us>
First post2017-04-24 10:50 +0200
Last post2017-04-24 10:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping Jiri Pirko <jiri@resnulli.us> - 2017-04-24 10:50 +0200

#1629308 — Re: [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping

FromJiri Pirko <jiri@resnulli.us>
Date2017-04-24 10:50 +0200
SubjectRe: [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping
Message-ID<tzHR0-4JU-15@gated-at.bofh.it>
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
>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web