All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, dcaratti@redhat.com, marcelo.leitner@gmail.com,
	Vlad Buslov <vladbu@mellanox.com>
Subject: [PATCH net-next 0/4] Implement filter terse dump mode support
Date: Thu, 14 May 2020 14:40:22 +0300	[thread overview]
Message-ID: <20200514114026.27047-1-vladbu@mellanox.com> (raw)

Implement support for terse dump mode which provides only essential
classifier/action info (handle, stats, cookie, etc.). Use new
TCA_DUMP_FLAGS_TERSE flag to prevent copying of unnecessary data from
kernel.

Implement classifier-action terse dump mode

Output rate of current upstream kernel TC filter dump implementation if
relatively low (~100k rules/sec depending on configuration). This
constraint impacts performance of software switch implementation that
rely on TC for their datapath implementation and periodically call TC
filter dump to update rules stats. Moreover, TC filter dump output a lot
of static data that don't change during the filter lifecycle (filter
key, specific action details, etc.) which constitutes significant
portion of payload on resulting netlink packets and increases amount of
syscalls necessary to dump all filters on particular Qdisc. In order to
significantly improve filter dump rate this patch sets implement new
mode of TC filter dump operation named "terse dump" mode. In this mode
only parameters necessary to identify the filter (handle, action cookie,
etc.) and data that can change during filter lifecycle (filter flags,
action stats, etc.) are preserved in dump output while everything else
is omitted.

Userspace API is implemented using new TCA_DUMP_FLAGS tlv with only
available flag value TCA_DUMP_FLAGS_TERSE. Internally, new API requires
individual classifier support (new tcf_proto_ops->terse_dump()
callback). Support for action terse dump is implemented in act API and
don't require changing individual action implementations.

The following table provides performance comparison between regular
filter dump and new terse dump mode for two classifier-action profiles:
one minimal config with L2 flower classifier and single gact action and
another heavier config with L2+5tuple flower classifier with
tunnel_key+mirred actions.

 Classifier-action type      |        dump |  terse dump | X improvement 
                             | (rules/sec) | (rules/sec) |               
-----------------------------+-------------+-------------+---------------
 L2 with gact                |       141.8 |       293.2 |          2.07 
 L2+5tuple tunnel_key+mirred |        76.4 |       198.8 |          2.60 

Benchmark details: to measure the rate tc filter dump and terse dump
commands are invoked on ingress Qdisc that have one million filters
configured using following commands.

> time sudo tc -s filter show dev ens1f0 ingress >/dev/null

> time sudo tc -s filter show terse dev ens1f0 ingress >/dev/null

Value in results table is calculated by dividing 1000000 total rules by
"real" time reported by time command.

Setup details: 2x Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz, 32GB memory

Vlad Buslov (4):
  net: sched: introduce terse dump flag
  net: sched: implement terse dump support in act
  net: sched: cls_flower: implement terse dump support
  selftests: implement flower classifier terse dump tests

 include/net/act_api.h                         |  2 +-
 include/net/pkt_cls.h                         |  1 +
 include/net/sch_generic.h                     |  4 ++
 include/uapi/linux/rtnetlink.h                |  6 ++
 net/sched/act_api.c                           | 30 ++++++--
 net/sched/cls_api.c                           | 70 ++++++++++++++++---
 net/sched/cls_flower.c                        | 43 ++++++++++++
 .../tc-testing/tc-tests/filters/tests.json    | 38 ++++++++++
 8 files changed, 177 insertions(+), 17 deletions(-)

-- 
2.21.0


             reply	other threads:[~2020-05-14 11:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 11:40 Vlad Buslov [this message]
2020-05-14 11:40 ` [PATCH net-next 1/4] net: sched: introduce terse dump flag Vlad Buslov
2020-05-14 15:00   ` kbuild test robot
2020-05-14 15:00     ` kbuild test robot
2020-05-14 20:11   ` David Miller
2020-05-14 11:40 ` [PATCH net-next 2/4] net: sched: implement terse dump support in act Vlad Buslov
2020-05-14 11:40 ` [PATCH net-next 3/4] net: sched: cls_flower: implement terse dump support Vlad Buslov
2020-05-14 11:40 ` [PATCH net-next 4/4] selftests: implement flower classifier terse dump tests Vlad Buslov
2020-05-14 13:23 ` [PATCH iproute2-next 0/2] Implement filter terse dump mode support Vlad Buslov
2020-05-14 13:23   ` [PATCH iproute2-next 1/2] tc: skip actions that don't have options attribute when printing Vlad Buslov
2020-05-14 13:42     ` Jiri Pirko
2020-05-14 13:23   ` [PATCH iproute2-next 2/2] tc: implement support for terse dump Vlad Buslov
2020-05-14 13:42     ` Jiri Pirko
2020-05-21 18:01   ` [PATCH iproute2-next 0/2] Implement filter terse dump mode support David Ahern
2020-06-01 18:58     ` David Ahern
2020-05-14 17:26 ` [PATCH net-next 0/4] " Jakub Kicinski
2020-05-15 11:25   ` Vlad Buslov

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=20200514114026.27047-1-vladbu@mellanox.com \
    --to=vladbu@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=marcelo.leitner@gmail.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.