netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@nvidia.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Vlad Buslov <vlad@buslov.dev>, <dsahern@gmail.com>,
	<stephen@networkplumber.org>, <netdev@vger.kernel.org>,
	<davem@davemloft.net>, <xiyou.wangcong@gmail.com>,
	<jiri@resnulli.us>, <ivecera@redhat.com>,
	Vlad Buslov <vladbu@mellanox.com>
Subject: Re: [PATCH iproute2-next v3 2/2] tc: implement support for terse dump
Date: Wed, 21 Oct 2020 11:19:41 +0300	[thread overview]
Message-ID: <ygnh8sc03s9u.fsf@nvidia.com> (raw)
In-Reply-To: <5c79152f-1532-141a-b1d3-729fdd798b3f@mojatatu.com>


On Tue 20 Oct 2020 at 15:29, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> On 2020-10-19 11:18 a.m., Vlad Buslov wrote:
>>
>> On Mon 19 Oct 2020 at 16:48, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>>> On 2020-10-18 8:16 a.m., Vlad Buslov wrote:
>
> [..]
>
>>> That could be a good thing, no? you get to see the action name with the
>>> error. Its really not a big deal if you decide to do a->terse_print()
>>> instead.
>>
>> Maybe. Just saying that this change would also change user-visible
>> iproute2 behavior.
>>
>
> You are right(for the non-terse output). tbh, not sure if it is a big
> deal given it happens only for the error case (where scripts look
> for exit codes typically); having said that:
> a ->terse_print() would be ok
>
>> It is not a trivial change. To get this data we need to call
>> tc_action_ops->dump() which puts bunch of other unrelated info in
>> TCA_OPTIONS nested attr. This hurts both dump size and runtime
>> performance. Even if we add another argument to dump "terse dump, print
>> only index", index is still part of larger options structure which
>> includes at least following fields:
>>
>> #define tc_gen \
>> 	__u32                 index; \
>> 	__u32                 capab; \
>> 	int                   action; \
>> 	int                   refcnt; \
>> 	int                   bindcnt
>>
>
>
> index is the _only_ important field for analytics purposes in that list.
> i.e if i know the index i can correlate stats with one or more
> filters (whether shared or not).
> My worry is you have a very specific use case for your hardware or
> maybe it is ovs - where counters are uniquely tied to filters and
> there is no sharing. And possibly maybe only one counter can be tied
> to a filter (was not sure if you could handle more than one action
> in the terse from looking at the code).

OVS uses cookie to uniquely identify the flow and it does support
multiple actions per flow.

> Our assumptions so far had no such constraints.
> Maybe a new TERSE_OPTIONS TLV, and then add an extra flag
> to indicate interest in the tlv? Peharps store the stats in it as well.

Maybe, but wouldn't that require making it a new dump mode? Current
terse dump is already in released kernel and this seems like a
backward-incompatible change.

>
>> This wouldn't be much of a terse dump anymore. What prevents user that
>> needs all action info from calling regular dump? It is not like terse
>> dump substitutes it or somehow makes it harder to use.
>
> Both scaling and correctness are important. You have the cookie
> in the terse dump, thats a lot of data.

Cookie only consumes space in resulting netlink packet if used set the
cookie during action init. Otherwise, the cookie attribute is omitted.

> In our case we totally bypass filters to reduce the amount of data
> crossing to user space (tc action ls). Theres still a lot of data
> crossing which we could trim with a terse dump. All we are interested
> in are stats. Another alternative is perhaps to introduce the index for
> the direct dump.

What is the direct dump?

>
> cheers,
> jamal


  reply	other threads:[~2020-10-21  8:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 14:42 [PATCH iproute2-next v3 0/2] Implement filter terse dump mode support Vlad Buslov
2020-10-16 14:42 ` [PATCH iproute2-next v3 1/2] tc: skip actions that don't have options attribute when printing Vlad Buslov
2020-10-16 14:42 ` [PATCH iproute2-next v3 2/2] tc: implement support for terse dump Vlad Buslov
2020-10-16 16:07   ` Jamal Hadi Salim
2020-10-16 16:42     ` Vlad Buslov
2020-10-17 11:20       ` Jamal Hadi Salim
2020-10-18 12:16         ` Vlad Buslov
2020-10-19 13:48           ` Jamal Hadi Salim
2020-10-19 15:18             ` Vlad Buslov
2020-10-20 12:29               ` Jamal Hadi Salim
2020-10-21  8:19                 ` Vlad Buslov [this message]
2020-10-22 14:05                   ` Jamal Hadi Salim
2020-10-23 12:48                     ` Vlad Buslov
2020-10-24 17:40                       ` Jamal Hadi Salim
2020-10-26 11:28                         ` Vlad Buslov
2020-10-26 14:52                           ` David Ahern
2020-10-26 15:06                             ` Vlad Buslov
2020-10-26 15:17                               ` David Ahern
2020-10-26 17:12                           ` Jamal Hadi Salim
2020-10-26 17:46                             ` Vlad Buslov
2020-10-26 18:01                               ` Jamal Hadi Salim
2020-10-26 18:03                                 ` Vlad Buslov
2020-10-26 19:56                                   ` 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=ygnh8sc03s9u.fsf@nvidia.com \
    --to=vladbu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=ivecera@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vlad@buslov.dev \
    --cc=vladbu@mellanox.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).