netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Jamal Hadi Salim <jhs@mojatatu.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, jiri@mellanox.com, paulb@mellanox.com,
	john.fastabend@gmail.com, simon.horman@netronome.com,
	mrv@mojatatu.com, hadarh@mellanox.com, ogerlitz@mellanox.com,
	roid@mellanox.com, xiyou.wangcong@gmail.com
Subject: Re: [PATCH net-next v4 1/2] net sched actions: Add support for user cookies
Date: Tue, 17 Jan 2017 17:57:58 +0100	[thread overview]
Message-ID: <587E4D16.8030708@iogearbox.net> (raw)
In-Reply-To: <bead2dc5-87a2-2fca-d50d-871f28be1d5b@mojatatu.com>

On 01/17/2017 05:50 PM, Jamal Hadi Salim wrote:
> On 17-01-17 09:16 AM, Daniel Borkmann wrote:
>> On 01/17/2017 12:11 PM, Jamal Hadi Salim wrote:
>>> From: Jamal Hadi Salim <jhs@mojatatu.com>
>>>
>>> Introduce optional 128-bit action cookie.
>>> Like all other cookie schemes in the networking world (eg in protocols
>>> like http or existing kernel fib protocol field, etc) the idea is to save
>>> user state that when retrieved serves as a correlator. The kernel
>>> _should not_ intepret it.  The user can store whatever they wish in the
>>> 128 bits.
>> [...]
>>
>> Since it looks like you need a v5 anyway, few comments below.
>>
>>>   include/net/act_api.h        |  1 +
>>>   include/net/pkt_cls.h        |  8 ++++++++
>>>   include/uapi/linux/pkt_cls.h |  3 +++
>>>   net/sched/act_api.c          | 25 +++++++++++++++++++++++++
>>>   4 files changed, 37 insertions(+)
>>>
>>> diff --git a/include/net/act_api.h b/include/net/act_api.h
>>> index 1d71644..0692458 100644
>>> --- a/include/net/act_api.h
>>> +++ b/include/net/act_api.h
>>> @@ -41,6 +41,7 @@ struct tc_action {
>>>       struct rcu_head            tcfa_rcu;
>>>       struct gnet_stats_basic_cpu __percpu *cpu_bstats;
>>>       struct gnet_stats_queue __percpu *cpu_qstats;
>>> +    struct tc_cookie    *act_ck;
>>
>> Since we know anyway that this is part of struct tc_action, can't
>> you just give this some real/readable name like ...
>>
>>   struct tc_cookie cookie;
>
> Grep-ability.
> I was worried about when the classifier adds its cookie it
> would need to use something like cls_cookie etc.

Given this cookie is just used for correlation in user space anyway
and not processed any further by the kernel, I think we can well
handle these very few spots, so would be better if the code is more
maintainable instead.

Thanks,
Daniel

  parent reply	other threads:[~2017-01-17 16:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 11:11 [PATCH net-next v4 0/2] Add support for tc cookies Jamal Hadi Salim
2017-01-17 11:11 ` [PATCH net-next v4 1/2] net sched actions: Add support for user cookies Jamal Hadi Salim
2017-01-17 12:03   ` Jiri Pirko
2017-01-17 14:16   ` Daniel Borkmann
2017-01-17 16:50     ` Jamal Hadi Salim
2017-01-17 16:53       ` Jamal Hadi Salim
2017-01-17 16:57       ` Daniel Borkmann [this message]
2017-01-17 17:03         ` Jamal Hadi Salim
2017-01-17 17:05         ` Jiri Pirko
2017-01-18 11:00           ` Jamal Hadi Salim
2017-01-17 14:59   ` Simon Horman
2017-01-17 18:40   ` Cong Wang
2017-01-18 11:35     ` Jamal Hadi Salim
2017-01-18 11:47   ` Paul Blakey
2017-01-18 12:13     ` Jamal Hadi Salim
2017-01-17 11:11 ` [PATCH net-next v4 2/2] net sched: Trivial whitespace and stylistic changes Jamal Hadi Salim
2017-01-17 12:12   ` Jiri Pirko
2017-01-17 16:30     ` Jamal Hadi Salim
2017-01-17 12:17 ` [PATCH net-next v4 0/2] Add support for tc cookies 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=587E4D16.8030708@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hadarh@mellanox.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@mellanox.com \
    --cc=john.fastabend@gmail.com \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=paulb@mellanox.com \
    --cc=roid@mellanox.com \
    --cc=simon.horman@netronome.com \
    --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).