Subject: [pull request][net-next 00/15] mlx5 updates 2022-06-29

From: Saeed Mahameed <[email-masked]>
Date: Wed, 29 Jun 2022 17:59:50 -0700

From: Saeed Mahameed <[email-masked]>

This series adds provides two sets of updates to mlx5 driver:

1) Remove dependency between sriov and eswitch mode.
   Disabling/Enabling SRIOV won't affect eswitch mode.
2) Support offloading TC police meter action

For more information please see tag log below.

Please pull and let me know if there is any problem.

Thanks,
Saeed.

The following changes since commit 702e70143291b09e6245deb8ab904d1c18ed4f47:

  net: prestera: acl: add support for 'egress' rules (2022-06-29 14:02:37 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2022-06-29

for you to fetch changes up to 50ea3c09a2fdcb8185e3a0cb974fc93f0c0ec515:

  net/mlx5e: TC, Support offloading police action (2022-06-29 17:56:39 -0700)

----------------------------------------------------------------
mlx5-updates-2022-06-29

Chris Mi Says:
==============
Remove dependency between sriov and eswitch mode

Currently, there are three eswitch modes, none, legacy and
switchdev. None is the default mode. And when disabling sriov,
current eswitch mode will be changed to none. This patchset
removes eswitch mode none and also removes dependency between
sriov and eswitch mode. With this patchset, there are two
behavior changes:

Original behavior
-----------------
 - When driver is loaded without sriov enabled, none is the default
   mode. But actually eswitch mode should be either legacy or
   switchdev, so devlink will return unsupported when showing
   eswitch mode.
 - When disabling sriov in either legacy or switchdev mode, eswitch
   mode will be changed to none.

New behavior
------------
 - When driver is loaded, legacy will be the default mode.
 - When disabling sriov in either legacy or switchdev mode, eswitch
   mode will not be changed.

Jianbo Liu Says:
================
Add support offloading police action

This patchset supports offloading police action by flow meter ASO
object in hardware.

The first part is to add interfaces to create and destroy flow meter
ASO object, and modify meter parameters by ACCESS_ASO WQE. As multiple
objects are created at a time, and two meters are in one object,
bitmaps are used manage these meters in one creation.

Then the police action can be mapped to a meter by the action index.
After mlx5e tc action refactoring was merged and post_act table was
added, a simple tc flow with one police action is broken down into two
rules in hardware. One rule with the original match in the original
table, which performs a metadata rewrite and do metering, then jumps
to post_meter table. The second rule is placed in the post_act table
with all the actions left.

The rules in post_meter table match on the meter outcome. If the
outcome is GREEN, we merely jump back to the post_act table for
further processing. Otherwise, the outcome is RED, and we drop the
packet.

The last part is to support flow meter ASO object in sw steering.

----------------------------------------------------------------
Chris Mi (4):
      net/mlx5: E-switch, Introduce flag to indicate if vport acl namespace is created
      net/mlx5: E-switch, Introduce flag to indicate if fdb table is created
      net/mlx5: E-switch, Remove dependency between sriov and eswitch mode
      net/mlx5: E-switch: Change eswitch mode only via devlink command

Dan Carpenter (1):
      net/mlx5: delete dead code in mlx5_esw_unlock()

Jianbo Liu (9):
      net/mlx5: Add support to create SQ and CQ for ASO
      net/mlx5: Implement interfaces to control ASO SQ and CQ
      net/mlx5e: Prepare for flow meter offload if hardware supports it
      net/mlx5e: Add support to modify hardware flow meter parameters
      net/mlx5e: Get or put meter by the index of tc police action
      net/mlx5e: Add generic macros to use metadata register mapping
      net/mlx5e: Add post meter table for flow metering
      net/mlx5e: Add flow_action to parse state
      net/mlx5e: TC, Support offloading police action

Leon Romanovsky (1):
      net/mlx5: Delete ipsec_fs header file as not used

 drivers/net/ethernet/mellanox/mlx5/core/Makefile   |   7 +-
 .../ethernet/mellanox/mlx5/core/en/tc/act/act.c    |   4 +-
 .../ethernet/mellanox/mlx5/core/en/tc/act/act.h    |   3 +-
 .../ethernet/mellanox/mlx5/core/en/tc/act/police.c |  61 +++
 .../ethernet/mellanox/mlx5/core/en/tc/act/trap.c   |   2 +-
 .../net/ethernet/mellanox/mlx5/core/en/tc/meter.c  | 472 +++++++++++++++++++++
 .../net/ethernet/mellanox/mlx5/core/en/tc/meter.h  |  60 +++
 .../ethernet/mellanox/mlx5/core/en/tc/post_act.c   |   6 +-
 .../ethernet/mellanox/mlx5/core/en/tc/post_meter.c | 198 +++++++++
 .../ethernet/mellanox/mlx5/core/en/tc/post_meter.h |  27 ++
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c |   4 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h |  11 +-
 .../net/ethernet/mellanox/mlx5/core/en/tc_priv.h   |   6 +
 .../mellanox/mlx5/core/en_accel/ipsec_fs.h         |  21 -
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.h   |   3 +
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    |  71 +++-
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.h    |   8 +
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  | 113 +++--
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h  |  21 +-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c |  69 ++-
 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c  |  10 +-
 drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c  | 433 +++++++++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/lib/aso.h  |  87 ++++
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |   1 +
 .../net/ethernet/mellanox/mlx5/core/sf/devlink.c   |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/sriov.c    |   3 +-
 include/linux/mlx5/eswitch.h                       |   8 +-
 27 files changed, 1562 insertions(+), 149 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.h
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.h
 delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.h
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/lib/aso.h