Thread (33 messages) flat view 33 messages, 4 authors, 2018-01-08

Re: [patch net-next v6 06/11] net: sched: use block index as a handle instead of qdisc when block is shared

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2018-01-07 13:11:23

On 18-01-06 03:43 PM, Jiri Pirko wrote:

quoted
@@ -886,8 +887,13 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb,
	tcm->tcm_family = AF_UNSPEC;
	tcm->tcm__pad1 = 0;
	tcm->tcm__pad2 = 0;
-	tcm->tcm_ifindex = qdisc_dev(q)->ifindex;
-	tcm->tcm_parent = parent;
+	if (q) {
+		tcm->tcm_ifindex = qdisc_dev(q)->ifindex;
+		tcm->tcm_parent = parent;
+	} else {
+		tcm->tcm_ifindex = 0; /* block index is stored in parent */
+		tcm->tcm_parent = block->index;
+	}
Please guys, please look at this reuse (also on clt side). I would like
you to double-check this reuse of existing API for balock_index carrying
purpose. I believe it's UAPI safe. But please, check it out carefully.

Should not break any ABI/UAPI AFAIK. Maybe go for a negative ifindex
(not sure if zero means something speacial to someone).

cheers,
jamal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help