netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	xiyou.wangcong@gmail.com, dsa@cumulusnetworks.com,
	edumazet@google.com, stephen@networkplumber.org,
	daniel@iogearbox.net, alexander.h.duyck@intel.com,
	simon.horman@netronome.com, mlxsw@mellanox.com
Subject: Re: [patch net-next v2 02/10] net: sched: introduce tcf block infractructure
Date: Tue, 16 May 2017 15:10:34 +0200	[thread overview]
Message-ID: <20170516131034.GM1939@nanopsycho.orion> (raw)
In-Reply-To: <b0ec3fa5-8746-0c1f-27e8-cb8960c7d01f@mojatatu.com>

Tue, May 16, 2017 at 02:52:31PM CEST, jhs@mojatatu.com wrote:
>On 17-05-16 08:23 AM, Jiri Pirko wrote:
>> Tue, May 16, 2017 at 02:07:25PM CEST, jhs@mojatatu.com wrote:
>> > 
>> > Jiri,
>> > 
>> > I am sorry i am tied up elsewhere but will respond in chunks.
>> > 
>> > On 17-05-15 04:38 AM, Jiri Pirko wrote:
>> > 
>> > 
>> > >  static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
>> > >  {
>> > >  	struct qdisc_skb_cb *qcb;
>> > 
>> > 
>> > > +int tcf_block_get(struct tcf_block **p_block,
>> > > +		  struct tcf_proto __rcu **p_filter_chain)
>> > > +{
>> > > +	struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL);
>> > > +
>> > > +	if (!block)
>> > > +		return -ENOMEM;
>> > > +	block->p_filter_chain = p_filter_chain;
>> > > +	*p_block = block;
>> > > +	return 0;
>> > > +}
>> > 
>> > tcf_block_get() sounds odd. tcf_block_create()?
>> 
>> I used get/put because I plan to allow sharing of block between qdiscs
>> in future. Then there will be a refcount.
>> 
>
>Ok, I guess I should read further into the patches..
>
>
>> > > -static struct tcf_proto __rcu **atm_tc_find_tcf(struct Qdisc *sch,
>> > > -						unsigned long cl)
>> > > +static struct tcf_block *atm_tc_tcf_block(struct Qdisc *sch, unsigned long cl)
>> > 
>> > Any reason you removed the verb "find" from all these calls?
>> > eg above: better to have atm_tc_tcf_block_find()?
>> 
>> Yeah, I was thinking about it. The thing is, the callback does not do
>> any lookup so "find" is not accurate. Also without "find" this is
>> shorter so I decided for this naming variant.
>> 
>
>They do select some chain - at least that was the intent.
>Are you not planning to use this to pick a chain in a block?

No. I just need to use this to get the whole block of chains.

  reply	other threads:[~2017-05-16 13:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15  8:38 [patch net-next v2 00/10] net: sched: introduce multichain support for filters Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 01/10] net: sched: move tc_classify function to cls_api.c Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 02/10] net: sched: introduce tcf block infractructure Jiri Pirko
2017-05-16 12:07   ` Jamal Hadi Salim
2017-05-16 12:23     ` Jiri Pirko
2017-05-16 12:52       ` Jamal Hadi Salim
2017-05-16 13:10         ` Jiri Pirko [this message]
2017-05-15  8:38 ` [patch net-next v2 03/10] net: sched: rename tcf_destroy_chain helper Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 04/10] net: sched: replace nprio by a bool to make the function more readable Jiri Pirko
2017-05-16 12:09   ` Jamal Hadi Salim
2017-05-16 12:25     ` Jiri Pirko
2017-05-16 12:56       ` Jamal Hadi Salim
2017-05-15  8:38 ` [patch net-next v2 05/10] net: sched: move TC_H_MAJ macro call into tcf_auto_prio Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 06/10] net: sched: introduce helpers to work with filter chains Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 07/10] net: sched: push chain dump to a separate function Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 08/10] net: sched: introduce multichain support for filters Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 09/10] net: sched: push tp down to action init Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 10/10] net: sched: add termination action to allow goto chain Jiri Pirko
2017-05-15 20:02   ` Daniel Borkmann
2017-05-16  4:43     ` Jiri Pirko
2017-05-16  7:59       ` Daniel Borkmann
2017-05-16 12:46         ` Jamal Hadi Salim
2017-05-15  8:41 ` [patch iproute2 v2 1/3] tc_filter: add support for chain index Jiri Pirko
2017-05-15  8:41 ` [patch iproute2 v2 2/3] tc: actions: add helpers to parse and print control actions Jiri Pirko
2017-05-15  8:41 ` [patch iproute2 v2 3/3] tc/actions: introduce support for goto chain action Jiri Pirko
2017-05-16 16:20 ` [patch net-next v2 00/10] net: sched: introduce multichain support for filters David Miller
2017-05-16 16:23   ` Jiri Pirko

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=20170516131034.GM1939@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=alexander.h.duyck@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    --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;
as well as URLs for NNTP newsgroup(s).