All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jiri@mellanox.com, kuba@kernel.org,
	mlxsw@mellanox.com, Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 0/5] devlink: Preparations for trap policers support
Date: Sun, 22 Mar 2020 20:48:25 +0200	[thread overview]
Message-ID: <20200322184830.1254104-1-idosch@idosch.org> (raw)

From: Ido Schimmel <idosch@mellanox.com>

This patch set prepares the code for devlink-trap policer support in a
follow-up patch set [1][2]. No functional changes intended.

Policers are going to be added as attributes of packet trap groups,
which are entities used to aggregate logically related packet traps.
This will allow users, for example, to limit all the packets that
encountered an exception during routing to 10Kpps.

However, currently, device drivers register their packet trap groups
implicitly when they register their packet traps via
devlink_traps_register(). This makes it difficult to pass additional
attributes for the groups. For example, the policer bound to the group.

Therefore, this patch set converts device drivers to explicitly register
their packet trap groups. This will later allow these drivers to
register the group with additional attributes, if any.

API today:
devlink_traps_register(traps)

API after this patch set:
devlink_trap_groups_register(groups)
devlink_traps_register(traps)

API after follow-up patch set:
devlink_trap_policers_register(policers)
devlink_trap_groups_register(groups)
devlink_traps_register(traps)

Patch set overview:
Patch #1 adds the new API to register packet trap groups
Patches #2-#3 convert mlxsw and netdevsim to use the new API
Patches #4-#5 remove the old API

Tested successfully with current devlink-trap selftests.

[1] https://github.com/idosch/linux/tree/trap-policers
[2] https://github.com/idosch/iproute2/tree/trap-policers

Ido Schimmel (5):
  devlink: Add API to register packet trap groups
  mlxsw: spectrum_trap: Explicitly register packet trap groups
  netdevsim: Explicitly register packet trap groups
  devlink: Stop reference counting packet trap groups
  devlink: Only pass packet trap group identifier in trap structure

 .../ethernet/mellanox/mlxsw/spectrum_trap.c   |  38 ++-
 drivers/net/netdevsim/dev.c                   |  27 +-
 include/net/devlink.h                         |  19 +-
 net/core/devlink.c                            | 233 ++++++++++--------
 4 files changed, 202 insertions(+), 115 deletions(-)

-- 
2.24.1


             reply	other threads:[~2020-03-22 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-22 18:48 Ido Schimmel [this message]
2020-03-22 18:48 ` [PATCH net-next 1/5] devlink: Add API to register packet trap groups Ido Schimmel
2020-03-22 18:48 ` [PATCH net-next 2/5] mlxsw: spectrum_trap: Explicitly " Ido Schimmel
2020-03-22 18:48 ` [PATCH net-next 3/5] netdevsim: " Ido Schimmel
2020-03-22 18:48 ` [PATCH net-next 4/5] devlink: Stop reference counting " Ido Schimmel
2020-03-22 18:48 ` [PATCH net-next 5/5] devlink: Only pass packet trap group identifier in trap structure Ido Schimmel
2020-03-23 18:46 ` [PATCH net-next 0/5] devlink: Preparations for trap policers support Jakub Kicinski
2020-03-24  4:41 ` David Miller

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=20200322184830.1254104-1-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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.