mbox

[v2,00/19] net/mlx5: support meter

Message ID 1573184965-49691-1-git-send-email-suanmingm@mellanox.com (mailing list archive)
Headers

Message

Suanming Mou Nov. 8, 2019, 3:49 a.m. UTC
The patches introduce the meter action support for mlx5.
The design of the implementation was introduced in RFC as below:
http://inbox.dpdk.org/dev/b994cd03-02f6-cd50-120f-dcf0941e4485@mellanox.com

The implementation is followed RFC to split flow with meter to three
sub flows.
Prefix flow -> Meter flow -> Suffix flow

The srTCM color blind mode is supported only, color aware mode and
multiple meter chaining are not supported.

The patch set add the operations to get the capabilities of the meter
action, create/destroy the action, validate the action, attach/detach
the action, update the action, query the action statistics and flush
the actions resources.

Besides these, as the flow with meter action is split to three sub
flows for coloring(in prefix flow), color checking(in meter flow),
left actions applying (in suffix flow), two registers are used for the
color match and prefix-suffix flow match. That's what the "allocate
flow meter registers" patch does.

As with the three sub flows, two more flow tables are created for the
meter flow and suffix flow in patch "prepare meter flow tables". As
wrote in the RFC, meter flow and suffix flow are separated since meter
maybe shared with multiple flows.

For the meter action statistics's query, the DevX flow counter is
exposed to meter action in patch "expose flow counters management".

In the "split meter flow" patch, flow with meter is split to three
sub flow. The *_DECAP and meter action will be in the prefix flow.
And an extra tag action with unique flow id to match with the suffix
flow is also added to the prefix flow. The suffix flow will apply
all the left actions while the flow id in tag item matches.

Since the metadata copy mark action is in the meter suffix flow,
the REG_C for cpoy mark and prefix-suffix flow match is shared.
Once the meter suffix flow add the tag, metadata suffix sub flow
won't add the tag anymore but share the tag is enough. It's done
in the "share tag between meter and metadata" patch.

---
v2: rebased on top of the latest code with metadata feature

Suanming Mou (19):
  net/mlx5: add meter operation callback
  net/mlx5: fill meter capabilities using DevX
  net/mlx5: allocate flow meter registers
  net/mlx5: support meter profile operations
  net/mlx5: validate meter profile
  net/mlx5: prepare meter flow tables
  net/mlx5: add policer rules operations
  net/mlx5: support basic meter operations
  net/mlx5: add meter action creation to the glue
  net/mlx5: support meter modification operations
  net/mlx5: support meter profile update
  net/mlx5: expose flow counters management
  net/mlx5: add count action to meter
  net/mlx5: add meter statistics read and update
  net/mlx5: add meter attach and detach
  net/mlx5: support meter flow action
  net/mlx5: split meter flow
  net/mlx5: share tag between meter and metadata
  net/mlx5: clean meter resources

 drivers/net/mlx5/Makefile          |    7 +
 drivers/net/mlx5/meson.build       |    3 +
 drivers/net/mlx5/mlx5.c            |   29 +
 drivers/net/mlx5/mlx5.h            |   46 ++
 drivers/net/mlx5/mlx5_devx_cmds.c  |   23 +
 drivers/net/mlx5/mlx5_flow.c       |  632 ++++++++++++++++--
 drivers/net/mlx5/mlx5_flow.h       |  153 ++++-
 drivers/net/mlx5/mlx5_flow_dv.c    |  612 +++++++++++++++++
 drivers/net/mlx5/mlx5_flow_meter.c | 1285 ++++++++++++++++++++++++++++++++++++
 drivers/net/mlx5/mlx5_glue.c       |   30 +
 drivers/net/mlx5/mlx5_glue.h       |    9 +
 drivers/net/mlx5/mlx5_prm.h        |   45 ++
 12 files changed, 2812 insertions(+), 62 deletions(-)
 create mode 100644 drivers/net/mlx5/mlx5_flow_meter.c