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

Re: [patch net-next v6 01/11] net: sched: introduce support for multiple filter chain pointers registration

From: Jiri Pirko <jiri@resnulli.us>
Date: 2018-01-06 17:11:36

Sat, Jan 06, 2018 at 12:09:19AM CET, jiri@resnulli.us wrote:
From: Jiri Pirko <redacted>

So far, there was possible only to register a single filter chain
pointer to block->chain[0]. However, when the blocks will get shareable,
we need to allow multiple filter chain pointers registration.

Signed-off-by: Jiri Pirko <redacted>
---
[...]
+static int tcf_block_insert(struct tcf_block *block, struct net *net,
+			    u32 block_index, struct netlink_ext_ack *extack)
+{
+	struct tcf_net *tn = net_generic(net, tcf_net_id);
+	int idr_start;
+	int idr_end;
+	int index;
+
+	if (block_index >= INT_MAX) {
+		NL_SET_ERR_MSG(extack, "Invalid block index value (>= INT_MAX)");
+		return -EINVAL;
+	}
+	idr_start = block_index ? block_index : 1;
+	idr_end = block_index ? block_index + 1 : INT_MAX;
+
+	index = idr_alloc(&tn->idr, block, idr_start, idr_end, GFP_KERNEL);
Oh, I have to do idr_alloc_ext
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help