All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: davem@davemloft.net, xiyou.wangcong@gmail.com,
	eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v5 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
Date: Thu, 20 Apr 2017 16:33:13 +0200	[thread overview]
Message-ID: <20170420143313.GA19004@nanopsycho.orion> (raw)
In-Reply-To: <67dc8e10-b0df-c0c5-7c46-ac4147c1c797@mojatatu.com>

Thu, Apr 20, 2017 at 04:25:11PM CEST, jhs@mojatatu.com wrote:
>On 17-04-20 09:59 AM, Jiri Pirko wrote:
>> Thu, Apr 20, 2017 at 03:06:21PM CEST, jhs@mojatatu.com wrote:
>> > From: Jamal Hadi Salim <jhs@mojatatu.com>
>> > 
>> > When you dump hundreds of thousands of actions, getting only 32 per
>> > dump batch even when the socket buffer and memory allocations allow
>> > is inefficient.
>> > 
>> > With this change, the user will get as many as possibly fitting
>> > within the given constraints available to the kernel.
>> > 
>> > A new top level TLV space is introduced. An attribute
>> > TCAA_ACT_FLAGS is used to carry the flags indicating the user
>> > is capable of processing these large dumps. Older user space which
>> > doesn't set this flag doesn't get the large (than 32) batches.
>> > The kernel uses the TCAA_ACT_COUNT attribute to tell the user how many
>> > actions are put in a single batch. As such user space app knows how long
>> > to iterate (independent of the type of action being dumped)
>> > instead of hardcoded maximum of 32.
>> > 
>> > Some results dumping 1.5M actions, first unpatched tc which the
>> > kernel doesn't help:
>> > 
>> > prompt$ time -p tc actions ls action gact | grep index | wc -l
>> > 1500000
>> > real 1388.43
>> > user 2.07
>> > sys 1386.79
>> > 
>> > Now lets see a patched tc which sets the correct flags when requesting
>> > a dump:
>> > 
>> > prompt$ time -p updatedtc actions ls action gact | grep index | wc -l
>> > 1500000
>> > real 178.13
>> > user 2.02
>> > sys 176.96
>> > 
>> > Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
>> > ---
>> > include/uapi/linux/rtnetlink.h | 21 +++++++++++++++++--
>> > net/sched/act_api.c            | 46 +++++++++++++++++++++++++++++++++---------
>> > 2 files changed, 55 insertions(+), 12 deletions(-)
>> > 
>> > diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
>> > index cce0613..d7d28ec 100644
>> > --- a/include/uapi/linux/rtnetlink.h
>> > +++ b/include/uapi/linux/rtnetlink.h
>> > @@ -674,10 +674,27 @@ struct tcamsg {
>> > 	unsigned char	tca__pad1;
>> > 	unsigned short	tca__pad2;
>> > };
>> > +
>> > +enum {
>> > +	TCAA_UNSPEC,
>> 
>> TCAA stands for "traffic control action action". I don't get it :(
>
>TC Action Attributes == TCAA.
>
>> Prefix still sounds wrong to me, sorry :/
>> Should be:
>> TCA_SOMETHING_*
>> 
>
>TCA_ATTR_XXX ?

Of course it is an attribute. No need to have "attr" in the name. No
other enum has it. Does not make sense.

The name should contain the group name. What group this enum defines?


>
>I have another opportunity to make a change  where we should close
>the discussion on this. We cant drag it forever.
>
>cheers,
>jamal
>

  reply	other threads:[~2017-04-20 14:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 13:06 [PATCH net-next v5 0/2] net sched actions: improve action dump performance Jamal Hadi Salim
2017-04-20 13:06 ` [PATCH net-next v5 1/2] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch Jamal Hadi Salim
2017-04-20 13:59   ` Jiri Pirko
2017-04-20 14:18     ` Jamal Hadi Salim
2017-04-20 14:24       ` Jiri Pirko
2017-04-24  9:14         ` Simon Horman
2017-04-24 12:49           ` Jamal Hadi Salim
2017-04-24 14:20             ` Pablo Neira Ayuso
2017-04-24 14:42               ` Jamal Hadi Salim
2017-04-24 20:30             ` David Miller
2017-04-24 22:18               ` Jamal Hadi Salim
2017-04-24 22:24                 ` David Miller
2017-04-24 22:58                   ` Jamal Hadi Salim
2017-04-20 14:25     ` Jamal Hadi Salim
2017-04-20 14:33       ` Jiri Pirko [this message]
2017-04-20 15:08         ` Jamal Hadi Salim
2017-04-20 15:13           ` Jiri Pirko
2017-04-20 16:09   ` Eric Dumazet
2017-04-20 17:39     ` Jamal Hadi Salim
2017-04-20 13:06 ` [PATCH net-next v5 2/2] net sched actions: add time filter for action dumping Jamal Hadi Salim

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=20170420143313.GA19004@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.