0001
0002
0003
0004 #ifndef __MLX5_DEVLINK_H__
0005 #define __MLX5_DEVLINK_H__
0006
0007 #include <net/devlink.h>
0008
0009 enum mlx5_devlink_param_id {
0010 MLX5_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
0011 MLX5_DEVLINK_PARAM_ID_FLOW_STEERING_MODE,
0012 MLX5_DEVLINK_PARAM_ID_ESW_LARGE_GROUP_NUM,
0013 MLX5_DEVLINK_PARAM_ID_ESW_PORT_METADATA,
0014 };
0015
0016 struct mlx5_trap_ctx {
0017 int id;
0018 int action;
0019 };
0020
0021 struct mlx5_devlink_trap {
0022 struct mlx5_trap_ctx trap;
0023 void *item;
0024 struct list_head list;
0025 };
0026
0027 struct mlx5_core_dev;
0028 void mlx5_devlink_trap_report(struct mlx5_core_dev *dev, int trap_id, struct sk_buff *skb,
0029 struct devlink_port *dl_port);
0030 int mlx5_devlink_trap_get_num_active(struct mlx5_core_dev *dev);
0031 int mlx5_devlink_traps_get_action(struct mlx5_core_dev *dev, int trap_id,
0032 enum devlink_trap_action *action);
0033
0034 struct devlink *mlx5_devlink_alloc(struct device *dev);
0035 void mlx5_devlink_free(struct devlink *devlink);
0036 int mlx5_devlink_register(struct devlink *devlink);
0037 void mlx5_devlink_unregister(struct devlink *devlink);
0038
0039 #endif