summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2022-07-03 14:02:20 +0300
committerDavid S. Miller <davem@davemloft.net>2022-07-03 14:02:20 +0300
commitc67289e064cacda22ace61b8079a4e3f0e4aa520 (patch)
treef56dd38f80670903fe885b70ba416c77884a8579 /include
parent8e60a041e4782189486bab8e0f542325b8f4b7d5 (diff)
parenta8d52b024d6d39bb1c3caf8f2b4cf7ca94b4e2ec (diff)
downloadlinux-c67289e064cacda22ace61b8079a4e3f0e4aa520.tar.xz
Merge tag 'mlx5-updates-2022-06-29' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
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. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx5/eswitch.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index 8b18fe9771f9..e2701ed0200e 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -12,7 +12,6 @@
#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)
enum {
- MLX5_ESWITCH_NONE,
MLX5_ESWITCH_LEGACY,
MLX5_ESWITCH_OFFLOADS
};
@@ -153,7 +152,7 @@ struct mlx5_core_dev *mlx5_eswitch_get_core_dev(struct mlx5_eswitch *esw);
static inline u8 mlx5_eswitch_mode(const struct mlx5_core_dev *dev)
{
- return MLX5_ESWITCH_NONE;
+ return MLX5_ESWITCH_LEGACY;
}
static inline enum devlink_eswitch_encap_mode
@@ -198,6 +197,11 @@ static inline struct mlx5_core_dev *mlx5_eswitch_get_core_dev(struct mlx5_eswitc
#endif /* CONFIG_MLX5_ESWITCH */
+static inline bool is_mdev_legacy_mode(struct mlx5_core_dev *dev)
+{
+ return mlx5_eswitch_mode(dev) == MLX5_ESWITCH_LEGACY;
+}
+
static inline bool is_mdev_switchdev_mode(struct mlx5_core_dev *dev)
{
return mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS;