[dpdk-dev] [PATCH v4 0/7] support the flow-based traffic sampling

Jiawei Wang jiaweiw at nvidia.com
Wed Aug 26 18:01:58 CEST 2020


This patch set implement the flow sampling for mlx5 driver.

The solution is introduced a new rte_flow action that will sample the incoming traffic and send a duplicated traffic with the specified ratio to the application, while the original packet will continue to the target destination.

If the sample ratio value be set to 1, means that the packets would be completely mirrored. The sample packet can be assigned with different set of actions from the original packet.

MLX5 PMD driver will be responsible for validate and translate the sample action while creating a flow.

v4:
* Rebase.
* Fix the coding style issue.

v3:
* Remove 'const' of ratio field.
* Update description and commit messages.

v2:
* Rebase patches based on the latest code.
* Update rte_flow and release documents.
* Fix the compile error.
* Removed unnecessary change in [PATCH 7/8] net/mlx5: update the metadata register c0 support since FDB will use 5-tuple to do match.
* Update changes based on the comments.

Jiawei Wang (7):
  ethdev: introduce sample action for rte flow
  common/mlx5: glue for sample action
  common/mlx5: query sampler object capability via DevX
  net/mlx5: add the validate sample action
  net/mlx5: split sample flow into two sub flows
  net/mlx5: update translate function for sample action
  app/testpmd: add testpmd command for sample action

 app/test-pmd/cmdline_flow.c           | 285 +++++++++++++++-
 doc/guides/prog_guide/rte_flow.rst    |  25 ++
 drivers/common/mlx5/Makefile          |   5 +
 drivers/common/mlx5/linux/meson.build |   2 +
 drivers/common/mlx5/linux/mlx5_glue.c |  15 +
 drivers/common/mlx5/linux/mlx5_glue.h |  12 +
 drivers/common/mlx5/mlx5_devx_cmds.c  |  27 ++
 drivers/common/mlx5/mlx5_devx_cmds.h  |   1 +
 drivers/common/mlx5/mlx5_prm.h        |  51 +++
 drivers/net/mlx5/linux/mlx5_os.c      |  14 +
 drivers/net/mlx5/mlx5.c               |  11 +
 drivers/net/mlx5/mlx5.h               |   4 +
 drivers/net/mlx5/mlx5_flow.c          | 274 ++++++++++++++-
 drivers/net/mlx5/mlx5_flow.h          |  51 ++-
 drivers/net/mlx5/mlx5_flow_dv.c       | 627 +++++++++++++++++++++++++++++++++-
 lib/librte_ethdev/rte_flow.c          |   1 +
 lib/librte_ethdev/rte_flow.h          |  30 ++
 17 files changed, 1400 insertions(+), 35 deletions(-)

-- 
1.8.3.1



More information about the dev mailing list