[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180106171133.GC2099@nanopsycho>
Date: Sat, 6 Jan 2018 18:11:33 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, jhs@...atatu.com, xiyou.wangcong@...il.com,
mlxsw@...lanox.com, andrew@...n.ch,
vivien.didelot@...oirfairelinux.com, f.fainelli@...il.com,
michael.chan@...adcom.com, ganeshgr@...lsio.com,
saeedm@...lanox.com, matanb@...lanox.com, leonro@...lanox.com,
idosch@...lanox.com, jakub.kicinski@...ronome.com,
simon.horman@...ronome.com, pieter.jansenvanvuuren@...ronome.com,
john.hurley@...ronome.com, alexander.h.duyck@...el.com,
ogerlitz@...lanox.com, john.fastabend@...il.com,
daniel@...earbox.net, dsahern@...il.com
Subject: Re: [patch net-next v6 01/11] net: sched: introduce support for
multiple filter chain pointers registration
Sat, Jan 06, 2018 at 12:09:19AM CET, jiri@...nulli.us wrote:
>From: Jiri Pirko <jiri@...lanox.com>
>
>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 <jiri@...lanox.com>
>---
[...]
>+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
Powered by blists - more mailing lists